[CUDA][BugFix] Guard tensor map enums by toolkit version - #20155
Closed
jinhongyii wants to merge 1 commit into
Closed
[CUDA][BugFix] Guard tensor map enums by toolkit version#20155jinhongyii wants to merge 1 commit into
jinhongyii wants to merge 1 commit into
Conversation
CUDA tensor-map enum members are identifiers rather than preprocessor macros, so #ifdef silently excluded the CUDA 12.8 packed data types and atomic swizzle modes even when cuda.h declared them. Use CUDA_VERSION consistently for the validation paths that reference those members.
jinhongyii
force-pushed
the
codex/fix-cuda-tensor-map-enum-guards
branch
from
August 18, 2026 02:25
fb310e1 to
af1f548
Compare
Contributor
Author
|
Closing as a duplicate of #20154, which covers every tensor-map enum guard changed here and also carries the registry correctness fixes and direct GDN/full-suite validation. |
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.
CUDA tensor-map enum members are C++ identifiers, not preprocessor macros. The existing
#ifdefchecks therefore evaluated false even when CUDA 12.8+cuda.hdeclared packed tensor-map data types and atomic 128-byte swizzle modes. This caused host validation to reject supported swizzles and to skip their packed/128-byte validation rules.\n\nThis change uses the existingCUDA_VERSION >= 12080availability contract consistently for every affected dtype and swizzle validation path. Older toolkits still compile without referencing the newer enum members.\n\nTesting:\n-pre-commit run clang-format --files src/backend/cuda/runtime/cuda_device_api.cc\n- CUDA 13 build withUSE_NVSHMEM=ON:cmake --build build --parallel 16\n- Downstream TIRx GDN swizzle path: 10 correctness launches and 3 benchmark rounds passed