Skip to content

Commit 8313202

Browse files
committed
Model latency and distributed occupancy
1 parent bcff540 commit 8313202

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

accelforge/model/_looptree/latency/memory.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ def component_latency(
7979
f"Component {component} is not a TensorHolder or Compute"
8080
)
8181

82+
for network, network_stats in looptree_results.network_stats.items():
83+
component = network.component
84+
actions = component_to_actions[component]
85+
if component not in name2component:
86+
raise ValueError(f"Component {component} found in mapping but not arch")
87+
88+
for action in name2component[component].actions:
89+
actions[f"{action.name}_actions"] += 0
90+
91+
actions["hops_actions"] += network_stats.max_hops
92+
8293
longest_compute_latency = Max(
8394
0, *[s.max_latency for s in looptree_results.compute_stats.values()]
8495
)

accelforge/model/_looptree/reuse/symbolic/_symbolic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,10 @@ def inherit_add(attr: str, default_value: Any = fills) -> Any:
818818
dim_fanout[d] / component_object._get_physical_stride_along(d)
819819
)
820820

821+
# ==========================
822+
# Recalculate usage of distributed buffers
823+
stats.max_occupancy /= n_active_physical_units
824+
821825
# ==========================
822826
# Data exchanges with parent
823827
if count_downward_movement[tensor]: # Parent -> Me

0 commit comments

Comments
 (0)