Comments (8)
Hi @hanhanW ,
Yes, after rebasing I am having the same issues. I am trying to investigate a bit more, but if you have any hint, please let me know.
Thanks,
Giuseppe
from iree-llvm-sandbox.
Actually, what I found is that some memref.alloca()
instructions creep in during LowerVector
transformation. If you set ulimit -s unlimited
it should be fine, but I am wondering if this was intentional.
from iree-llvm-sandbox.
And the winner is: https://reviews.llvm.org/D119743 :)
By adding AutomaticAllocationScope
to scf::ForOp
makes this always returning the scf:::ForOp
instead of the FuncOp
.
This means that there are a lot of alloca
that now happens inside the loops, that cannot be hosted out (side effects and all), and that make the stack explode.
from iree-llvm-sandbox.
I suppose we can extend the function that finds the appropriate alloca insertion point to something like "find the farthest allocation scope that is not isolated from above".
We also discussed with the author of D119743 the idea of having an "alloca hoisting" pass that would hoist allocas from nested scopes. They originally wanted it to be a canonicalization pattern, but this may have unintended consequences as the allocation lifetime is being extended and fake dependencies being introduced across different loop iterations. If you are willing to contribute such a transformation upstream, it would be very helpful.
from iree-llvm-sandbox.
This trivial fix lets the search step over loops. @hanhanW, please check if this helps with your issue.
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
@@ -439,8 +439,14 @@ static void createFullPartialVectorTrans
// TODO: Parallelism and threadlocal considerations with a ParallelScope trait.
static Operation *getAutomaticAllocationScope(Operation *op) {
- Operation *scope =
- op->getParentWithTrait<OpTrait::AutomaticAllocationScope>();
+ Operation *scope = nullptr;
+ for (Operation *parent = op->getParentOp(); parent != nullptr;
+ parent = parent->getParentOp()) {
+ if (parent->hasTrait<OpTrait::AutomaticAllocationScope>())
+ scope = parent;
+ if (!isa<scf::ForOp>(parent))
+ break;
+ }
assert(scope && "Expected op to be inside automatic allocation scope");
return scope;
}
from iree-llvm-sandbox.
Yes, it helps the issue. I'm able to run these benchmarks with the change.
from iree-llvm-sandbox.
Fix applied in llvm/llvm-project@4c807f2
from iree-llvm-sandbox.
Thanks for the fix!
from iree-llvm-sandbox.
Related Issues (20)
- Einseum-like spec for transposes HOT 1
- Failed to cancel out unrealized_conversion_cast HOT 2
- CI fails due to failure to install a Python dependency. HOT 1
- Support padding transpose in the transform dialect HOT 2
- PDL patterns HOT 1
- Error in PDL after Interpreter refactoring HOT 6
- Why the sandbox depends on Clang and its tools? HOT 3
- Tracking ops may fail if a pattern does not call replace. HOT 4
- PadOp sometimes does not compose HOT 2
- PSA: renamed python_package -> python_packages
- PSA: Integration with IREE for multi-target and whole model compilation HOT 6
- Fuse & Tile & Pad produces possibly inefficient vector code. HOT 26
- Conv2D benchmark failed with DoubleTiling methods
- python.examples.matmul.test failed with ModuleNotFoundError
- Collaboration on data analytics workloads in MLIR HOT 12
- RFC: improve stacked commit flow
- [Substrait] Decide how to check for number of ops in module.
- [Substrait] Review construction of nested protobufs in `Export.cpp`
- Pass file name into SubstraitPB import.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iree-llvm-sandbox.