From d50a6c0378c8502fb8a5843474ab136d92543559 Mon Sep 17 00:00:00 2001 From: Joongun Park <8554137+JoongunPark@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:16:23 -0400 Subject: [PATCH] Eliminate false positive sync dependency --- src/converter/pytorch_converter.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/converter/pytorch_converter.py b/src/converter/pytorch_converter.py index 400d94ac..aefe9a1b 100644 --- a/src/converter/pytorch_converter.py +++ b/src/converter/pytorch_converter.py @@ -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 some_variable is not None: + if 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 {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):