Skip to content

Commit

Permalink
Eliminate false positive sync dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
JoongunPark committed Oct 14, 2024
1 parent 2ab39be commit 2833ef8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/converter/pytorch_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,15 @@ def convert_ctrl_dep_to_data_dep(
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.debug(
f"Node ID {current_node.id} now has an synchonization dependency on Node ID {sync_dep}"
)

# Found a bug encoding false dependency HTA.
# Compare start_time to eliminate false sync dependency.
prior_node = protobuf_node_map.get(sync_dep)
if prior_node is not None and prior_node.start_time_micros < current_node.start_time_micros:
current_node.data_deps.append(sync_dep)
logging.debug(
f"Node ID {current_node.id} now has an synchonization dependency on Node ID "
f"{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):
Expand Down

0 comments on commit 2833ef8

Please sign in to comment.