Repository navigation
Conversation
zcbenz
reviewed
Oct 25, 2026
| endif() | ||
| endforeach() | ||
| list(JOIN MLX_CUDA_COMPILATION_TARGETS ";" MLX_CUDA_COMPILATION_TARGETS) | ||
| configure_file(cuda_build_info.h.in cuda_build_info.h @ONLY) |
Member
There was a problem hiding this comment.
configure_file complicates build a lot, for simple case like this I prefer using target_compile_definitions to add a define directly.
| // Compute capability as size_t (to match Metal's variant type) | ||
| dev.info["compute_capability_major"] = static_cast<size_t>(prop.major); | ||
| dev.info["compute_capability_minor"] = static_cast<size_t>(prop.minor); | ||
| dev.info["cuda_compilation_targets"] = cu::compilation_targets; |
Member
There was a problem hiding this comment.
This is no really a device info, it is independent of device. I think we can mirror the torch.cuda.get_arch_list API with mx.cuda.get_arch_list.
dhiltgen
force-pushed
the
codex/cuda-architecture-info
branch
from
October 26, 2026 05:02
61481cf to
496c115
Compare
Contributor
Author
|
Updated to use an explicit API instead of putting into device_info. |
This branch has not been deployed
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.
This change exposes the set of CUDA compilation targets via device info so clients can determine if the build supports the discovered GPU's compute capability. This does not filter out unsupported devices to avoid ID reordering challenges if multiple devices are present, where only some are supported.
Clients can implement the compatibility logic outlined in https://docs.nvidia.com/cuda/cuda-programming-guide/01-introduction/cuda-platform.html#binary-compatibility and https://docs.nvidia.com/cuda/cuda-programming-guide/01-introduction/cuda-platform.html#ptx-compatibility to skip over unsupported devices.
Hypothetical example on a Blackwell GPU when compiled with
MLX_CUDA_ARCHITECTURES=75-real;80-real;120a-real;120-virtual