Add NUMA Core binding in nixl_connector for CPU xPyD (#32365)
Signed-off-by: Hongming Zheng <hongming.zheng@intel.com> Signed-off-by: ZhengHongming888 <hongming.zheng@intel.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent
781ddf7868
commit
cb62e86f83
@@ -926,6 +926,17 @@ class NixlConnectorWorker:
|
||||
else:
|
||||
self.use_host_buffer = self.kv_buffer_device == "cpu"
|
||||
|
||||
# reserve different cores for start_load_kv() from model_forward()
|
||||
if self.device_type == "cpu":
|
||||
numa_core_list = current_platform.discover_numa_topology()
|
||||
# setup one last core in each numa for kv transfer.
|
||||
rsv_cores_for_kv = [
|
||||
max(each_numa_core_list) for each_numa_core_list in numa_core_list
|
||||
]
|
||||
|
||||
if rsv_cores_for_kv:
|
||||
os.sched_setaffinity(0, rsv_cores_for_kv)
|
||||
|
||||
# support for oot platform which can't register nixl memory
|
||||
# type based on kv_buffer_device
|
||||
nixl_memory_type = current_platform.get_nixl_memory_type()
|
||||
|
||||
Reference in New Issue
Block a user