Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Binyang2014 committed Sep 12, 2024
1 parent 8006716 commit ac1dfec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
16 changes: 3 additions & 13 deletions msccl/language/mscclpp/instruction_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def _optimize_get_put(self):
fused = False
if op.inst in campactable_inst:
if len(queue) > 1:
fused = optimizer.try_compact_instruction(op, tb, queue, op.inst, same_src_dst_buffer_type)
fused = optimizer.try_compact_instructions(op, tb, queue, op.inst, same_src_dst_buffer_type)

if fused:
continue
Expand All @@ -367,18 +367,8 @@ def _compact_signal_flush_wait(self):
while len(queue) > 0:
op = queue[0]
fused = False
if op.inst == Instruction.signal:
fused = optimizer.try_compact_instruction(
op, tb, queue, Instruction.signal, same_src_dst_buffer_type
)
elif op.inst == Instruction.flush:
fused = optimizer.try_compact_instruction(
op, tb, queue, Instruction.flush, same_src_dst_buffer_type
)
elif op.inst == Instruction.wait:
fused = optimizer.try_compact_instruction(
op, tb, queue, Instruction.wait, same_src_dst_buffer_type
)
if op.inst == Instruction.signal or op.inst == Instruction.wait or op.inst == Instruction.flush:
fused = optimizer.try_compact_instructions(op, tb, queue, op.inst, same_src_dst_buffer_type)
if fused:
continue
queue = queue[1:]
Expand Down
2 changes: 1 addition & 1 deletion msccl/language/mscclpp/instruction_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def try_merge_same_instructions(
return True
return False

def try_compact_instruction(
def try_compact_instructions(
self, op: Op, tb: Threadblock, queue: list, inst_type: Instruction, same_src_dst_func: callable
) -> bool:
"""
Expand Down

0 comments on commit ac1dfec

Please sign in to comment.