Fix build failure with CUDA < 13.0: unused private fields in symmetric_tensor.h#6032
Open
x41lakazam wants to merge 1 commit intomainfrom
Open
Fix build failure with CUDA < 13.0: unused private fields in symmetric_tensor.h#6032x41lakazam wants to merge 1 commit intomainfrom
x41lakazam wants to merge 1 commit intomainfrom
Conversation
…cTensor Building with CUDA 12.x and Clang (`-Werror,-Wunused-private-field`) fails with 5 errors in `symmetric_tensor.h`: ``` error: private field 'mcast_handle_' is not used [-Werror,-Wunused-private-field] error: private field 'cu_dev_' is not used [-Werror,-Wunused-private-field] error: private field 'mc_base_ptr_' is not used [-Werror,-Wunused-private-field] error: private field 'exporter_rank_' is not used [-Werror,-Wunused-private-field] error: private field 'peer_fd_' is not used [-Werror,-Wunused-private-field] ``` These five fields are only used inside `#if (CUDA_VERSION >= 13000)` blocks (in the destructor and `setupMulticast`), but they are declared unconditionally. When building with CUDA 12.x, the usage is compiled out but the declarations remain, triggering Clang's `-Wunused-private-field`. `mc_ptr_` and `is_multicast_setup_` are intentionally left outside the guard because they are used unconditionally in `multicastPtr()`.
Contributor
Greptile SummaryThis PR fixes a build failure when compiling with CUDA < 13.0 and Clang's Key changes in
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SymmetricTensor fields] --> B{CUDA_VERSION >= 13000?}
B -- Yes --> C[All fields available:\n- mcast_handle_\n- cu_dev_\n- mc_base_ptr_\n- exporter_rank_\n- peer_fd_\n- mc_ptr_]
B -- No --> D[Only unconditional fields:\n- mc_ptr_\n- is_multicast_setup_]
C --> E[setupMulticast runs fully]
D --> F[setupMulticast throws NVF_ERROR\n'Multicast requires CUDA 13.0+']
E --> G[multicastPtr returns mc_ptr_]
F --> H[is_multicast_setup_ stays false\nmulticastPtr NVF_CHECK fails]
G --> I[Destructor: cleans up\nmc_base_ptr_, mcast_handle_,\npeer_fd_ inside #if guard]
H --> J[Destructor: skips multicast\ncleanup block entirely]
Last reviewed commit: d7ad13a |
samnordmann
approved these changes
Mar 10, 2026
Collaborator
Author
|
!test |
1 similar comment
Collaborator
|
!test |
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.
…cTensor
Building with CUDA 12.x and Clang (
-Werror,-Wunused-private-field) fails with 5 errors insymmetric_tensor.h:These five fields are only used inside
#if (CUDA_VERSION >= 13000)blocks (in the destructor andsetupMulticast), but they are declared unconditionally. When building with CUDA 12.x, the usage is compiled out but the declarations remain, triggering Clang's-Wunused-private-field.