-
Notifications
You must be signed in to change notification settings - Fork 26.1k
[DebugMode] Fix hash for 0 ele tensor; Add more tests #169027
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
yushangdi
commented
Nov 25, 2025
- When tensor numel is 0, we let the hash be 0 instead of hashing, because torch.hash_tensor doesn't work for 0 numel tensors
- Add some tests for distributed
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/169027
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit bf2047a with merge base 481e5ab ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
8b10b27 to
a8651a1
Compare
541de94 to
094a7a4
Compare
torch/utils/_debug_mode.py
Outdated
| if t.numel() > 0: | ||
| out = torch.hash_tensor(t_clean) | ||
| else: | ||
| out = torch.tensor(0) |
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.
you probably still want to avoid sync here, out = torch.zeros((), device=t_clean.device)
094a7a4 to
cc76887
Compare
0a262b2 to
497d194
Compare
497d194 to
964341a
Compare
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
@pytorchbot rebase -b main |
|
@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here |
|
Successfully rebased |
964341a to
bf2047a
Compare
…hashing outputs" this is an attempt to re-land #168119 with a few tweaks: (1) for non-functional collectives, only wait on the work item with `async=True`. [See comment](#168119 (comment)) (2) For functional collectives, we can always call `wait_tensor` on the output. The test in this PR will probably conflict with the test in #169027, so ill wait for that PR to land first and rebase. [ghstack-poisoned]
this is an attempt to re-land #168119 with a few tweaks: (1) for non-functional collectives, only wait on the work item with `async=True`. [See comment](#168119 (comment)) (2) For functional collectives, we can always call `wait_tensor` on the output. The test in this PR will probably conflict with the test in #169027, so ill wait for that PR to land first and rebase. [ghstack-poisoned]
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: trunk / linux-jammy-rocm-py3.10 / test (default, 1, 6, linux.rocm.gpu.gfx942.1) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
- When tensor numel is 0, we let the hash be 0 instead of hashing, because torch.hash_tensor doesn't work for 0 numel tensors - Add some tests for distributed Pull Request resolved: #169027 Approved by: https://github.com/xmfan, https://github.com/ngimel