Support numactl bind for CPU and memory before process starts (#14156)
This commit is contained in:
@@ -49,6 +49,7 @@ from sglang.srt.tracing.trace import (
|
||||
trace_slice_end,
|
||||
trace_slice_start,
|
||||
)
|
||||
from sglang.srt.utils import numa_utils
|
||||
from sglang.srt.utils.common import (
|
||||
bind_port,
|
||||
configure_ipv6,
|
||||
@@ -440,7 +441,9 @@ class DataParallelController:
|
||||
writer,
|
||||
),
|
||||
)
|
||||
with memory_saver_adapter.configure_subprocess():
|
||||
with memory_saver_adapter.configure_subprocess(), numa_utils.configure_subprocess(
|
||||
server_args, gpu_id
|
||||
):
|
||||
proc.start()
|
||||
self.scheduler_procs.append(proc)
|
||||
scheduler_pipe_readers.append(reader)
|
||||
|
||||
@@ -2631,7 +2631,9 @@ def run_scheduler_process(
|
||||
set_gpu_proc_affinity(
|
||||
server_args.pp_size, server_args.tp_size, server_args.nnodes, gpu_id
|
||||
)
|
||||
if (numa_node := server_args.numa_node) is not None:
|
||||
if (
|
||||
numa_node := server_args.numa_node
|
||||
) is not None and not envs.SGLANG_NUMA_BIND_V2.get():
|
||||
numa_bind_to_node(numa_node[gpu_id])
|
||||
|
||||
# Set up tracing
|
||||
|
||||
Reference in New Issue
Block a user