[diffusion] quant: add FLUX.1-dev modelopt nvfp4 support (#22672)

This commit is contained in:
Xiaoyu Zhang
2026-04-14 15:00:59 +08:00
committed by GitHub
parent 7c1bde2e38
commit f97c608caa
13 changed files with 959 additions and 81 deletions
+13
View File
@@ -47,6 +47,19 @@ def _nvfp4_arch_env():
return override_jit_cuda_arch(major, minor, suffix="a")
@torch.compiler.disable
def prewarm_nvfp4_jit_modules(
*, include_expert_quant: bool = False, include_blockwise_moe: bool = False
) -> None:
"""Materialize NVFP4 JIT modules before torch.compile traces the model."""
_jit_nvfp4_quant_module()
_jit_nvfp4_scaled_mm_module()
if include_expert_quant:
_jit_nvfp4_expert_quant_module()
if include_blockwise_moe:
_jit_nvfp4_blockwise_moe_module()
@cache_once
def _jit_nvfp4_quant_module() -> Module:
with _nvfp4_arch_env():