Skip to content

Commit a7c9c72

Browse files
committed
Merge branch 'main' into hops
2 parents db5eae4 + a21c3ac commit a7c9c72

3 files changed

Lines changed: 1368 additions & 1367 deletions

File tree

accelforge/mapper/FFM/_make_pmappings/make_pmappings_from_templates/make_tile_shapes.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,9 @@ def get_padded_choices(
906906
if subs in choices_padded:
907907
choices_padded[s] = choices_padded[subs]
908908
else:
909-
choices_padded[s] = ones * subs
910-
909+
choices_padded[s] = np.full(
910+
choices_enumerated.shape[0], subs, dtype=choices_enumerated.dtype
911+
)
911912
for k, v in choices_padded.items():
912913
assert isinstance(v, np.ndarray), f"{k} is not a numeric array: {v}"
913914

@@ -1781,10 +1782,10 @@ def update_symbol2goal(
17811782
# Haven't done any pruning, so valid is the # of total choices
17821783
valid = [choices_enumerated.shape[0]]
17831784

1784-
porp = sum(valid) / max(1, choices_enumerated.shape[0])
1785+
porp = int(np.sum(valid)) / max(1, choices_enumerated.shape[0])
17851786
job.log_porp_pmappings_kept(
17861787
f"{objective.name}",
1787-
sum(valid) / max(1, prev_size),
1788+
int(np.sum(valid)) / max(1, prev_size),
17881789
)
17891790
DEBUG and log_message(
17901791
f"Valid check", f"{objective.name}", f"porp={porp:.2%}"
@@ -1832,10 +1833,10 @@ def update_symbol2goal(
18321833
# Everyone valid (for counting purposes)
18331834
valid = [choices_enumerated.shape[0]]
18341835

1835-
porp = sum(valid) / max(1, choices_enumerated.shape[0])
1836+
porp = int(np.sum(valid)) / max(1, choices_enumerated.shape[0])
18361837
job.log_porp_pmappings_kept(
18371838
f"{objective.name}",
1838-
sum(valid) / max(1, prev_size),
1839+
int(np.sum(valid)) / max(1, prev_size),
18391840
)
18401841
DEBUG and log_message(
18411842
f"Valid check", f"{objective.name}", f"porp={porp:.2%}"
@@ -1980,7 +1981,7 @@ def update_symbol2goal(
19801981
prev_size = choices_enumerated.shape[0]
19811982
choices_enumerated = choices_enumerated[keep]
19821983
job.log_porp_pmappings_kept(
1983-
f"Pareto", sum(keep) / choices_enumerated.shape[0]
1984+
f"Pareto", int(np.sum(keep)) / choices_enumerated.shape[0]
19841985
)
19851986
DEBUG and log_message(
19861987
"pareto", f"size {prev_size} -> {choices_enumerated.shape[0]}"

tests/hwcomponents_expected.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,67 +15,67 @@
1515
}
1616
},
1717
"GlobalBuffer": {
18-
"area": 6.85753842326923e-06,
19-
"leak_power": 0.00025518689743667236,
18+
"area": 6.8574526567307686e-06,
19+
"leak_power": 0.00025508039081958506,
2020
"actions": {
2121
"read": {
22-
"energy": 9.056648304726114e-11,
22+
"energy": 9.056430298994264e-11,
2323
"latency": 1.0572650390625e-10
2424
},
2525
"write": {
26-
"energy": 9.122564946135314e-11,
26+
"energy": 9.122346940403464e-11,
2727
"latency": 2.0728900390625002e-10
2828
}
2929
}
3030
},
3131
"InputScratchpad": {
32-
"area": 4.2167274519230763e-10,
33-
"leak_power": 4.807610371689463e-07,
32+
"area": 3.8736612980769225e-10,
33+
"leak_power": 4.3815839033400895e-07,
3434
"actions": {
3535
"read": {
36-
"energy": 2.3605916811887966e-14,
36+
"energy": 2.2733893884485344e-14,
3737
"latency": 1.4807425e-10
3838
},
3939
"write": {
40-
"energy": 3.242682392836752e-14,
40+
"energy": 3.1554801000964905e-14,
4141
"latency": 2.4963675e-10
4242
}
4343
}
4444
},
4545
"WeightScratchpad": {
46-
"area": 3.585853961538461e-09,
47-
"leak_power": 8.302724620034194e-07,
46+
"area": 3.534394038461538e-09,
47+
"leak_power": 7.663684917510134e-07,
4848
"actions": {
4949
"read": {
50-
"energy": 4.0526689360198025e-14,
50+
"energy": 4.0152965248454046e-14,
5151
"latency": 4.4058267857142854e-11
5252
},
5353
"write": {
54-
"energy": 6.272942751096912e-14,
54+
"energy": 6.235570339922515e-14,
5555
"latency": 7.307612500000001e-11
5656
}
5757
}
5858
},
5959
"OutputScratchpad": {
60-
"area": 4.904405576923076e-10,
61-
"leak_power": 4.840417246689463e-07,
60+
"area": 4.5613394230769223e-10,
61+
"leak_power": 4.4143907783400897e-07,
6262
"actions": {
6363
"read": {
64-
"energy": 2.7119425256184493e-14,
64+
"energy": 2.6247402328781873e-14,
6565
"latency": 1.4807425e-10
6666
},
6767
"write": {
68-
"energy": 3.815933349282664e-14,
68+
"energy": 3.728731056542402e-14,
6969
"latency": 2.4963675e-10
7070
}
7171
}
7272
},
7373
"MAC": {
74-
"area": 1.3973971153846152e-09,
75-
"leak_power": 9.732325476491557e-06,
74+
"area": 1.1748028846153846e-09,
75+
"leak_power": 8.851870775236185e-06,
7676
"actions": {
7777
"compute": {
78-
"energy": 1.408832599217931e-12,
78+
"energy": 1.2813796807700769e-12,
7979
"latency": 3.25e-09
8080
}
8181
}
@@ -97,57 +97,57 @@
9797
}
9898
},
9999
"GlobalBuffer": {
100-
"area": 2.3952215381843155e-07,
101-
"leak_power": 9.523558182536147e-06,
100+
"area": 2.3951167124150845e-07,
101+
"leak_power": 9.50865964351506e-06,
102102
"actions": {
103103
"read": {
104-
"energy": 8.295549237325948e-14,
104+
"energy": 8.294876234356374e-14,
105105
"latency": 9.852990595611286e-13
106106
},
107107
"write": {
108-
"energy": 9.035066030244479e-14,
108+
"energy": 9.034393027274906e-14,
109109
"latency": 1.537023197492163e-12
110110
}
111111
}
112112
},
113113
"InputBuffer": {
114-
"area": 5.399594303496503e-09,
115-
"leak_power": 1.2188733186998888e-06,
114+
"area": 5.391208241958042e-09,
115+
"leak_power": 1.2069544874830208e-06,
116116
"actions": {
117117
"read": {
118-
"energy": 9.660840031396417e-15,
118+
"energy": 9.645592307867024e-15,
119119
"latency": 3.0015596590909094e-12
120120
},
121121
"write": {
122-
"energy": 2.070367107287105e-14,
122+
"energy": 2.0688423349341654e-14,
123123
"latency": 4.56405965909091e-12
124124
}
125125
}
126126
},
127127
"WeightBuffer": {
128-
"area": 1.0704373813688813e-07,
129-
"leak_power": 1.2624919331968711e-05,
128+
"area": 1.0703430381765736e-07,
129+
"leak_power": 1.2611510646849734e-05,
130130
"actions": {
131131
"read": {
132-
"energy": 6.682829613803192e-14,
132+
"energy": 6.681971929354662e-14,
133133
"latency": 8.655635653409092e-13
134134
},
135135
"write": {
136-
"energy": 6.873944068448839e-14,
136+
"energy": 6.873086384000309e-14,
137137
"latency": 1.6468135653409094e-12
138138
}
139139
}
140140
},
141141
"AccumulationBuffer": {
142-
"area": 2.208693348951049e-09,
143-
"leak_power": 6.153967734550903e-07,
142+
"area": 2.2003072874125873e-09,
143+
"leak_power": 6.034779422382222e-07,
144144
"actions": {
145145
"read": {
146-
"energy": 7.099636607719463e-15,
146+
"energy": 7.074774077633321e-15,
147147
"latency": 4.3586288361320215e-12
148148
},
149149
"write": {
150-
"energy": 1.3851866895697208e-14,
150+
"energy": 1.3827004365611064e-14,
151151
"latency": 6.906399536768965e-12
152152
}
153153
}
@@ -167,11 +167,11 @@
167167
}
168168
},
169169
"MAC": {
170-
"area": 1.7436548076923076e-10,
171-
"leak_power": 1.3613936377164362e-06,
170+
"area": 1.4715951923076922e-10,
171+
"leak_power": 1.2382323818087997e-06,
172172
"actions": {
173173
"compute": {
174-
"energy": 1.9707270804040344e-13,
174+
"energy": 1.7924412301183831e-13,
175175
"latency": 8.000000000000001e-10
176176
}
177177
}

0 commit comments

Comments
 (0)