[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
|
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user