Skip to content

Commit 7db7069

Browse files
bigPYJ1151SzymonOzog
authored andcommitted
[CI/Build][Bugfix] Fix CPU backend default threads num (vllm-project#13077)
Signed-off-by: SzymonOzog <[email protected]>
1 parent c1ab261 commit 7db7069

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vllm/platforms/cpu.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
115115
# Environment variables for CPU executor
116116
#
117117

118+
# Set default threads num for OpenMP parallel
119+
os.environ["OMP_NUM_THREADS"] = str(torch.get_num_threads())
120+
118121
# Disable torch async compiling which won't work with daemonic processes
119122
os.environ["TORCHINDUCTOR_COMPILE_THREADS"] = "1"
120123

0 commit comments

Comments
 (0)