Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug #5

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion msccl/language/instruction_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def remove_op(op: Op):


def merge_op(op: Op, other_op: Op):
if other_op in op.next:
op.next.remove(other_op)
other_op.prev.remove(op)
for p in other_op.prev:
p.next.remove(other_op)
p.next.append(op)
Expand All @@ -28,7 +31,7 @@ def merge_op(op: Op, other_op: Op):
n.prev.add(op)

op.prev = op.prev.union(other_op.prev)
op.next += other_op.next
op.next = list(set(op.next + other_op.next))


def same_tb(op1: Op, op2: Op):
Expand Down
16 changes: 8 additions & 8 deletions msccl/language/mscclpp/instruction_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _optimize_rrc_r_signal_wait(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand All @@ -266,7 +266,7 @@ def _optimize_rrc_r_signal_wait(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand All @@ -289,7 +289,7 @@ def _optimize_rrc_r_signal_wait(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand Down Expand Up @@ -320,7 +320,7 @@ def _optimize_rrc_r_signal_wait(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand Down Expand Up @@ -351,7 +351,7 @@ def _optimize_rrc_r_signal_wait(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand Down Expand Up @@ -389,7 +389,7 @@ def _optimize_rrcs_rs(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand Down Expand Up @@ -418,7 +418,7 @@ def _optimize_rrcs_rs(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand Down Expand Up @@ -447,7 +447,7 @@ def _optimize_rrcs_rs(self):
next_op.step,
)
)
remove_op(next_op)
merge_op(op, next_op)
tb.ops.remove(next_op)
queue.remove(next_op)
fused = True
Expand Down
Loading