[FlashInfer v0.6.13] Use CuTe DSL backend for FlashInfer per-token NVFP4 quantization (#28220)

This commit is contained in:
Ziang Li
2026-07-13 22:37:46 +08:00
committed by GitHub
parent f391c71758
commit 2cf2920d07
3 changed files with 3 additions and 5 deletions
@@ -964,6 +964,7 @@ def fused_experts_none_to_flashinfer_trtllm_fp4(
1.0 / (e4m3_max * 6.0),
sfLayout=SfLayout.layout_linear,
per_token_activation=True,
backend="cute-dsl",
)
seq_len, hidden_size = hidden_states.shape
@@ -225,7 +225,7 @@ class ModelOptNvFp4OnlineFusedMoEMethod(ModelOptNvFp4FusedMoEMethod):
weight.contiguous(),
1.0 / weight_scale_2,
sfLayout=SfLayout.layout_linear,
backend="cuda",
backend="cute-dsl",
)
rows, cols = weight.shape
weight_sf = weight_sf.view(torch.float8_e4m3fn).reshape(rows, cols // 16)
+1 -4
View File
@@ -817,10 +817,7 @@ class DefaultModelLoader(BaseModelLoader):
if is_nvfp4_online:
# Scope exact FP4 quantization math to load-time conversion only;
# restore the original environment before serving starts.
with temp_set_env(
TRTLLM_DISABLE_FP4_QUANT_FAST_MATH="1",
FLASHINFER_DISABLE_FP4_QUANT_FAST_MATH="1",
):
with temp_set_env(FLASHINFER_DISABLE_FP4_QUANT_FAST_MATH="1"):
model.load_weights(weights)
if target_device.type == "cuda":
torch.cuda.synchronize()