feat(moe): FUSED3=1 opt-in AVX2 expert matmul (olmoe) — rebase of #1024 by @outtodata - #1082
Merged
Conversation
… quant + gate/up pair Adds c/fused_simd.h with exact-integer IDOT kernels (quant_x_q8_avx2, matmul_q_idot_v2/v3, matmul_q_idot_pair_v3) and a FUSED3 env-gated dispatch at the MoE expert FFN call site. OFF by default; with the flag unset the code path is byte-for-byte today's main. Loud when on: startup banner prints fused3=%d. Bit-exactness verified by memcmp harness in c/tests/bench_fused3.c and by identical greedy token streams vs main (flag off and on).
This was referenced Aug 18, 2026
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.
This is @outtodata's #1024, rebased onto current
devby the maintainers — the commit is theirs and the authorship is preserved; we only resolved the rebase conflict (dev'sOLMOE_TESTINGhook and thefused_simd.hinclude coexist — both kept) and re-verified.Why we carried it instead of waiting
We are executing a performance roadmap across the engines (the #1071–#1077 hoist series, the K1 planar layout in #1079), and the next CPU item is exactly what this PR implements on olmoe: fused gate/up with vectorized activation quantization, bit-identical, opt-in. Having this reviewed and in-tree gives the
colibri.cfusion a reference to copy instead of a second invented shape. It stopped being "nice to have" and became sequencing-critical — so we did the rebase rather than let it wait.Re-verification on the rebased branch (this machine, i7-1355U AVX2+VNNI)
The author's own bench, unmodified: quantization bit-exact, output bit-identical, 1.22–1.27× here (the PR's original −40% was measured on their hardware).
FUSED3remains off by default — shipping behavior unchanged.Closes #1024 — all credit to @outtodata; if you'd rather carry it yourself after all, say the word and we'll close this one instead.
🤖 Generated with Claude Code