[Bugfix][CPU] Skip set_num_threads after thread binding (#38535)

Signed-off-by: jiang1.li <jiang1.li@intel.com>
This commit is contained in:
Li, Jiang
2026-03-30 20:13:00 +08:00
committed by GitHub
parent 677424c7ac
commit 6557f4937f
2 changed files with 12 additions and 2 deletions
+9
View File
@@ -108,6 +108,15 @@ class CPUWorker(Worker):
if ret:
logger.info(ret)
# After the thread binding, changing thread num is not allowed
def skip_set_num_threads(x: int):
logger.warning(
"CPU backend doesn't allow to use "
"`torch.set_num_threads` after the thread binding, skip it."
)
torch.set_num_threads = skip_set_num_threads
# Note: unique identifier for creating allreduce shared memory
os.environ["VLLM_DIST_IDENT"] = self.distributed_init_method.split(":")[-1]
# Initialize the distributed environment.