Work around nvcc 13.0 parse failure in group_quantize_fp8.cuh#3194
Merged
Conversation
Contributor
Signed-off-by: zhihaow6 <zhihaow6@illinois.edu>
Collaborator
|
/te-ci |
ptrendx
approved these changes
Jul 9, 2026
Contributor
Author
|
@vthumbe1503 @ptrendx Thanks for reviewing! Could anyone help to merge the pr? Thanks! |
Member
|
Merged. Thank you @xiuhu17 ! |
Contributor
Author
|
@ptrendx Thanks for the help! |
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.
Scenario
Building with CUDA 13.0 (nvcc V13.0.88, sm100) fails in every TU that includes
group_quantize_fp8.cuh(e.g.activation/glu.cu):Root cause is an nvcc 13.0 cudafe++ bug: inside the macro-expanded
TRANSFORMER_ENGINE_*_SWITCHblock, the discardedif constexprbranch constant-folds theconstexpr size_t flat_nvectemplate argument and emits an ill-formed two-token functional castunsigned long((8))into the intermediate C++, which the host compiler then rejects. Reproduces with both g++-12 and g++-13 hosts; the identical code hand-expanded (no macro) compiles fine. Confirmed with a 29-line minimal repro.Fix
Replace the
using IVecT/OVecT = Vec<IType/OType, flat_nvec>aliases (only used for::BYTESin the alignment checks) with the equivalentconstexpr size_tbyte counts (Vec<T, N>::BYTES == N * sizeof(T), utils.cuh). Semantics-identical, host-side only, no kernel change. Verified: sm100 wheel builds clean on CUDA 13.0 and the NVFP4/FP8 paths run end-to-end.