[CI] Register CPU CI "VLLM_CPU_CI_ENV" environment variable (#52633)
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
Taneem Ibrahim committed
Aug 18, 2026 at 07:28 UTC
be3f614ff158ccecc99546958bf5e4893f8e0581
2 files changed
+5
-4
vllm/envs.py
+3
@@ -51,6 +51,7 @@ if TYPE_CHECKING:
51
VLLM_CPU_KVCACHE_SPACE: int | None = 0
52
VLLM_CPU_OMP_THREADS_BIND: str = "auto"
53
VLLM_CPU_NUM_OF_RESERVED_CPU: int | None = None
54
+ VLLM_CPU_CI_ENV: bool = False
55
VLLM_CPU_ATTN_SPLIT_KV: bool = True
56
VLLM_ZENTORCH_WEIGHT_PREPACK: bool = True
57
VLLM_CPU_INT4_W4A8: bool = True
@@ -885,6 +886,8 @@ environment_variables: dict[str, Callable[[], Any]] = {
886
if "VLLM_CPU_NUM_OF_RESERVED_CPU" in os.environ
887
else None
888
),
889
+ # (CPU backend only) whether vLLM is running in a CI environment.
890
+ "VLLM_CPU_CI_ENV": lambda: bool(int(os.getenv("VLLM_CPU_CI_ENV", "0"))),
891
# (CPU backend only) whether to enable attention spilt KV.
892
"VLLM_CPU_ATTN_SPLIT_KV": lambda: bool(
893
int(os.getenv("VLLM_CPU_ATTN_SPLIT_KV", "1"))
vllm/platforms/cpu.py
+2
-4
@@ -10,6 +10,7 @@ from typing import TYPE_CHECKING
10
11
import torch
12
13
+from vllm import envs
14
from vllm.logger import init_logger
15
from vllm.utils.cpu_resource_utils import (
16
DEVICE_CONTROL_ENV_VAR,
@@ -203,10 +204,7 @@ class CpuPlatform(Platform):
204
# cache. So use VLLM_CPU_CI_ENV to indicate the CI environment,
205
# and just execute model with dynamo + eager mode to save time.
206
# VLLM_CPU_CI_ENV is only used as an internal variable.
206
- if os.environ.get("VLLM_CPU_CI_ENV", "0") != "0":
207
- backend = "eager"
208
- else:
209
- backend = "inductor"
207
+ backend = "eager" if envs.VLLM_CPU_CI_ENV else "inductor"
208
209
compilation_config.mode = CompilationMode.DYNAMO_TRACE_ONCE
210
compilation_config.backend = backend