Skip to content

Conversation

@chunyuan-w
Copy link
Collaborator

@chunyuan-w chunyuan-w commented Dec 11, 2024

Stack from ghstack (oldest at bottom):

Fixes #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

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 11, 2024

🔗 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 (image):

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.

chunyuan-w added a commit that referenced this pull request Dec 11, 2024
@chunyuan-w chunyuan-w marked this pull request as draft December 11, 2024 09:18
@chunyuan-w chunyuan-w added topic: not user facing topic category ciflow/trunk Trigger trunk jobs on your pull request labels Dec 11, 2024
@chunyuan-w chunyuan-w marked this pull request as ready for review December 12, 2024 05:17
@chunyuan-w chunyuan-w requested a review from mingfeima December 12, 2024 10:16
@chunyuan-w
Copy link
Collaborator Author

Hi @mingfeima could you help review this PR when you get time?

@shaoyuyoung
Copy link
Contributor

Hi @mingfeima, if you are very busy, can anyone else review this PR?

dtype,
)

def test_ConvTranspose_output_channels_0(self):
Copy link
Collaborator

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?

Copy link
Collaborator Author

@chunyuan-w chunyuan-w Jan 20, 2025

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.

@mingfeima
Copy link
Collaborator

Generally LGTM:) just make sure that the test is enabled for both CUDA and CPU device.

[ghstack-poisoned]
@pytorch-bot pytorch-bot bot had a problem deploying to upload-benchmark-results January 20, 2025 03:32 Error
@pytorch-bot pytorch-bot bot had a problem deploying to upload-benchmark-results January 20, 2025 03:32 Error
@pytorch-bot pytorch-bot bot had a problem deploying to upload-benchmark-results January 20, 2025 03:32 Error
[ghstack-poisoned]
chunyuan-w added a commit that referenced this pull request Jan 20, 2025
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 04:18 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 04:18 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 04:18 Inactive
@chunyuan-w
Copy link
Collaborator Author

Generally LGTM:) just make sure that the test is enabled for both CUDA and CPU device.

I moved the test to TestConvolutionNNDeviceType and it will be enabled for both CUDA and CPU:

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

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.

TORCH_INTERNAL_ASSERT([srcBuf length] > 0, "Placeholder tensor is empty!");

@shaoyuyoung
Copy link
Contributor

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?

[ghstack-poisoned]
chunyuan-w added a commit that referenced this pull request Jan 21, 2025
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 21, 2025 03:12 Inactive
@chunyuan-w
Copy link
Collaborator Author

I verified that using the main branch (without the cpp code change in this PR), the case test_ConvTranspose_output_channels_0 will still fail on XLA with the same error message. Thus I added a @skipXLA decorator for this UT since the failure is not brought by this PR. Similar fix is needed on the XLA device as well.

The CI is all green now.

@chunyuan-w
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@malfet
Copy link
Contributor

malfet commented Jan 26, 2025

@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

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@chunyuan-w your PR has been successfully reverted.

Copy link
Contributor

@malfet malfet left a 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)

@jeffdaily jeffdaily added the ciflow/rocm Trigger "default" config CI on ROCm label Jan 27, 2025
@pytorch-bot pytorch-bot bot had a problem deploying to upload-benchmark-results January 27, 2025 22:22 Failure
@pytorch-bot pytorch-bot bot had a problem deploying to upload-benchmark-results January 27, 2025 22:22 Failure
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 27, 2025 22:22 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 27, 2025 22:22 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 27, 2025 22:22 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 27, 2025 22:22 Inactive
nWEIdia pushed a commit to nWEIdia/pytorch that referenced this pull request Jan 27, 2025
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
# 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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@github-actions
Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Mar 29, 2025
@github-actions github-actions bot closed this Apr 28, 2025
@github-actions github-actions bot deleted the gh/chunyuan-w/1/head branch June 7, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/rocm Trigger "default" config CI on ROCm ciflow/trunk Trigger trunk jobs on your pull request Merged open source Reverted Stale topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants