From 3322e26420bc9ea22c5033e9199cd9fb8be5f424 Mon Sep 17 00:00:00 2001 From: "Li, Jiang" Date: Thu, 19 Mar 2026 18:24:39 +0800 Subject: [PATCH] [Bugfix] Avoid more OpenMP thread reallocation in CPU torch compile (#37538) Signed-off-by: jiang1.li --- vllm/platforms/cpu.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vllm/platforms/cpu.py b/vllm/platforms/cpu.py index c1bcf5b55..f8fc3a38a 100644 --- a/vllm/platforms/cpu.py +++ b/vllm/platforms/cpu.py @@ -281,6 +281,9 @@ class CpuPlatform(Platform): # Disable multi-stream for shared experts as no Stream on CPU os.environ["VLLM_DISABLE_SHARED_EXPERTS_STREAM"] = "1" + # Avoid inductor generates num_thread() and breaks the thread binding + os.environ["TORCHINDUCTOR_CPP_DYNAMIC_THREADS"] = "1" + # Intel OpenMP setting ld_preload_str = os.getenv("LD_PRELOAD", "") if "libiomp5.so" in ld_preload_str: