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
triu/tril: complete dtype support for CPU/CUDA. #101414
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/101414
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a5c05bf: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -69,8 +69,12 @@ void triu_tril_cuda_template(const Tensor& result, const Tensor& self, int64_t k | |||
int64_t N = self.numel(); | |||
dim3 dim_block = cuda::getApplyBlock(); | |||
dim3 dim_grid((N + dim_block.x - 1) / dim_block.x); | |||
AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3(kComplexHalf, at::ScalarType::Half, at::ScalarType::Bool, | |||
self.scalar_type(), "triu_tril_cuda_template", [&]{ | |||
AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND4( |
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.
btw given that this op only copies elements or sets them to 0, can you dispatch just based on the size of the type?
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.
Are you fine with a follow-up?
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.
Yes, sure
@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 |
As per title, we can support full dtype table for these ops. Pull Request resolved: #101414 Approved by: https://github.com/ngimel
As per title, we can support full dtype table for these ops.
Stack from ghstack (oldest at bottom):
cc @ngimel @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10