Skip to content

Commit

Permalink
Fix order issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Binyang2014 committed Jan 23, 2025
1 parent 07bd49c commit bac87b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/mscclpp/language/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ def remove_empty_fields(d):
obj["connectedTo"] = [sorted(list(peers)) for peers in obj["connectedTo"]]
gpu_instance["channels"].append(obj)
gpu_instance["channels"] = list(filter(lambda x: x["type"] != "none", gpu_instance["channels"]))
gpu_instance["channels"] = sorted(gpu_instance["channels"], key=lambda x: (x["srcbuff"], x["dstbuff"]))
gpu_instance["channels"] = sorted(
gpu_instance["channels"], key=lambda x: (x["srcbuff"], x["dstbuff"], x["type"])
)

# render for GPU NVLS channels
for i, chan in enumerate(gpu_instance["channels"]):
Expand Down Expand Up @@ -502,7 +504,7 @@ def remove_empty_fields(d):
tb_channel_dict[(srcBuffer, dstBuffer, type)] = obj
tb_channels.append(obj)
tb_channels = filter(lambda x: x["type"] != "none", tb_channels)
tb_channels = sorted(tb_channels, key=lambda x: (x["srcbuff"], x["dstbuff"]))
tb_channels = sorted(tb_channels, key=lambda x: (x["srcbuff"], x["dstbuff"], x["type"]))
for op in tb.ops:
if op.tb == -1:
continue
Expand Down

0 comments on commit bac87b6

Please sign in to comment.