[Kernel] Enable optimized FlashInfer add-RMSNorm NVFP4 fusion (#51925)

Signed-off-by: Qidong Su <qidongs@nvidia.com>
Signed-off-by: Qidong Su <soodoshll@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Qidong Su
2026-09-08 17:20:32 -07:00
committed by GitHub
co-authored by OpenAI Codex
parent c268198715
commit 9e137d8d23
3 changed files with 286 additions and 0 deletions
@@ -124,6 +124,20 @@ class FixFunctionalizationPass(VllmInductorPass):
5: "scale_out",
}
self.defunctionalize(graph, node, mutated_args)
elif (
hasattr(
torch.ops.vllm,
"flashinfer_fused_add_rms_norm_nvfp4_quant",
)
and at_target
== torch.ops.vllm.flashinfer_fused_add_rms_norm_nvfp4_quant.default
):
mutated_args = {
1: "result",
2: "result_block_scale",
3: "residual",
}
self.defunctionalize(graph, node, mutated_args)
# For some reason we need to specify the args for both
# silu_and_mul and silu_and_mul_quant. The kwargs
# pathway gets the wrong answer.