[Fix] Fix nan error for large scale ep (#12866)
This commit is contained in:
@@ -355,10 +355,14 @@ def _compute_logical_to_all_physical_map(
|
||||
)
|
||||
|
||||
# Replace by the nearest physical expert
|
||||
if nearest_expert != -1:
|
||||
logical_to_all_physical_map[layer_id][logical_expert_id] = [
|
||||
nearest_expert
|
||||
]
|
||||
mapped_physical_experts = logical_to_all_physical_map[layer_id][
|
||||
logical_expert_id
|
||||
]
|
||||
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_value=-1
|
||||
|
||||
Reference in New Issue
Block a user