Skip to content

Conversation

@XilunWu
Copy link
Contributor

@XilunWu XilunWu commented Nov 26, 2024

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 26, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/141532

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 5 Unrelated Failures

As of commit 74c82f7 with merge base 6a22cae (image):

NEW FAILURE - The following job has failed:

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.

@pytorch-bot pytorch-bot bot added the oncall: distributed Add this issue/PR to distributed oncall triage queue label Nov 26, 2024
…or dtype to avoid overflow"

cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o

[ghstack-poisoned]
XilunWu added a commit that referenced this pull request Nov 26, 2024
… avoid overflow

ghstack-source-id: b107d0f
Pull Request resolved: #141532
@XilunWu XilunWu requested a review from wconstab November 26, 2024 01:10
@XilunWu XilunWu added the topic: not user facing topic category label Nov 26, 2024
…or dtype to avoid overflow"


**Summary**
DTensor RNG code raises error if the seed passed in is beyong `torch.int64` range (e.g. `torch.tensor([2**64-1])` raises error). The solution is to specify the `dtype=torch.uint64` in the `torch.tensor()` call.

cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o

[ghstack-poisoned]
XilunWu added a commit that referenced this pull request Nov 26, 2024
… avoid overflow

ghstack-source-id: b107d0f
Pull Request resolved: #141532
Copy link
Contributor

@wconstab wconstab left a comment

Choose a reason for hiding this comment

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

glad you found this, i noticed the error once but not consistently, and didn't track down where it came from.

Copy link
Collaborator

@Skylion007 Skylion007 left a comment

Choose a reason for hiding this comment

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

Bit confused here


seed_tensor = (self.rng_states[name])[0:8]
offset_tensor = torch.tensor([offset]).view(torch.uint8)
offset_tensor = torch.tensor([offset], dtype=torch.uint64).view(torch.uint8)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this immediately cast to uint8?

Copy link
Contributor

Choose a reason for hiding this comment

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

offset comes in as a uint64 essentially. we're using a tensor to convert it to its constituent bytes because this is the format used by torch's RNG state. the initial dtype=uint64 is needed to prevent overflow warnings mainly.

@Skylion007
Copy link
Collaborator

Oh I see, this is just to hide an error.

…or dtype to avoid overflow"


**Summary**
DTensor RNG code raises error if the seed passed in is beyong `torch.int64` range (e.g. `torch.tensor([2**64-1])` raises error). The solution is to specify the `dtype=torch.uint64` in the `torch.tensor()` call.

cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o

[ghstack-poisoned]
XilunWu added a commit that referenced this pull request Nov 27, 2024
… avoid overflow

ghstack-source-id: b320443
Pull Request resolved: #141532
@XilunWu XilunWu added ciflow/trunk Trigger trunk jobs on your pull request ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR labels Nov 27, 2024
@XilunWu
Copy link
Contributor Author

XilunWu commented Nov 29, 2024

@pytorchbot merge -f "python test/run_test.py --verbose -i test_optim -- -k test_forloop_goes_right_direction_multigpu times out in CI but a local run attempt is successful. This failure should be unrelated to this PR."

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

GeorgeWigley pushed a commit to graphcore/pytorch-fork that referenced this pull request Nov 29, 2024
… avoid overflow (pytorch#141532)

**Summary**
DTensor RNG code raises error if the seed passed in is beyong `torch.int64` range (e.g. `torch.tensor([2**64-1])` raises error). The solution is to specify the `dtype=torch.uint64` in the `torch.tensor()` call.

Pull Request resolved: pytorch#141532
Approved by: https://github.com/wconstab
ghstack dependencies: pytorch#141731, pytorch#141220, pytorch#141223
pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
… avoid overflow (pytorch#141532)

**Summary**
DTensor RNG code raises error if the seed passed in is beyong `torch.int64` range (e.g. `torch.tensor([2**64-1])` raises error). The solution is to specify the `dtype=torch.uint64` in the `torch.tensor()` call.

Pull Request resolved: pytorch#141532
Approved by: https://github.com/wconstab
ghstack dependencies: pytorch#141731, pytorch#141220, pytorch#141223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: distributed Add this issue/PR to distributed oncall triage queue topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants