Files
ANE/benchmark_results.json
zeekay d861b8959b Add universal ANE runtime (M1→M4+), benchmarks, and MLX training demo
- ane_universal.h: Auto-detecting runtime that selects InMem (M4+) or
  CoreML fallback (M1-M3) based on hardware capability probing
- ane_probe_m1.m: Deep diagnostic found all 74 ANE classes present on M1
  but _ANECompiler binary rejects all MIL programs (40+ format combos)
- ane_m1_fix.m: Systematic MIL format fuzzer (program versions 1.0-1.3,
  opsets ios15-ios18, weight offsets, old/new syntax) — all fail on M1
- ane_coreml_bridge.m: CoreML ANE bridge showing 2.44x speedup at 256x256
- benchmark_apple_silicon.py: MLX vs MPS vs CoreML comparison on M1 Max
  - MLX: 6.72 TFLOPS peak (fp16), 62ms/step training
  - MPS: 4.12 TFLOPS peak, 84ms/step training
  - ANE via CoreML: ~1x (dispatch overhead negates hardware advantage)
- demo_mlx_training.py: Working 4-layer transformer training, 4688 tok/s
- Updated README with M1-M4 compatibility matrix and integration points
- Added .gitignore for compiled binaries and .venv
2026-03-03 06:23:44 -08:00

114 lines
2.6 KiB
JSON

[
{
"backend": "MLX",
"operation": "matmul",
"shape": "768x256 @ 256x768",
"ms_per_op": 6.083245840000018,
"tflops": 0.049642887356990184,
"notes": "Stories110M dim"
},
{
"backend": "MLX",
"operation": "matmul",
"shape": "768x256 @ 256x2048",
"ms_per_op": 3.1631091599956562,
"tflops": 0.25459329010355936,
"notes": "Stories110M FFN"
},
{
"backend": "MLX",
"operation": "matmul",
"shape": "4096x512 @ 512x4096",
"ms_per_op": 7.272356660005244,
"tflops": 2.362352396504658,
"notes": "Zen-4B dim"
},
{
"backend": "MLX",
"operation": "matmul",
"shape": "4096x512 @ 512x11008",
"ms_per_op": 6.866338339996219,
"tflops": 6.724238763921067,
"notes": "Zen-4B FFN"
},
{
"backend": "MLX",
"operation": "matmul",
"shape": "4096x2048 @ 2048x4096",
"ms_per_op": 10.98757249999835,
"tflops": 6.254291085315735,
"notes": "Zen-4B long ctx"
},
{
"backend": "MLX",
"operation": "transformer_fwd",
"shape": "dim=768 h=12 seq=256",
"ms_per_op": 7.699347950006086,
"tflops": 0.0,
"notes": "Stories110M"
},
{
"backend": "MLX",
"operation": "transformer_fwd",
"shape": "dim=4096 h=32 seq=512",
"ms_per_op": 63.143602100012686,
"tflops": 0.0,
"notes": "Zen-4B"
},
{
"backend": "MLX",
"operation": "train_step",
"shape": "1-layer dim=768 seq=256",
"ms_per_op": 62.13079170001947,
"tflops": 0.0,
"notes": "Stories110M"
},
{
"backend": "MPS",
"operation": "matmul",
"shape": "768x256 @ 256x768",
"ms_per_op": 7.707359159994667,
"tflops": 0.03918201834520567,
"notes": "Stories110M dim"
},
{
"backend": "MPS",
"operation": "matmul",
"shape": "768x256 @ 256x2048",
"ms_per_op": 7.709723320003832,
"tflops": 0.10445334217254372,
"notes": "Stories110M FFN"
},
{
"backend": "MPS",
"operation": "matmul",
"shape": "4096x512 @ 512x4096",
"ms_per_op": 11.832635000000664,
"tflops": 1.4519056139227684,
"notes": "Zen-4B dim"
},
{
"backend": "MPS",
"operation": "matmul",
"shape": "4096x512 @ 512x11008",
"ms_per_op": 14.450160839996897,
"tflops": 3.195182319646064,
"notes": "Zen-4B FFN"
},
{
"backend": "MPS",
"operation": "matmul",
"shape": "4096x2048 @ 2048x4096",
"ms_per_op": 16.676723340005992,
"tflops": 4.120682182881095,
"notes": "Zen-4B long ctx"
},
{
"backend": "MPS",
"operation": "train_step",
"shape": "1-layer dim=768 seq=256",
"ms_per_op": 83.85612920001222,
"tflops": 0.0,
"notes": "Stories110M"
}
]