-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Align CPU behavior with CUDA for ConvTranspose when out_channels=0
#142859
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/142859
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (9 Unrelated Failures)As of commit f090b3c with merge base f56c638 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @mingfeima could you help review this PR when you get time? |
|
Hi @mingfeima, if you are very busy, can anyone else review this PR? |
test/nn/test_convolution.py
Outdated
| dtype, | ||
| ) | ||
|
|
||
| def test_ConvTranspose_output_channels_0(self): |
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.
is this test going to be launched for both CPU and CUDA device?
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.
Updated the test to be launched for both CPU and CUDA device.
|
Generally LGTM:) just make sure that the test is enabled for both CUDA and CPU device. |
I moved the test to One thing to note is that it fails on MPS in the assertion here. I guess similar fix is needed on MPS side to align with CUDA as well.
|
maybe @malfet is interested in this? |
|
I verified that using the main branch (without the cpp code change in this PR), the case The CI is all green now. |
|
@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 |
|
@pytorchbot revert -m "It broke ROCM tests again, see https://hud.pytorch.org/hud/pytorch/pytorch/5cd2b34e821c293909fe3f6a958767b9c535c094/1?per_page=50&name_filter=rocm&mergeLF=true" -c ignoredsignal |
|
@pytorchbot successfully started a revert job. Check the current status here. |
|
@chunyuan-w your PR has been successfully reverted. |
…annels=0` (#142859)" This reverts commit cb814c0. Reverted #142859 on behalf of https://github.com/malfet due to It broke ROCM tests again, see https://hud.pytorch.org/hud/pytorch/pytorch/5cd2b34e821c293909fe3f6a958767b9c535c094/1?per_page=50&name_filter=rocm&mergeLF=true ([comment](#142859 (comment)))
malfet
left a comment
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.
Rather than adding more and more "skipIfFoo", imo the right solution is to move the check up thru the stack (or turn the op into structured one)
pytorch#142859) Fixes pytorch#142466. Remove the `weight.numel() != 0` check to align the behavior with CUDA for `ConvTranspose` when `out_channels=0`. After removing this check, the existing code is already able to give an empty output in such case. Test plan: ``` python -u test/nn/test_convolution.py -k test_ConvTranspose_output_channels_0_cpu_float32 python -u test/nn/test_convolution.py -k test_ConvTranspose_output_channels_0_cuda_float32 ``` Pull Request resolved: pytorch#142859 Approved by: https://github.com/mingfeima, https://github.com/malfet
…annels=0` (pytorch#142859)" This reverts commit cb814c0. Reverted pytorch#142859 on behalf of https://github.com/malfet due to It broke ROCM tests again, see https://hud.pytorch.org/hud/pytorch/pytorch/5cd2b34e821c293909fe3f6a958767b9c535c094/1?per_page=50&name_filter=rocm&mergeLF=true ([comment](pytorch#142859 (comment)))
| # aten/src/ATen/native/mps/OperationUtils.mm: TORCH_INTERNAL_ASSERT([srcBuf length] > 0, "Placeholder tensor is empty!"); on MPS | ||
| @expectedFailureMPS | ||
| @skipXLA | ||
| def test_ConvTranspose_output_channels_0(self, device, dtype): |
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 test_ConvTranspose_output_channels_0(self, device, dtype): | |
| @skipCUDAIfRocm | |
| def test_ConvTranspose_output_channels_0(self, device, dtype): |
I tried a few things to get this to work on ROCm but it's going to take longer to dig into it. I updated the use_miopen check to avoid miopen when weight.size(1) == 0 but it falls through to hipblas and then fails there instead.
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Stack from ghstack (oldest at bottom):
ConvTransposewhenout_channels=0#142859Fixes #142466.
Remove the
weight.numel() != 0check to align the behavior with CUDA forConvTransposewhenout_channels=0. After removing this check, the existing code is already able to give an empty output in such case.Test plan: