cpu_model_runner.py: skip the warm up if CompilationMode.NONE (#50547)
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
YAMAMOTO Takashi committed
Aug 3, 2026 at 13:34 UTC
5e35a6f4f9bbc217c599692157ca985c894373f7
1 file changed
+6
-1
vllm/v1/worker/cpu_model_runner.py
+6
-1
@@ -8,7 +8,10 @@ import torch
8
import torch.nn as nn
9
10
import vllm.utils.cpu_triton_utils as cpu_tl
11
-from vllm.config import VllmConfig
11
+from vllm.config import (
12
+ CompilationMode,
13
+ VllmConfig,
14
+)
15
from vllm.logger import init_logger
16
from vllm.model_executor.model_loader import get_model
17
from vllm.tracing import instrument
@@ -142,6 +145,8 @@ class CPUModelRunner(GPUModelRunner):
145
146
@instrument(span_name="Warmup (CPU)")
147
def warming_up_model(self) -> None:
148
+ if self.vllm_config.compilation_config.mode == CompilationMode.NONE:
149
+ return
150
logger.info("Warming up model for the compilation...")
151
# Only generate graph for the generic shape
152
with _set_global_compilation_settings(self.vllm_config):