Skip to content

Commit fef88bb

Browse files
committed
remove redundant check
1 parent cfb2f78 commit fef88bb

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/converter/pytorch_converter.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,18 +435,17 @@ def convert_ctrl_dep_to_data_dep(
435435
last_visited_any: Optional[ChakraNode] = None
436436
pg_name_to_nccl_ops: Dict[str, List[int]] = {}
437437
while stack:
438-
current_node = stack.pop()
438+
current_node = stack.pop()
439+
visited.add(current_node.id)
440+
439441
if current_node.type == COMM_COLL_NODE:
440442
pg_name = json_node_map[current_node.id].pg_name
441443
if pg_name in pg_name_to_nccl_ops:
442444
current_node.data_deps.append(pg_name_to_nccl_ops[pg_name][-1])
443445
pg_name_to_nccl_ops[pg_name].append(current_node.id)
444446
else:
445447
pg_name_to_nccl_ops[pg_name] = [current_node.id]
446-
if current_node.id in visited:
447-
continue
448448

449-
visited.add(current_node.id)
450449
json_node = json_node_map.get(current_node.id)
451450
if not json_node:
452451
continue

0 commit comments

Comments
 (0)