diff --git a/profiler/msprof_analyze/advisor/common/graph/graph_match.py b/profiler/msprof_analyze/advisor/common/graph/graph_match.py index 84d04eef0265b8855f199f953613fe8865e52f5f..86b130e56818b439958f9f56552fc908867dfd13 100644 --- a/profiler/msprof_analyze/advisor/common/graph/graph_match.py +++ b/profiler/msprof_analyze/advisor/common/graph/graph_match.py @@ -297,7 +297,7 @@ def get_next_candidates(config: CandidateArgsConfig) -> List[Dict[Hashable, Hash # Find a longer backbone node nodes_with_maximum_backbone.append(query_node_id) - if nodes_with_maximum_backbone: + if not nodes_with_maximum_backbone: return [] # next_node is connected to the current backbone. next_node = max(nodes_with_maximum_backbone, key=lambda x: node_priority.get(x, 0))