Skip to content

vllm.model_executor.kernels.linear.nvfp4.b12x

Classes:

B12xNvFp4LinearKernel

Bases: NvFp4LinearKernel

ModelOpt NVFP4 linear through the native B12X SM120 dense GEMM.

B12xNvFp4W4A16LinearKernel

Bases: B12xNvFp4LinearKernel

BF16 x NVFP4 GEMM. With quantization_config.linear.phase, b12x quantizes the activations of calls above the cutoff to NVFP4 with one global scale per call.

_activation_global_scale(x, a16_max_tokens)

NVFP4 activation multiplier of a call, from its absolute maximum.

b12x runs calls with at most a16_max_tokens rows in A16 and only checks that a scale is passed, so those skip the reduction. Traced code calls it through a custom op: vLLM compiles with dynamic shapes, so a Python branch on the row count in traced code would be fixed for every size.