Skip to content

Commit a420767

Browse files
committed
[model,network] Bugfix network model and test
1 parent 6d7bfa8 commit a420767

3 files changed

Lines changed: 6 additions & 265 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def accumulate_child_result(
7979
last_fanout = last_fanout.get(node.name, 1)
8080
if isinstance(relevancy, Irrelevant):
8181
# Cost of multicasting is the cost of delivering along the dimension
82-
multicast_hops = (shape_repeats - 1) * last_fanout
82+
multicast_hops = shape_repeats * last_fanout
8383
multicast_cost = multicast_hops * volume
8484
self.overall_max_hops += multicast_hops
8585

@@ -93,9 +93,9 @@ def accumulate_child_result(
9393
# the dimension with shape as stride
9494
# TODO: we should use the actual stride
9595
total_unicast_cost = (
96-
0.5 * (shape_repeats - 1) * shape_repeats * last_fanout * volume
96+
0.5 * (shape_repeats + 1) * shape_repeats * last_fanout * volume
9797
)
98-
max_unicast_hops = (shape_repeats - 1) * last_fanout
98+
max_unicast_hops = shape_repeats * last_fanout
9999
self.overall_max_hops += max_unicast_hops
100100

101101
accumulated_network_stats.total_hops += total_unicast_cost

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,9 @@ def handle_repeated_value(repeated_shape):
633633
shape_repeats, reuse_parent_accesses
634634
)
635635

636-
network_analyzer.accumulate_child_result(
637-
child_result, info, shape_repeats, einsum_name, child_shape, node
638-
)
636+
network_analyzer.accumulate_child_result(
637+
child_result, info, shape_repeats, einsum_name, child_shape, node
638+
)
639639

640640
for einsum, child_steps in child_result.temporal_steps.items():
641641
if einsum not in result_accumulator.temporal_steps:

tests/not_working/test_network.py

Lines changed: 0 additions & 259 deletions
This file was deleted.

0 commit comments

Comments
 (0)