Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Binyang2014 committed Aug 15, 2024
1 parent b314728 commit 588e6f9
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions msccl/language/instruction_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ def _read(self, rank, buffer, index, size, op):

def _infer_dependencies(self):
visited = set()
for slot, ops in self.operations.items():
if ops in visited:
for _, op in self.operations.items():
if op in visited:
continue
frontier = [ops]
frontier = [op]
while len(frontier) > 0:
op = frontier[0]
if op in visited:
Expand Down Expand Up @@ -315,6 +315,7 @@ def optimize(self):
# Completes metadata for chunk_steps (number of steps from a start op) and priority (number of steps to the last op)
def _complete_metadata(self):
visited = set()

def dfs(op, cs):
# already visited and no need to update chunk_step
if op.chunk_step >= cs + 1 and op in visited:
Expand Down Expand Up @@ -348,10 +349,10 @@ def dfs(op, cs):
# recv(src, sbuf, si, _, _, _ ) send(_, _, _, dst, dbuf, di) -> recv_copy_send(src, sbuf, si, dst, dbuf, di)
def _optimize_rcs(self):
visited = set()
for slot, ops in self.operations.items():
if ops in visited:
for _, op in self.operations.items():
if op in visited:
continue
frontier = [ops]
frontier = [op]
while len(frontier) > 0:
op = frontier[0]
if op in visited:
Expand Down Expand Up @@ -382,10 +383,10 @@ def _optimize_rcs(self):
def _optimize_rrcs_rrs(self):
# RRC/S -> RRS
visited = set()
for slot, ops in self.operations.items():
if ops in visited:
for _, op in self.operations.items():
if op in visited:
continue
frontier = [ops]
frontier = [op]
while len(frontier) > 0:
op = frontier[0]
if op in visited:
Expand Down

0 comments on commit 588e6f9

Please sign in to comment.