[Perf] Skip the M-RoPE warmup when every holder of the RoPE fuses it (#60246)

Signed-off-by: lesj0610 <lesj0610@gmail.com>
Co-authored-by: Isotr0py <Isotr0py@outlook.com>
This commit is contained in:
SeongJun Lee
2026-10-10 06:47:39 +00:00
committed by GitHub
co-authored by Isotr0py
parent ff440c7805
commit 699c892dd5
2 changed files with 19 additions and 8 deletions
@@ -72,7 +72,11 @@ def _warm_mrope(runner: "GPUModelRunner", model: torch.nn.Module) -> None:
(module for module in model.modules() if isinstance(module, MRotaryEmbedding)),
None,
)
if rope is None:
if rope is None or all(
getattr(module, "use_fused_qk_norm_rope_gate", False)
for module in model.modules()
if any(child is rope for child in module.children())
):
return
model_config = runner.model_config