-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Relay] Recursive destructor call replaced with non-recursive for Call nodes. #7832
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ebde104 to
1101cd2
Compare
yzhliu
reviewed
Apr 14, 2021
rkimball
suggested changes
Apr 14, 2021
rkimball
reviewed
Apr 14, 2021
Contributor
Author
|
Mine is:
>ulimit -s
8192
And it fails with around 200'000 stack frames in case of the unit test for
me.
…--
Dmitriy Smirnov
On Wed, 14 Apr 2021 at 21:22, Robert Kimball ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tests/cpp/relay_dismantler_test.cc
<#7832 (comment)>:
> +#include <tvm/runtime/packed_func.h>
+#include <tvm/runtime/registry.h>
+#include <tvm/te/operation.h>
+#include <tvm/topi/broadcast.h>
+#include <tvm/topi/generic/injective.h>
+
+using namespace tvm;
+using namespace tvm::relay;
+
+TEST(Relay, OutOfStack) {
+ auto foo = [] {
+ auto add_op = relay::Op::Get("add");
+ auto c_data = tvm::runtime::NDArray::Empty({1, 2, 3}, {kDLFloat, 32, 1}, {kDLCPU, 0});
+ auto c1 = relay::Constant(c_data);
+ Call y1 = relay::Call(add_op, {c1, c1});
+ for (int i = 0; i < 16'384; i++) {
I was using ubuntu 20.04. I do have 64G RAM but I don't think that changes
the stack size. When I type ulimit -s to print the stack size I see
8182K. What do you see?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7832 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGADO35QEDRNXHYLCK4YAJDTIX2RNANCNFSM42ZXVWQA>
.
|
Contributor
|
I mistyped my stack size. Mine is the same as yours. I tried 1e5 and it worked but failed at 1e6. Since it does not take long to run even 1e6 you can just set it there and it should fail in most places. 16384 is just too small |
rkimball
approved these changes
Apr 15, 2021
mbrookhart
approved these changes
Apr 15, 2021
…l nodes. Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers. Change-Id: Ib9da3ff8af3a0a41287b8ce9ab2bee2d0813d01c Addressed requested changes Addressed requested changes, simplified the code added unit test Change-Id: I7fdd44da3b6c366a555fd9157fa3630b6e789d64
Change-Id: I6328e423670f185393d50ccd3d6fdc1326be3767
Contributor
|
Thanks @d-smirnov @rkimball @yzhliu |
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Apr 22, 2021
…l nodes. (apache#7832) * [Relay] Recursive destructor call replaced with non-recursive for Call nodes. Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers. Change-Id: Ib9da3ff8af3a0a41287b8ce9ab2bee2d0813d01c Addressed requested changes Addressed requested changes, simplified the code added unit test Change-Id: I7fdd44da3b6c366a555fd9157fa3630b6e789d64 * removed inline befor Call destructor Change-Id: I6328e423670f185393d50ccd3d6fdc1326be3767
echuraev
pushed a commit
to echuraev/tvm
that referenced
this pull request
Apr 29, 2021
…l nodes. (apache#7832) * [Relay] Recursive destructor call replaced with non-recursive for Call nodes. Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers. Change-Id: Ib9da3ff8af3a0a41287b8ce9ab2bee2d0813d01c Addressed requested changes Addressed requested changes, simplified the code added unit test Change-Id: I7fdd44da3b6c366a555fd9157fa3630b6e789d64 * removed inline befor Call destructor Change-Id: I6328e423670f185393d50ccd3d6fdc1326be3767
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…l nodes. (apache#7832) * [Relay] Recursive destructor call replaced with non-recursive for Call nodes. Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers. Change-Id: Ib9da3ff8af3a0a41287b8ce9ab2bee2d0813d01c Addressed requested changes Addressed requested changes, simplified the code added unit test Change-Id: I7fdd44da3b6c366a555fd9157fa3630b6e789d64 * removed inline befor Call destructor Change-Id: I6328e423670f185393d50ccd3d6fdc1326be3767
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…l nodes. (apache#7832) * [Relay] Recursive destructor call replaced with non-recursive for Call nodes. Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers. Change-Id: Ib9da3ff8af3a0a41287b8ce9ab2bee2d0813d01c Addressed requested changes Addressed requested changes, simplified the code added unit test Change-Id: I7fdd44da3b6c366a555fd9157fa3630b6e789d64 * removed inline befor Call destructor Change-Id: I6328e423670f185393d50ccd3d6fdc1326be3767
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…l nodes. (apache#7832) * [Relay] Recursive destructor call replaced with non-recursive for Call nodes. Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers. Change-Id: Ib9da3ff8af3a0a41287b8ce9ab2bee2d0813d01c Addressed requested changes Addressed requested changes, simplified the code added unit test Change-Id: I7fdd44da3b6c366a555fd9157fa3630b6e789d64 * removed inline befor Call destructor Change-Id: I6328e423670f185393d50ccd3d6fdc1326be3767
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
May 11, 2021
…l nodes. (apache#7832) * [Relay] Recursive destructor call replaced with non-recursive for Call nodes. Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers. Change-Id: Ib9da3ff8af3a0a41287b8ce9ab2bee2d0813d01c Addressed requested changes Addressed requested changes, simplified the code added unit test Change-Id: I7fdd44da3b6c366a555fd9157fa3630b6e789d64 * removed inline befor Call destructor Change-Id: I6328e423670f185393d50ccd3d6fdc1326be3767
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recursive destructor call replaced with non-recursive (based on ExpandDataflow) for Call nodes. This prevents OutOfStack
exception during unwinding a chain of destructors for large-sized subtrees based on smart-pointers.