Repository navigation
docs(benchmarks): record Phase 11 and correct every MLAS-arm ratio - #1242
Merged
Merged
Conversation
`bench_generic` required the `mlas` feature, which is not a default of onnx-runtime-ep-cpu, so every ratio published in this document measured a configuration production never builds. Section 29.4 spotted the harness problem and flagged it as open work; it underestimated the consequence. Two kernels turned out to have no vectorized production path at all, both masked for months by the MLAS arm covering for them: softmax was calling scalar exp per element (9.3-10.9x ORT), and the MoE path was materializing a full transposed copy of an expert's weight matrix on every call, for every routed group, to multiply as little as one token row (39-72x at t=1). Adds section 31 with the falsifier a feature flag cannot provide (nm -C reports 0 MLAS symbols in the shipping binary against 805 in the reference one), the corrected production-native matrix, and a note on why the section 19/20 conclusion that a layout-aware GEMM consumer had no fixture was wrong: the most expensive transpose in the runtime was never a Transpose node. Adds correction banners to 18.3, 27 and 29.4 rather than editing their tables, so the original numbers and the reason they misled stay readable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔴 Benchmark Regression DetectedComparison of criterion micro-benchmarks: PR head vs merge-base, measured on the same runner in the same job (base first → PR second).
Visual flags: Host infoWhat this cannot catch
|
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.
Records Phase 11 and corrects the ratios that measured the wrong build.
Why
bench_genericdeclaredrequired-features = ["mlas"]while containing no MLAS references at all.mlasis not a default feature ofonnx-runtime-ep-cpu, so every ratio in this document measured a configuration production never builds. §29.4 spotted the harness problem and flagged it as open work; it underestimated the consequence.What it hid
Two kernels had no vectorized production path at all, both masked for months by the MLAS arm covering for them:
f32::exp()once per element - 9.3-10.9x ORT.scale_mask_softmax_serialshares the helper, so fused attention paid it too. Fixed in perf(cpu-ep): vectorise the production softmax exp on AVX2+FMA #1234.swiglu_fusion=1, to multiply as little as one token row. 39-72x ORT at t=1. Fixed in perf(cpu-ep): layout-aware gemm_bt for MoE, killing the per-call expert transpose #1241.§18.3 had recorded every MoE
t=1cell at 1.006-1.052 and concluded the only remaining MoE problem was thread scheduling att=8/16. On the arm that ships,t=1was the worst cell in the entire benchmark suite.What this PR does
Adds §31 with:
nm -C | grep -ci mlasgives 0 on the shipping binary against 805 on the reference one;Transposenode at all - it was inside the MoE kernel, feeding straight into a GEMM, on three of the models already in this document.Correction banners are added to §18.3, §27 and §29.4 rather than editing their tables, so the original numbers and the reason they misled both stay readable.
Documentation only - no code changes.