Pull requests / #2649

#2649 Community benchmark: Apple M3 Max (Metal), Flash-Next IQ3_S

open · @alvarorsouza-arch · 0 commentaires · Sur GitHub

BenchmarksSetup & installAMD / HIPModels & quantsDocumentation

Description

Report from hardware the maintainers do not have: an Apple M3 Max (40-core GPU, 128 GB unified memory, macOS 26.6) on engine 0.1.44.1-metal built from source at `296b59d`, original Flash-Next IQ3_S resident, 65,536-token context, setup defaults otherwise.

The folder adds one `README.md` plus the index bullet above. No engine code and no other docs change in this PR.

## Headline numbers

Decode 55.0 / 58.8 / 58.8 tok/s at the defaults, where the drafter is on (`--spec 2` with the MTP draft layer). With no drafter at all the same build gives 48.2 / 48.6 / 48.8 tok/s, and prompt ingestion 504 tok/s at 16,388 tokens. `docs/MAC.md` shows 94 to 102 tok/s for IQ3_S on an M5 Max, so this chip lands about 1.6x slower, close to the 400 against 546 GB/s bandwidth ratio.

## What else the report carries

- The repo's own Metal benches on this GPU: `rt_bench bw` reads 381.8 GB/s best (five runs, 381.8 to 394.9) and 365.7 GB/s for the 1 MB chunks the experts arrive in; `gridbar_bench` reads a 48 phase layer shaped chain at 379.4 GB/s; `mm_bench` reaches 12.0 to 13.3 TFLOP/s fp16 at 4096 cubed and 2.0 to 3.1 TFLOP/s at a 16 token batch.
- The byte inventory of one token (5,159 MB: 982 MB routed experts, 4,177 MB dense) put beside the measured step, which makes pure decode 255 GB/s, or 70% of a plain streaming read of the same bytes.
- A per class breakdown from `STRATA_METAL_KPROF=1`. The LM head, attention and SSM gemvs run at 363 to 430 GB/s; the hyper connection read at 242 and the expert path at 275 are the laggards.
- A power finding: the same build and config ran at 24.1 / 24.4 / 24.3 tok/s before I moved the machine to high power and 57.4 / 57.6 / 58.1 after. That is larger than every tuning result in the report, which is why the doc asks ask reports to quote the power mode.
- Settings measured one boot each that do not beat the defaults on decode: a larger `--expert-cache`, `COOP_K4=1`, `STRATA_METAL_MATH=fast`, `STRATA_METAL_GEMV_NR=2`, `STRATA_METAL_PROMPT_EXPERTS=v3`, `STRATA_METAL_PROMPT_QSA=flash`, `STRATA_HC_Q8=0`, and four drafter configurations. `COOP_K4=1` also produces wrong output on this GPU, so the probe is right to keep it off.
- Broken or absent on this backend: `--kv int8` and `--kv-resident` abort at boot with no Metal implementation for `kv_block_bytes`; `--expert-cache` at 1024 and above fails every prompt request until `--no-prefill-borrow`; `--no-fused-gr` is inert (the fused gr entry points are `missing()` stubs); `--dump-routing` writes a trace with 0 records because the Metal engine has no host expert pool; and `--batch 2`, `3` and `4` are accepted at boot, build 1.73 GiB of slots each, then exit the engine with code 86 on the first request that runs two sequences together (with `STRATA_METAL_STUBS=log` the batch route reaches 17 entry points that have no Metal implementation), now filed on its own as #2715.
- The resident prompt chain, measured. The matrix units carry a 16K prompt 5.9x faster than the 8 row window path (`STRATA_METAL_PROMPT=window`: 79.5 tok/s against 475 and 466), and the shipped tiles are already the good ones, the alternatives costing 3 to 5% on the dense GEMM and 3% and 15% on the grouped expert GEMMs. A longer `STRATA_METAL_PROMPT_CHUNK` costs 11% at 4,096 and 21% at 8,192 here, where docs/MAC.md measures 2 to 4% on Q2_0, and `STRATA_METAL_PROFILE` shows why: GPU time falls 5% while the chain's host rows work triples. The budget is 239.4 TFLOP of matmul in a 16,383 token prompt, 27.9 s of its 34.1 s on the GPU, 8.6 TFLOP/s, against the 23.7 s `mm_bench` prices the two GEMM classes at. The report also notes that `STRATA_METAL_PROMPT_GEMM` and the dense tile in `Window::prompt_chunk` belong to the streaming path, so on a resident pack they do nothing, and it corrects its own element count from 6.67 G to 7.31 G per token.
- A measured U(P) for `tools/quant_bound.py`, 1.684 at two tokens and 4.615 at eight, which needed a small local patch to reach the routed ids on Metal. That patch is a separate PR and is not part of this folder; every other number here comes from an unmodified 0.1.44.1 binary.

## Doc asks

Twelve of them, listed at the end of the report. They are documentation only: the Metal limits for `--kv`, `--expert-cache` and `--no-fused-gr`, a note that a Mac in a low power mode runs at roughly half, a paragraph for `STRATA_METAL_KPROF`, having `collect_profile_traces.py` reject an empty routing trace instead of accepting the file, naming `--batch` rather than the old `--parallel` in the Mac limits, which prompt variables belong to the streaming path rather than the resident one, and a paragraph for `STRATA_METAL_PROFILE` beside the KPROF one.

## Not tested

The guide's 4,096 / 32,768 / 128,000 token sweep, vision, any context above 65,536, `--spec` above 2, `--parallel`, soaks, and concurrency. The pack and the MTP draft layer were copied from an existing 0.1.40.3 install rather than freshly built, so a clean first install on 0.1.44.1 on this hardware is unverified and no hashes are included. I can add `provenance.json` and `REPRODUCE.md` the way some other reports here do, if that is wanted.

Sur le site

Liens install, modèles, releases.