[Kernel] Porting fuse_minimax_qk_norm to manual fusion (#43410)
Signed-off-by: Jee Jee Li <jeejeelee@inferact.ai>
This commit is contained in:
@@ -135,7 +135,9 @@ class PassConfig:
|
||||
fuse_allreduce_rms: bool = None # type: ignore[assignment]
|
||||
"""Enable flashinfer allreduce fusion."""
|
||||
fuse_minimax_qk_norm: bool = None # type: ignore[assignment]
|
||||
"""Enable fused allreduce+RMSNorm for MiniMax QK norm."""
|
||||
"""Deprecated. The MiniMax QK norm fusion is now applied automatically at
|
||||
runtime (see `MiniMaxText01RMSNormTP.forward_qkv`). This flag is kept for
|
||||
backward compatibility and has no effect; it will be removed in v0.23."""
|
||||
enable_qk_norm_rope_fusion: bool = None # type: ignore[assignment]
|
||||
"""Enable fused Q/K RMSNorm + RoPE pass."""
|
||||
fuse_rope_kvcache_cat_mla: bool = None # type: ignore[assignment]
|
||||
@@ -294,6 +296,13 @@ class PassConfig:
|
||||
"current platform is not CUDA or ROCm. The fusion will be disabled."
|
||||
)
|
||||
self.fuse_rope_kvcache_cat_mla = False
|
||||
if self.fuse_minimax_qk_norm is not None:
|
||||
logger.warning_once(
|
||||
"`fuse_minimax_qk_norm` is deprecated and has no effect; "
|
||||
"the MiniMax QK norm fusion is now applied automatically at "
|
||||
"runtime when its conditions are met. This flag will be "
|
||||
"removed in v0.23."
|
||||
)
|
||||
|
||||
def log_enabled_passes(self) -> None:
|
||||
"""
|
||||
|
||||
@@ -1828,22 +1828,6 @@ class VllmConfig:
|
||||
compile_range_end,
|
||||
)
|
||||
|
||||
if compilation_config.pass_config.fuse_minimax_qk_norm:
|
||||
from vllm.compilation.passes.fusion.minimax_qk_norm_fusion import (
|
||||
MAX_TOKEN_NUM,
|
||||
)
|
||||
|
||||
max_token_num = min(
|
||||
MAX_TOKEN_NUM, self.scheduler_config.max_num_batched_tokens
|
||||
)
|
||||
if compile_range_end is not None and max_token_num < compile_range_end:
|
||||
computed_compile_ranges_endpoints.append(max_token_num)
|
||||
else:
|
||||
logger.debug(
|
||||
"Max num batched tokens below MiniMax QK norm fusion threshold, "
|
||||
"MiniMax QK norm fusion enabled for all num_tokens."
|
||||
)
|
||||
|
||||
if compilation_config.compile_ranges_endpoints is not None:
|
||||
for x in compilation_config.compile_ranges_endpoints:
|
||||
assert isinstance(x, int)
|
||||
|
||||
Reference in New Issue
Block a user