-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[DTensor] implement histc #158298
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
[DTensor] implement histc #158298
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158298
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 Cancelled Jobs, 1 Unrelated FailureAs of commit e98bc45 with merge base 194539e ( CANCELLED JOBS - The following jobs were cancelled. Please retry:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
cc H-Huang awgu wanchaol fegin fduwjj wz337 d4l3k [ghstack-poisoned]
| out_full = out_dt.full_tensor() | ||
| self.assertEqual(global_bins, out_full) | ||
|
|
||
| # TODO: support backward |
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.
I think histc might not have a backward
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.
Well that would be convenient 😅
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.
LGTM! One comment is that len(op_schema.args_schema) == 4 condition may be too strict.
|
I did a test to confirm. If I call histc(tensor), then len(args_schema) was 1. e.g default values do not show up. If I called histc(tensor, min=1,max=2), len(args_schema) was 4. E.g even though 'bins' arg was not specified by the user, its default value got 'promoted' to look like it was passed by the user. So I think ==4 is correct, not too strict. I'm not an expert on how the argument passing works though, so let me know if I missed something. |
| # TODO what is this for? | ||
| # schema_info=RuntimeSchemaInfo(1), |
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.
bins, min, and max does not affect the strategy. So we can leave RuntimeSchemaInfo unspecified.
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.
actually, min, max do affect the strategy. bins does not affect the strategy. So i think i need to set it to 4?
i am glad you raised this comment becuase I forgot about my TODO.
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.
following up, i need to specify '2' to indicate the first non-tensor arg that needs to be hashed, not 4 to indicate the last.
cc H-Huang awgu wanchaol fegin fduwjj wz337 d4l3k [ghstack-poisoned]
cc H-Huang awgu wanchaol fegin fduwjj wz337 d4l3k [ghstack-poisoned]
|
@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 |
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.
LGTM
| self.assertEqual(comm_mode.get_total_counts(), 0) | ||
|
|
||
| out_full = out_dt.full_tensor() | ||
| self.assertEqual(global_bins, out_full) |
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.
can also try using the util self. _test_op_on_dtensor added in #158112
but this would change the comm_mode numbers because it adds an extra full_tensor().
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: pull / cuda12.8-py3.10-gcc9-sm75 / test (pr_time_benchmarks, 1, 1, linux.g4dn.metal.nvidia.gpu, unstable), trunk / linux-jammy-rocm-py3.10 / build Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / linux-jammy-rocm-py3.10 / test (default, 1, 2, linux.rocm.gpu.2) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -f |
|
❌ 🤖 pytorchbot command failed: Try |
|
@pytorchbot merge -f"broken infra for rocm?" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @d4l3k