From e8a635a41268b329f36c63185f3ee711ab05e63a Mon Sep 17 00:00:00 2001 From: icarus_zh <37328560+zhsurpass@users.noreply.github.com> Date: Sun, 26 Jul 2026 20:44:25 +0800 Subject: [PATCH] Load initial expert location metadata on CPU (#32435) --- python/sglang/srt/eplb/expert_location.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/eplb/expert_location.py b/python/sglang/srt/eplb/expert_location.py index e4f5de8d1..04ce28c1d 100644 --- a/python/sglang/srt/eplb/expert_location.py +++ b/python/sglang/srt/eplb/expert_location.py @@ -773,7 +773,7 @@ def compute_initial_expert_location_metadata( # TODO unify with the utils function if data.endswith(".pt"): - data_dict = torch.load(data, weights_only=True) + data_dict = torch.load(data, weights_only=True, map_location="cpu") elif data.endswith(".json"): data_dict = json.loads(Path(data).read_text()) else: