Skip to content

Commit

Permalink
Adapt to public MSCCL XML format (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzygitzh authored Jun 21, 2024
1 parent 610a499 commit b9b5c3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions msccl/language/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ def ir_to_xml(program: Program, old_format=True, use_scratch=True, pretty_print=
algo_elem.set("ngpus", str(len(program.gpus)))
algo_elem.set("coll", program.collective)
algo_elem.set("inplace", str(1 if program.inplace else 0))
algo_elem.set("outofplace", str(0 if program.inplace else 1))
algo_elem.set("minBytes", str(0))
algo_elem.set("maxBytes", str(0))
for gpu in program.gpus:
gpu_elem = ET.SubElement(algo_elem, "gpu")
gpu_elem.set("id", str(gpu.rank))
Expand Down
3 changes: 3 additions & 0 deletions msccl/ncclize.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@ def expand_mappings(mappings):
algo_elem.set('nchannels', str(nchannels))
algo_elem.set('ngpus', str(len(gpus)))
algo_elem.set('inplace', '0')
algo_elem.set('outofplace', '1')
algo_elem.set('minBytes', '0')
algo_elem.set('maxBytes', '0')
algo_elem.set('coll', algorithm.collective.runtime_name)
algo_elem.set('nchunksperloop', str(max(max(gpu.input_chunks, gpu.output_chunks) for gpu in gpus.values())))
for rank, gpu in gpus.items():
Expand Down

0 comments on commit b9b5c3e

Please sign in to comment.