Skip to content

Commit

Permalink
Add synchronization dependency from GPU to CPU operators in PyTorch c…
Browse files Browse the repository at this point in the history
…onverter

Co-authored-by: Joongun Park <8554137+JoongunPark@users.noreply.github.com>
  • Loading branch information
TaekyungHeo and JoongunPark committed Oct 7, 2024
1 parent 9b6a334 commit 4080d6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/converter/pytorch_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,15 @@ def convert_ctrl_dep_to_data_dep(
last_visited_non_gpu = current_node
last_visited_any = current_node

if json_node.sync_dep:
for sync_dep in json_node.sync_dep:
if sync_dep not in current_node.data_deps:
current_node.data_deps.append(sync_dep)
logging.info(
f"Node ID {current_node.id} now has an synchonization dependency on Node ID {sync_dep}"
)

# Add children to the stack
children_chakra_ids = [child.id for child in json_node.children]
for child_chakra_id in sorted(children_chakra_ids, reverse=True):
child_chakra_node = protobuf_node_map.get(child_chakra_id)
Expand Down
1 change: 1 addition & 0 deletions src/converter/pytorch_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def _parse_data_1_0_3_chakra_0_0_4(self, node_data: Dict[str, Any]) -> None:
self.exclusive_dur = node_data.get("exclusive_dur", 0)
self.ts = node_data.get("ts")
self.inter_thread_dep = node_data.get("inter_thread_dep")
self.sync_dep = node_data.get("sync_dep")
self.cat = node_data.get("cat")
self.stream = node_data.get("stream", 0)
# In Colletive comms nodes, pg_name is in node_data if exists.
Expand Down

0 comments on commit 4080d6f

Please sign in to comment.