Skip to content

Commit e8c7321

Browse files
syifanYifan Sunclaude
authored
[Leo] Integrate real hardware measurements for memory/branch calibration
Replace analytical estimates with actual M2 hardware measurements from CI workflow run 21875471386. All 7 benchmarks now have real calibration data with R² > 0.997. Updated benchmarks: - memorystrided: 0.7565 ns/instr (was 0.1714 ns analytical) - loadheavy: 0.1227 ns/instr (was 0.1429 ns analytical) - storeheavy: 0.1749 ns/instr (was 0.1143 ns analytical) - branchheavy: 0.2040 ns/instr (was 0.2857 ns analytical) Co-authored-by: Yifan Sun <yifan@marin-2.local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 41a8091 commit e8c7321

1 file changed

Lines changed: 124 additions & 28 deletions

File tree

benchmarks/native/calibration_results.json

Lines changed: 124 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -106,43 +106,139 @@
106106
},
107107
{
108108
"benchmark": "memorystrided",
109-
"description": "10 store/load pairs with stride-4 access (strided memory pattern)",
110-
"calibrated": false,
111-
"instruction_latency_ns": 0.17142857142857143,
112-
"overhead_ms": 0,
113-
"r_squared": 0.995,
114-
"source": "m2_baseline.json (CPI=0.6 at 3.5 GHz)",
115-
"uncalibrated_reason": "Analytical estimate, not measured on hardware. Simulator runs without D-cache but baseline assumes cached performance."
109+
"description": "10 store/load pairs with stride-4 access per iteration (strided memory pattern)",
110+
"calibrated": true,
111+
"instruction_latency_ns": 0.7565325469951448,
112+
"overhead_ms": 16.85653857546501,
113+
"r_squared": 0.9972815350421813,
114+
"data_points": [
115+
{
116+
"instructions": 20000000,
117+
"time_ms": 24.886199000004833
118+
},
119+
{
120+
"instructions": 40000000,
121+
"time_ms": 41.35126833333894
122+
},
123+
{
124+
"instructions": 80000000,
125+
"time_ms": 76.33693055555568
126+
},
127+
{
128+
"instructions": 160000000,
129+
"time_ms": 145.60025933334626
130+
},
131+
{
132+
"instructions": 320000000,
133+
"time_ms": 273.7935462222241
134+
},
135+
{
136+
"instructions": 640000000,
137+
"time_ms": 492.4020372222028
138+
}
139+
]
116140
},
117141
{
118142
"benchmark": "loadheavy",
119-
"description": "20 load instructions per iteration (load-heavy workload)",
120-
"calibrated": false,
121-
"instruction_latency_ns": 0.14285714285714285,
122-
"overhead_ms": 0,
123-
"r_squared": 0.995,
124-
"source": "m2_baseline.json (CPI=0.5 at 3.5 GHz)",
125-
"uncalibrated_reason": "Analytical estimate, not measured on hardware. Simulator runs without D-cache but baseline assumes cached performance."
143+
"description": "20 independent loads per iteration (load throughput)",
144+
"calibrated": true,
145+
"instruction_latency_ns": 0.12267301568747019,
146+
"overhead_ms": 1.819647390818563,
147+
"r_squared": 0.9997318275333102,
148+
"data_points": [
149+
{
150+
"instructions": 20000000,
151+
"time_ms": 3.489305666663414
152+
},
153+
{
154+
"instructions": 40000000,
155+
"time_ms": 7.017796333330908
156+
},
157+
{
158+
"instructions": 80000000,
159+
"time_ms": 12.05431477776781
160+
},
161+
{
162+
"instructions": 160000000,
163+
"time_ms": 21.314925777782417
164+
},
165+
{
166+
"instructions": 320000000,
167+
"time_ms": 41.50973622223041
168+
},
169+
{
170+
"instructions": 640000000,
171+
"time_ms": 80.09980533334884
172+
}
173+
]
126174
},
127175
{
128176
"benchmark": "storeheavy",
129-
"description": "20 store instructions per iteration (store-heavy workload)",
130-
"calibrated": false,
131-
"instruction_latency_ns": 0.11428571428571428,
132-
"overhead_ms": 0,
133-
"r_squared": 0.995,
134-
"source": "m2_baseline.json (CPI=0.4 at 3.5 GHz)",
135-
"uncalibrated_reason": "Analytical estimate, not measured on hardware. Simulator runs without D-cache but baseline assumes cached performance."
177+
"description": "20 independent stores per iteration (store throughput)",
178+
"calibrated": true,
179+
"instruction_latency_ns": 0.1748788404880628,
180+
"overhead_ms": 1.9227791641632948,
181+
"r_squared": 0.9981528337512541,
182+
"data_points": [
183+
{
184+
"instructions": 20000000,
185+
"time_ms": 5.045254666646946
186+
},
187+
{
188+
"instructions": 40000000,
189+
"time_ms": 10.489328777756176
190+
},
191+
{
192+
"instructions": 80000000,
193+
"time_ms": 15.252037222214515
194+
},
195+
{
196+
"instructions": 160000000,
197+
"time_ms": 27.48594877776769
198+
},
199+
{
200+
"instructions": 320000000,
201+
"time_ms": 60.447402777779445
202+
},
203+
{
204+
"instructions": 640000000,
205+
"time_ms": 113.1640417777741
206+
}
207+
]
136208
},
137209
{
138210
"benchmark": "branchheavy",
139-
"description": "20 branch instructions per iteration (branch-heavy workload)",
140-
"calibrated": false,
141-
"instruction_latency_ns": 0.2857142857142857,
142-
"overhead_ms": 0,
143-
"r_squared": 0.995,
144-
"source": "m2_baseline.json (CPI=1.0 at 3.5 GHz)",
145-
"uncalibrated_reason": "Analytical estimate, not measured on hardware."
211+
"description": "10 conditional branches per iteration (alternating taken/not-taken)",
212+
"calibrated": true,
213+
"instruction_latency_ns": 0.2039629401642474,
214+
"overhead_ms": 3.525283227192446,
215+
"r_squared": 0.9991063897689668,
216+
"data_points": [
217+
{
218+
"instructions": 10000000,
219+
"time_ms": 4.4967916666488845
220+
},
221+
{
222+
"instructions": 20000000,
223+
"time_ms": 7.306157333333532
224+
},
225+
{
226+
"instructions": 40000000,
227+
"time_ms": 12.325365333329804
228+
},
229+
{
230+
"instructions": 80000000,
231+
"time_ms": 20.42759755555481
232+
},
233+
{
234+
"instructions": 160000000,
235+
"time_ms": 36.78765277777529
236+
},
237+
{
238+
"instructions": 320000000,
239+
"time_ms": 68.30478699998821
240+
}
241+
]
146242
}
147243
]
148244
}

0 commit comments

Comments
 (0)