mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-07-12 10:17:06 +00:00
use .to_dict()
This commit is contained in:
@@ -984,10 +984,10 @@ class SwitchChannel:
|
||||
self.src_rank = rank
|
||||
if src_chunk.rank not in self.rank_group.ranks:
|
||||
raise RuntimeError(
|
||||
f"Destination chunk rank {src_chunk.rank} is not part of the rank group {self.rank_group.ranks}."
|
||||
f"Source chunk rank {src_chunk.rank} is not part of the rank group {self.rank_group.ranks}."
|
||||
)
|
||||
if src_chunk.size != size:
|
||||
raise RuntimeError(f"Destination chunk size {src_chunk.size} does not match the required size {size}.")
|
||||
raise RuntimeError(f"Source chunk size {src_chunk.size} does not match the required size {size}.")
|
||||
|
||||
for rank in self.rank_group.ranks:
|
||||
if self.buffer_type == BufferType.scratch:
|
||||
|
||||
@@ -926,7 +926,7 @@ class GroupStore(BaseOperation):
|
||||
|
||||
def to_dict(self):
|
||||
result = {"name": self.name.value}
|
||||
result["src_buff"] = [{"type": self.src_chunk.buffer.value, "index": self.src_chunk.index, "size": self.size}]
|
||||
result["src_buff"] = [self.src_chunk.to_dict()]
|
||||
result["dst_buff"] = [
|
||||
{"switch_channel_id": self.channel_ids[0], "index": self.buffer_offset, "size": self.size}
|
||||
]
|
||||
@@ -958,7 +958,7 @@ class GroupStorePacket(BaseOperation):
|
||||
|
||||
def to_dict(self):
|
||||
result = {"name": self.name.value}
|
||||
result["src_buff"] = [{"type": self.src_chunk.buffer.value, "index": self.src_chunk.index, "size": self.size}]
|
||||
result["src_buff"] = [self.src_chunk.to_dict()]
|
||||
result["dst_buff"] = [
|
||||
{"switch_channel_id": self.channel_ids[0], "index": self.buffer_offset, "size": self.size}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user