[Bug] Fix batch invariance nvfp4 support (#39820)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-04-14 17:08:17 -04:00
committed by GitHub
parent b2f749dc97
commit 2ad1029233
2 changed files with 8 additions and 1 deletions
@@ -601,7 +601,13 @@ def init_nvfp4_linear_kernel() -> NvFp4LinearKernel:
# Env-var overrides.
force_kernel: type[NvFp4LinearKernel] | None = None
if envs.VLLM_USE_FBGEMM:
if envs.VLLM_BATCH_INVARIANT:
logger.info_once(
"VLLM_BATCH_INVARIANT forces NVFP4 linear to use the "
"emulation backend for deterministic execution."
)
force_kernel = EmulationNvFp4LinearKernel
elif envs.VLLM_USE_FBGEMM:
force_kernel = FbgemmNvFp4LinearKernel
elif envs.VLLM_USE_NVFP4_CT_EMULATIONS:
force_kernel = EmulationNvFp4LinearKernel