-
Notifications
You must be signed in to change notification settings - Fork 24.2k
[SDPA][EZ] Abate narrowing conversion warning spam in flash_api.cpp
#153643
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153643
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ⏳ No Failures, 1 PendingAs of commit ed8f7d9 with merge base 00e5cb3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -479,7 +479,7 @@ mha_fwd(const at::Tensor &q, // batch_size x seqlen_q x num_heads x head | |||
|
|||
// Otherwise the kernel will be launched from cuda:0 device | |||
// Cast to char to avoid compiler warning about narrowing | |||
at::cuda::CUDAGuard device_guard{(char)q.get_device()}; | |||
at::cuda::CUDAGuard device_guard{(signed char)q.get_device()}; |
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.
Minor nit: would be great if they were static casts.
@pytorchmergebot 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 |
for messages like
/workspace/pytorch/aten/src/ATen/native/transformers/cuda/flash_attn/flash_api.cpp:1396:38: warning: narrowing conversion of ‘(char)(& q)->at::Tensor::<anonymous>.at::TensorBase::get_device()’ from ‘char’ to ‘c10::DeviceIndex’ {aka ‘signed
cc @ptrblck @msaroufim @jerryzh168