@@ -39,7 +39,7 @@ def identify_mesh_casts(
3939 space, corresponding to the `src` and `dst`, and returns the distance
4040 between the two points in terms of `hops`, a quantized atomic distance of
4141 data transmission cost.
42-
42+
4343 Returns
4444 -------
4545 { [data] -> [dst -> src] } where { [dst] -> [data] } and { [src] -> [data] } are in
@@ -57,9 +57,11 @@ def identify_mesh_casts(
5757 data_presence : isl .Map = src_occupancy .reverse ()
5858
5959 # { [dst -> data] -> [dst -> src] } where src contains data.
60- fills_to_matches : isl .Map = fill_to_fill .uncurry ( # { [[dst -> data] -> dst] -> data }
61- ).apply_range (data_presence # { [[dst -> data] -> dst] -> src }
62- ).curry () # { [[dst -> data] -> [dst -> src] }
60+ fills_to_matches : isl .Map = (
61+ fill_to_fill .uncurry () # { [[dst -> data] -> dst] -> data }
62+ .apply_range (data_presence ) # { [[dst -> data] -> dst] -> src }
63+ .curry ()
64+ ) # { [[dst -> data] -> [dst -> src] }
6365 if DUMP_ISL_IR :
6466 logging .info (f"fills_to_matches: { fills_to_matches } " )
6567
@@ -68,13 +70,19 @@ def identify_mesh_casts(
6870 fill_min_dist : isl .Map = fills_to_matches .apply_range (dist_fn ).lexmin ()
6971 # Isolates the relevant minimal pairs.
7072 # { [dst -> data] -> [dst -> src] :.dst -> src is minimized distance }
71- minimal_pairs : isl .Map = fill_min_dist .apply_range (
72- # Note: Need to match fill -> min_dist with min_dist -> [fill -> match] as lexmin over
73- # fill and match will minimize distance over the tuple (src, dst, data), but that
74- # overconstrains the optimization as we want to minimize over distance (dst, data)
75- # only for all src.
76- fills_to_matches .range_map ().apply_range (dist_fn ).reverse ()
77- ).range ().unwrap ()
73+ minimal_pairs : isl .Map = (
74+ fill_min_dist .apply_range (
75+ # Note: Need to match fill -> min_dist with min_dist -> [fill -> match] as lexmin over
76+ # fill and match will minimize distance over the tuple (src, dst, data), but that
77+ # overconstrains the optimization as we want to minimize over distance (dst, data)
78+ # only for all src.
79+ fills_to_matches .range_map ()
80+ .apply_range (dist_fn )
81+ .reverse ()
82+ )
83+ .range ()
84+ .unwrap ()
85+ )
7886 if DUMP_ISL_IR :
7987 logging .info (f"minimal_pairs: { minimal_pairs } " )
8088
@@ -211,7 +219,7 @@ def _cost_mesh_cast_hypercube(self, mcns: isl.Map) -> int:
211219 mcns:
212220 Multicast networks grouped together by [srcs -> data] fulfilling
213221 [dsts -> data], where there is at least 1 src and 1 dst in each mcn.
214-
222+
215223 Returns
216224 -------
217225 The upperbound of doing all the multicasts specified by the multicast
0 commit comments