[CPU] Align scheduler and NIXL CPU affinity per local rank (#53636)
Signed-off-by: Li, Tianmu <tianmu.li@intel.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Co-authored-by: Li, Jiang <jiang1.li@intel.com>
This commit is contained in:
co-authored by
OpenAI Codex
Li, Jiang <jiang1.li@intel.com>
parent
88afb77700
commit
23cd0346ce
@@ -515,6 +515,7 @@ class CpuPlatform(Platform):
|
||||
if not (os.path.exists(SYS_NODE) and os.path.exists(SYS_CPU)):
|
||||
return []
|
||||
|
||||
use_highest_sibling = cls.get_cpu_architecture() == CpuArchEnum.X86
|
||||
core_rsv_for_kv = []
|
||||
for node in os.listdir(SYS_NODE):
|
||||
if not node.startswith("node") or not node[4:].isdigit():
|
||||
@@ -547,7 +548,7 @@ class CpuPlatform(Platform):
|
||||
else:
|
||||
siblings = [cpu_id]
|
||||
|
||||
phys = min(siblings)
|
||||
phys = max(siblings) if use_highest_sibling else min(siblings)
|
||||
|
||||
if phys not in seen_phys:
|
||||
seen_phys.add(phys)
|
||||
|
||||
@@ -46,12 +46,12 @@ class OMPProcessManager:
|
||||
self.reserve_cpu_num = (
|
||||
self.local_world_size
|
||||
if current_platform.get_cpu_architecture()
|
||||
in (CpuArchEnum.ARM, CpuArchEnum.RISCV)
|
||||
in (CpuArchEnum.X86, CpuArchEnum.ARM, CpuArchEnum.RISCV)
|
||||
else 1
|
||||
)
|
||||
# reserve at one more core for nixl_connector under p/d case
|
||||
if config.kv_transfer_config:
|
||||
self.reserve_cpu_num += 1
|
||||
self.reserve_cpu_num += self.local_world_size
|
||||
|
||||
if envs.VLLM_CPU_NUM_OF_RESERVED_CPU is not None:
|
||||
if self.reserve_cpu_num > envs.VLLM_CPU_NUM_OF_RESERVED_CPU:
|
||||
|
||||
Reference in New Issue
Block a user