-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows python interop.h #1397
Windows python interop.h #1397
Conversation
Oh hey @oroppas! Don't close this PR, since it still has useful changes! I just wanted to make sure that we could share the work involved. No need to apologize, and thanks for your contributions. They are much appreciated! |
My apologies, I forgot to answer your question about #1310 versus #1376. You're right that #1376 does not include the changes in #1310, so we should definitely leave #1310 open. However, are changes in this PR covered by #1376 and #1310? If so, we should close this PR. Sorry for not grasping that earlier. |
According to https://llvm.org/docs/LangRef.html#alloca-instruction, the `alloca` instruction allocates memory on the stack frame of the currently executing function, to be automatically released when this function returns to its caller. We can avoid over allocing by placing `alloca` instruction at the function scope and outside of any loops. This change is motivated by onnx/onnx-mlir#1061, where models segfault at runtime when compiling at `-O0`, due to run out of stack space. Signed-off-by: Whitney Tsang <whitneyt@ca.ibm.com>
According to https://llvm.org/docs/LangRef.html#alloca-instruction, the alloca instruction allocates memory on the stack frame of the currently executing function, to be automatically released when this function returns to its caller. We can avoid over allocing by placing alloca instruction at the function scope and outside of any loops. llvm#1397 and llvm#1437 attempted to create the allocas outside of loops directly. However, it is not always possible to create outside of the whole loop nest. For example, when lowering an operation that is already in a loop nest, or when the outer loop is only created after the placement of the alloca. This PR adds BufferLoopHoistingPass after LowerAffinePass to hoist allocations out of loop nests to avoid stack overflow. Signed-off-by: Whitney Tsang whitneyt@ca.ibm.com
It breaks windows builds when it is included. Similar fix went into torch-mlir llvm/torch-mlir#1397
It breaks windows builds when it is included. Similar fix went into torch-mlir llvm/torch-mlir#1397
It breaks windows builds when it is included. Similar fix went into torch-mlir llvm/torch-mlir#1397
It breaks windows builds when it is included. Similar fix went into torch-mlir llvm/torch-mlir#1397
Fixes #1301