CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Stop force realizing to prevent recursion errors unless it's much bigger #138881
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
Conversation
[ghstack-poisoned]
π Helpful Linksπ§ͺ See artifacts and rendered test results at hud.pytorch.org/pr/138881
Note: Links to docs will display an error until the docs builds have been completed. β No FailuresAs of commit a1f0c78 with merge base 8fbf866 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -4169,7 +4169,7 @@ def fn(x): | |||
|
|||
def test_inductor_no_recursionerror_on_for_loops(self): | |||
def forward(x): | |||
for _ in range(1000): | |||
for _ in range(10000): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already wasn't failing without the PR intended to address this. I presume some other thing ameliorated the issue, so I bumped up the threshold to make sure we would hit the recursion error unless we explicitly break it up.
|
||
mask_mod = mk_3d_flex_natten_mask(data_size, kernel_size) | ||
|
||
torch.compile(create_block_mask)(mask_mod, None, None, S, S) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This compile create_block_mask a side effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it's mainly just validating that it runs correctly in Inductor haha
@@ -599,8 +599,11 @@ def inner_fn_str(self): | |||
self.inner_fn, *self.inner_fn_args() | |||
) | |||
|
|||
def has_large_inner_fn(self): | |||
return self.inner_fn_opcount().num_ops > config.realize_opcount_threshold | |||
def has_large_inner_fn(self, threshold=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def has_large_inner_fn(self, threshold=None): | |
def has_large_inner_fn(self, threshold : Optional[int] = None) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: why not set default of threshold to be 0 in the first place since you need set it to 0 if it's None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious if this has broader perf impact since we potentially create larger kernels.
@@ -599,8 +599,11 @@ def inner_fn_str(self): | |||
self.inner_fn, *self.inner_fn_args() | |||
) | |||
|
|||
def has_large_inner_fn(self): | |||
return self.inner_fn_opcount().num_ops > config.realize_opcount_threshold | |||
def has_large_inner_fn(self, threshold=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: why not set default of threshold to be 0 in the first place since you need set it to 0 if it's None.
@shunting314 I think it's unlikely across our dashboard, since it would require a string of unbroken pointwise ops that's long enough. |
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov @rec