[Fix] Fix nan error for large scale ep (#12866)

This commit is contained in:
Baizhou Zhang
2025-11-11 14:44:57 -08:00
committed by GitHub
parent 4a2768a86b
commit 99e25805f5
+8 -4
View File
@@ -355,10 +355,14 @@ def _compute_logical_to_all_physical_map(
) )
# Replace by the nearest physical expert # Replace by the nearest physical expert
if nearest_expert != -1: mapped_physical_experts = logical_to_all_physical_map[layer_id][
logical_to_all_physical_map[layer_id][logical_expert_id] = [ logical_expert_id
nearest_expert ]
] if (
nearest_expert != -1
and nearest_expert not in mapped_physical_experts
):
mapped_physical_experts[0] = nearest_expert
logical_to_all_physical_map = _pad_nested_array( logical_to_all_physical_map = _pad_nested_array(
logical_to_all_physical_map, pad_value=-1 logical_to_all_physical_map, pad_value=-1