refactor(load-snapshot): build LoadSnapshot directly, drop legacy get_loads IPC (#30525)

Co-authored-by: cctry <cctry@fb.com>
This commit is contained in:
cctry
2026-07-09 05:58:10 -07:00
committed by GitHub
co-authored by cctry
parent 7aab39a18b
commit 1959335997
8 changed files with 153 additions and 371 deletions
@@ -15,7 +15,9 @@ from sglang.srt.managers.load_snapshot import (
SLOT_LEN_STRUCT,
SLOT_SIZE,
VERSION,
DisaggregationMetrics,
LoadSnapshot,
QueueMetrics,
ShmLoadSnapshotReader,
ShmLoadSnapshotWriter,
slot_offset,
@@ -150,14 +152,10 @@ class TestGetLoads(CustomTestCase):
cache_hit_rate=0.75,
utilization=0.5,
max_running_requests=128,
has_disaggregation=1,
disagg_mode=2,
decode_transfer_queue_reqs=4,
has_queues=1,
queue_waiting=2,
queue_grammar=1,
queue_paused=0,
queue_retracted=3,
disaggregation=DisaggregationMetrics(
mode="decode", decode_transfer_queue_reqs=4
),
queues=QueueMetrics(waiting=2, grammar=1, paused=0, retracted=3),
)
)
@@ -34,7 +34,6 @@ class TestTypeBasedDispatcher(unittest.TestCase):
FlushCacheReqInput,
FreezeGCReq,
GetInternalStateReq,
GetLoadsReqInput,
GetWeightsByNameReqInput,
InitWeightsSendGroupForRemoteInstanceReqInput,
InitWeightsUpdateGroupReqInput,
@@ -114,7 +113,6 @@ class TestTypeBasedDispatcher(unittest.TestCase):
(ExpertDistributionReq, lambda req: "expert_distribution_handled"),
(LoadLoRAAdapterReqInput, lambda req: "load_lora_adapter_handled"),
(UnloadLoRAAdapterReqInput, lambda req: "unload_lora_adapter_handled"),
(GetLoadsReqInput, lambda req: "get_loads_handled"),
]
# Create requests that conforms to the real distribution
@@ -209,7 +207,6 @@ class TestTypeBasedDispatcher(unittest.TestCase):
test_requests.append(GetWeightsByNameReqInput(name=""))
test_requests.append(ReleaseMemoryOccupationReqInput())
test_requests.append(RpcReqInput(method=""))
test_requests.append(GetLoadsReqInput())
dispatcher = TypeBasedDispatcher(mapping)