Repository navigation
Conversation
The rayon MMM dispatcher gated threading on panel count alone, so a GEMV on a wide-mr kernel ran on one thread whatever its k: every 2048-row projection of a 1B LLM decode step is 32 panels and stayed serial. A GEMV now also threads once its multiply-accumulates reach set_threading_mac_threshold (2^21 by default, off on wasm); matrix-matrix products keep the panel gate alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@kali lets see if we can land this one next |
kali
approved these changes
Oct 13, 2026
|
🔴 Bench vs main — 1 speed regression(s) · Reference: 2026-10-13 morning nightly run (0d old) · full report → run Speed — evaltime · prefill · decode
Improvements
|
| Δ | metric | device | main → PR |
|---|---|---|---|
| hey_snips_v31 load · 400ms |
cortex-a7 |
334 ms → 395 ms | |
| hey_snips_v31 load+optimize · 400ms |
cortex-a7 |
384 ms → 452 ms | |
| hey_snips_v1 load · 400ms |
cortex-a7 |
63 ms → 69 ms | |
| llama_3_2_1B_q40ef32_516 load+optimize · cpu |
apple-m1-max |
4.56 s → 4.84 s |
Bench numbers come from shared CI hardware and do produce false positives: a flagged
row is not on its own evidence of a real regression, and a clean report is not proof
there is none. Contributors do not need to chase what is reported here — leave the
reading of it to the maintainers, who will say if something needs action.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem. The rayon MMM gate counts panels only. A decode GEMV uses the wide 64x1 kernel, so every 2048-row projection of Llama-3.2-1B (q, o and down, k up to 8192) is 32 panels, under the gate of 64, and runs on one thread. Multithreaded decode scaled about 1.8x on the M1 Max nightly.
Fix. A GEMV also threads once its multiply-accumulates reach
set_threading_mac_threshold(default 2^21, off on wasm, where dispatch costs ~10x more). Matrix-matrix products keep the panel gate alone, and anything threaded today still is.Perf. Llama-3.2-1B-Instruct q40ef16,
llm-bench, tok/s, 2 interleaved rounds, main2275e7c9c:No regression on CI's multithreaded nets (mobilenet_v2, inceptionv3) or an 11-model noise-suppression panel (FastEnhancer t/b/s/m/l, GTCRN, DTLN 1/2, DeepFilterNet3 x3) at 4 threads and all cores: every row within ±1.3% on M4 (3 rounds, medians), ±3% on M1. Single-thread is untouched.
🤖 Generated with Claude Code
🍍