diff --git a/mindinsight/debugger/stream_handler/device_handler.py b/mindinsight/debugger/stream_handler/device_handler.py index c8ac9177..fe80cbe2 100644 --- a/mindinsight/debugger/stream_handler/device_handler.py +++ b/mindinsight/debugger/stream_handler/device_handler.py @@ -116,6 +116,10 @@ class DeviceHandler(StreamHandlerBase): """ for rank_id, graph_info in graphs.items(): graph_names = list(graph_info) + if len(graph_names) > 1: + # if more than one graphs in a device, sort them + # by the number following the last "_" in the graph_name + graph_names = sorted(graph_names, key=lambda x: x.split("_")[-1]) self._rank_info[rank_id].graph_names = graph_names def get(self, filter_condition=None):