Commit 687f69c
experiment: inline block WORSE on M2 (-10-15%), reverted to 4-mag
Inline dequant in FA loop hurt instruction cache on M2 Pro.
Also: ternary-based approaches consistently worse than constant LUT.
The 4-mag LUT (4 divergent reads, 0 branches) is the hardware limit
for dequant-level optimizations on Apple8/M2.
Tested approaches total: 10
4-mag LUT: 15.1 at 8K (BEST)
Inline block: 13.5 at 8K (-10.6%)
Named-reg ternary: 10.3 at 8K (-31.8%)
M2 Pro constraint confirmed:
Branches > constant cache divergence > ALU cost
Cannot trade constant reads for branches on Apple8.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: tturney@psyguard.ai1 parent 18738e5 commit 687f69c
2 files changed
Lines changed: 1 addition & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
| 232 | + | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7339 | 7339 | | |
7340 | 7340 | | |
7341 | 7341 | | |
7342 | | - | |
7343 | | - | |
7344 | | - | |
7345 | | - | |
7346 | | - | |
7347 | | - | |
7348 | | - | |
7349 | | - | |
7350 | | - | |
7351 | | - | |
7352 | | - | |
7353 | | - | |
7354 | | - | |
7355 | | - | |
7356 | | - | |
7357 | | - | |
7358 | | - | |
7359 | | - | |
7360 | | - | |
7361 | | - | |
7362 | | - | |
7363 | | - | |
7364 | | - | |
7365 | | - | |
7366 | | - | |
7367 | | - | |
7368 | | - | |
7369 | | - | |
7370 | | - | |
7371 | | - | |
7372 | | - | |
7373 | | - | |
7374 | | - | |
7375 | | - | |
7376 | | - | |
7377 | | - | |
7378 | | - | |
7379 | | - | |
7380 | | - | |
7381 | | - | |
7382 | | - | |
7383 | | - | |
7384 | | - | |
7385 | | - | |
7386 | | - | |
7387 | | - | |
7388 | | - | |
7389 | | - | |
7390 | | - | |
7391 | | - | |
7392 | | - | |
7393 | 7342 | | |
7394 | 7343 | | |
7395 | 7344 | | |
| |||
7401 | 7350 | | |
7402 | 7351 | | |
7403 | 7352 | | |
7404 | | - | |
7405 | 7353 | | |
7406 | 7354 | | |
7407 | 7355 | | |
| |||
0 commit comments