-
Notifications
You must be signed in to change notification settings - Fork 26.5k
[Inductor] Add convolution output size checking to the meta function #144225
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/144225
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 67c2d5d with merge base 094ca31 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "topic: not user facing" |
| @@ -2252,6 +2252,12 @@ def _formula_transposed(ln: int, p: int, d: int, k: int, s: int, op: int) -> int | |||
| ret_shape.append( | |||
| _formula(dims[i], padding[i], dilation[i], kernel_size[i], stride[i]) | |||
| ) | |||
| torch._check( | |||
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.
| torch._check( | |
| torch._check_value( |
To make it a ValueError
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.
Thanks for the suggestion. Updated.
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 just reverted the change.
The problem is, the TORCH_CHECK in cpp/cuda kernels propagate as Python RuntimeError. As this PR was meant to align the behavior of eager and inductor, I guess that it is better to use RuntimeError for now?
pytorch/aten/src/ATen/native/cuda/NaiveConvolutionTranspose2d.cu
Lines 117 to 128 in 551f104
| if (output_width < 1 || output_height < 1) { | |
| TORCH_CHECK(false, | |
| "Given input size per channel: (", | |
| input_height, | |
| " x ", | |
| input_width, | |
| "). Calculated output spatial size per channel: (", | |
| output_height, | |
| " x ", | |
| output_width, | |
| "). Output size is too small"); | |
| } |
pytorch/aten/src/ATen/native/cuda/NaiveConvolutionTranspose3d.cu
Lines 143 to 144 in 551f104
| TORCH_CHECK(false, | |
| "Given input size per channel: (", |
pytorch/aten/src/ATen/native/NaiveConvolutionTranspose2d.cpp
Lines 115 to 116 in 551f104
| TORCH_CHECK(false, | |
| "Given input size per channel: (", |
...
This reverts commit 38d3bce70aa045a280f87244a6756f36709a6eb6.
c6fd875 to
67c2d5d
Compare
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes #144013
Adding a size check to the meta function, similar to which in the CUDA/CPU aten op.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov