-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Fix where we load CUDA only kernel when running on AMD hardware #28605
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,9 +17,9 @@ | |
| from .activation_quant_fusion import ActivationQuantFusionPass | ||
| from .fusion import RMSNormQuantFusionPass | ||
| from .fusion_attn import AttnFusionPass | ||
| from .qk_norm_rope_fusion import QKNormRoPEFusionPass | ||
|
|
||
| if current_platform.is_cuda(): | ||
| from .qk_norm_rope_fusion import QKNormRoPEFusionPass | ||
|
Comment on lines
-21
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While moving this import under This means a user on a ROCm platform could set To fix this, please also update the check in |
||
| from .collective_fusion import AllReduceFusionPass, AsyncTPPass | ||
|
|
||
| from .fix_functionalization import FixFunctionalizationPass | ||
|
|
||
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.
The new
#ifndef USE_ROCMguard incsrc/ops.h(lines 95‑101) removes the declaration offused_qk_norm_ropeon ROCm builds, butcsrc/torch_bindings.cppstill unconditionally registers the custom op at lines 178‑184 viaops.impl("fused_qk_norm_rope", torch::kCUDA, &fused_qk_norm_rope);. When building withUSE_ROCMdefined, the compiler no longer sees any declaration of that symbol before it is used, sotorch_bindings.cppfails to compile on AMD/ROCm even though the function definition still exists infused_qknorm_rope_kernel.cu. Either the declaration needs to remain available or the binding needs to be wrapped in the same guard; otherwise every ROCm build is broken.Useful? React with 👍 / 👎.