Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion python/sglang/srt/eplb/expert_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,14 @@ def update(
def logical_to_all_physical(
self, layer_id: int, logical_expert_id: int
) -> List[int]:
# Use CPU copy to avoid GPU→CPU sync on every call, which is expensive in update weights scenario
if not hasattr(self, "_logical_to_all_physical_map_cpu"):
self._logical_to_all_physical_map_cpu = (
self.logical_to_all_physical_map.cpu()
)
Comment thread
hebiao064 marked this conversation as resolved.
Outdated
return [
physical_expert_id
for physical_expert_id in self.logical_to_all_physical_map[
for physical_expert_id in self._logical_to_all_physical_map_cpu[
layer_id, logical_expert_id
].tolist()
if physical_expert_id != -1
Expand Down
Loading