Let grad ckpt apply opt-barrier to all params and buffers#7206
Merged
alanwaketan merged 5 commits intomasterfrom Jun 6, 2024
Merged
Let grad ckpt apply opt-barrier to all params and buffers#7206alanwaketan merged 5 commits intomasterfrom
alanwaketan merged 5 commits intomasterfrom
Conversation
JackCaoG
reviewed
Jun 5, 2024
| output = torch.sum(output) | ||
| output.backward() | ||
|
|
||
| hlo = torch_xla._XLAC._get_xla_tensors_hlo([model.x.weight.grad]) |
Collaborator
There was a problem hiding this comment.
didn't your change include the weight and buffer, but the test seems to try to test the HLO of the weight.grad
Collaborator
Author
There was a problem hiding this comment.
That's the way to get the full hlo. As long as the opt-barrier contains all tensors, it's fine.
JackCaoG
approved these changes
Jun 5, 2024
Collaborator
Author
|
Thanks, Jack. |
1cfb469 to
b287944
Compare
JackCaoG
reviewed
Jun 6, 2024
| self.assertEqual(opt_barrier.count("f32[128,128]"), 6) | ||
| self.assertEqual(opt_barrier.count("f32[128]"), 2) | ||
| self.assertEqual(opt_barrier.count("f32[64,64]"), 2) | ||
| # Somehow the CPU/GPU CI will not have the opt-barrier. |
Collaborator
There was a problem hiding this comment.
ehh this is weird... I can look into this tmr...
Collaborator
Author
|
Skip the GPU CI to move fast. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Let grad ckpt apply opt-barrier to all params and buffers.
Test Plan:
python test/test_operations.py -v -k test_opt_barrier