Repository navigation
Conversation
Contributor
CI recapDashboard: View test results in Grafana |
2 tasks done
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.
What does this PR do?
On NVIDIA DGX Spark (GB10, compute capability 12.1 /
SM121) any NVFP4 models fail at runtime, which is what the majority of edge users are running. Passingquantization_config=NVFP4Config()currently fails to loadkernels-community/nvfp4-gemm(RuntimeError: Kernel 'nvfp4-gemm' variant 'torch-stable-abi29-cu130-aarch64-linux' does not support the current device: CUDA capability 12.1 of the current device is not supported by the architectures of the build: 10.0a, 12.0a), and bypassing the architecture check fails at first launch withcudaErrorNoKernelImageForDevicebecause thea-suffixedsm_100a/sm_120acubins are not binary-compatible withsm_121.This PR adds a capability-gated
nvfp4-sm121entry in_HUB_KERNEL_MAPPINGpointing atAtlas-Inference/nvfp4-dense-gemmand routesload_nvfp4_kernel()to it whentorch.cuda.get_device_capability() == (12, 1). All other Blackwell GPUs (sm_100,sm_120) keepkernels-community/nvfp4-gemm.NVFP4Kernelinterface (PackedWeight,pack,gemm,swizzled_sf_shape) expected byintegrations/nvfp4.py.w4a16_gemv_sw(single-warp-per-output W4A16 GEMV) forM <= 8decode steps and vectorizedw4a16_dequant+ cuBLAS tensor cores forM > 8prefill.Verified on DGX Spark GB10 (
SM121,torch.cuda.get_device_capability() == (12, 1)), torch 2.12.1 + CUDA 13.0,kernels0.17.2, transformersmain:from_pretrained(..., quantization_config=NVFP4Config(), use_kernels=True)onQwen/Qwen3.5-0.8BandQwen/Qwen3.5-4B(kernel pulled live from the Hub):Qwen/Qwen3.5-0.8Buse_kernels=TrueQwen/Qwen3.5-0.8BNVFP4Config()+use_kernels=TrueQwen/Qwen3.5-0.8Buse_kernels=TrueQwen/Qwen3.5-0.8BNVFP4Config()+use_kernels=TrueQwen/Qwen3.5-4Buse_kernels=TrueQwen/Qwen3.5-4BNVFP4Config()+use_kernels=TrueQwen/Qwen3.5-4Buse_kernels=TrueQwen/Qwen3.5-4BNVFP4Config()+use_kernels=TrueFollow-up to #46423 and #47883. The same
trust_remote_code=Truenote applies untilAtlas-Inferenceis on thekernelstrusted-publisher allowlist.Code Agent Policy
Before submitting
NVFP4Configgeneration checks were run on GB10 / SM121 hardware; in-repo unit tests aren't included since the path needs a real SM121 GPU and a Hub fetch.)Who can review?
@vasqu, @drbh (#47883), @danieldk, @stevhliu (docs)