[CPU] Fix shm allreduce collision and sglang-router import - #37179
Conversation
|
/tag-run-ci-label |
32f40eb to
f0315ef
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
|
|
what's purpose for this one? run multiple ci runners on one machine? |
For smaller models, we want to support running several DP ranks on one machine, for example, DP=2 with TP=2 on a machine with 4 sub-NUMA nodes. For DP, the recommended API is the DP router (SMG) rather than native DP, as noted in the docs below. That's why we tried the SGLang DP router, and in doing so found several issues that this PR addresses. |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
Motivation
Two fixes needed to run multiple SGLang engines on a single host behind the data-parallel router (
sglang_router.launch_server --dp-size N) on the Intel CPU backend.Modifications
1. Re-export
is_port_availablefor sglang-router <= 0.3.2Fixes #23535 (the issue is closed due to inactivity but the issue persists).
#20646 moved network helpers from
sglang.srt.utils.commonto a newsglang.srt.utils.networksubmodule but did not re-export them at the package top level. sglang-router <= 0.3.2 (the latest published release) still doesfrom sglang.srt.utils import is_port_availableand crashes at launch withImportError. Added a backwards-compat re-export insglang/srt/utils/__init__.py.2. Unique shared-memory allreduce namespace per engine
shm.cppbuilds its/dev/shmsegment names fromMASTER_ADDR/MASTER_PORT+ rank. When several engines run on one host, those env vars are unset or identical, so every engine's rank 0 maps the same segment. The shared collective sequence counter desyncs and decode hangs a few seconds into steady state until the watchdog kills the replica.Fix: export each engine's
dist_init_method(tcp://host:port, unique per engine) intoMASTER_ADDR/MASTER_PORTbeforetorch.ops.sgl_kernel.initialize, giving each engine an independent shm namespace with no user env changes.setdefaultpreserves any user-provided values. Also added aninit_threads_bindinglog line for debuggability.3. Fix CI failure
test_framework_capacity_is_maximum_of_all_sourcesfails on main:#36972 changed
resolve_max_mto call the module-levelcutedsl_moe_max_num_tokens(server_args)instead of the attributeserver_args.cutedsl_moe_max_num_tokens(), but left the test'sSimpleNamespacestub untouched. The function reads fields the stub never declared.Fix it by giving the stub the fields the function reads (
max_prefill_tokens=8192,speculative_algorithm=None,prefill.backend="disabled") so it returns 8192.Notes
_is_cpu_amx_available or _is_cpu_arm64).MASTER_ADDR/MASTER_PORTare set viasetdefault, so explicit user settings are respected.CI States
Latest PR Test (Base): ✅ Run #33852093491
Latest PR Test (Extra): ❌ Run #33852093130
Latest PR Test (AMD ROCm 7.2): ❌ Run #33852093236