[Kernel] Add opt-in load-time MXFP4 dequantization (#50814)

Signed-off-by: Liuyinfeng01 <yinfeliu@amd.com>
Co-authored-by: Shanshan Shen <467638484@qq.com>
This commit is contained in:
yinfengLiu
2026-09-22 14:51:12 +08:00
committed by GitHub
co-authored by Shanshan Shen
parent 68363d64ec
commit 2af05512cf
3 changed files with 112 additions and 3 deletions
+8
View File
@@ -131,6 +131,7 @@ if TYPE_CHECKING:
VLLM_GDN_DECODE_KERNEL: Literal["cuda", "triton"] = "cuda"
VLLM_DISABLE_PYNCCL: bool = False
VLLM_USE_OINK_OPS: bool = False
VLLM_MXFP4_EMULATION_DEQUANT_AT_LOAD: bool = False
VLLM_MXFP8_EMULATION_DEQUANT_AT_LOAD: bool = True
VLLM_ROCM_USE_AITER: bool = False
VLLM_ROCM_USE_AITER_CUSTOM_AR: bool = True
@@ -1229,6 +1230,13 @@ environment_variables: dict[str, Callable[[], Any]] = {
),
# Disable aiter ops unless specifically enabled.
# Acts as a parent switch to enable the rest of the other operations.
# Set to 1 to dequantize MXFP4 weights to BF16 once at load time and run as
# a BF16 checkpoint (no per-step weight dequant). This improves emulation
# latency at the cost of additional device memory. Default off.
"VLLM_MXFP4_EMULATION_DEQUANT_AT_LOAD": lambda: (
os.getenv("VLLM_MXFP4_EMULATION_DEQUANT_AT_LOAD", "False").lower()
in ("true", "1")
),
# On hardware without a native MXFP8 kernel (e.g. ROCm gfx942 / MI300), the
# MXFP8 emulation path dequantizes weights MXFP8->BF16 once at load time and
# runs as a BF16 checkpoint (no per-step dequant). Set to 0 to fall back to