[CPU] Fix NUMA/core binding for DP ranks (#32856)

This commit is contained in:
Chunyuan WU
2026-08-24 12:15:38 +08:00
committed by GitHub
parent 3e30649064
commit 1daa94a069
3 changed files with 81 additions and 17 deletions
@@ -1415,8 +1415,14 @@ class ModelRunner:
)
def init_threads_binding(self):
# With --enable-dp-attention, dp partitions the existing TP group
# rather than spawning additional processes, so dp_size must not be
# multiplied into the process count here (unlike regular DP, where
# dp_size * tp_size * pp_size is the true worker count).
dp_size = 1 if get_parallel().enable_dp_attention else self.ps.dp_size
self.local_omp_cpuid = numa_utils.init_threads_binding(
tp_rank=self.ps.tp_rank, tp_size=self.ps.tp_size
numa_index=self.gpu_id,
world_size=dp_size * self.ps.tp_size * self.ps.pp_size,
)
def apply_torch_tp(self):