tests: add MoE MMQ benchmark with routing-distribution generator#62
Draft
roberteg16 wants to merge 1 commit into
Draft
tests: add MoE MMQ benchmark with routing-distribution generator#62roberteg16 wants to merge 1 commit into
roberteg16 wants to merge 1 commit into
Conversation
Standalone benchmark (benchmark-moe-mmq) for the MMQ mul_mat_id kernel used by MoE. Generates controlled expert-routing distributions (uniform, single, zipf, concentration) so the per-expert token load can be swept independently, which is what drives the MMQ tile sizing. Reports tokens-per-expert stats plus a roofline (AI, %roof, mem/comp) and writes CSV. Defaults match Qwen3.6-35B-A3B (256 experts, top_k 8, Q4_K). Cycles distinct weight copies to defeat L2/MALL caching so measurements reflect DRAM traffic.
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.
Summary
benchmark-moe-mmq, a standalone benchmark for the MMQmul_mat_idkernel used by MoE.uniform- tokens spread evenly across all expertssingle- all tokens concentrated on one expert (worst case)zipf- power-law imbalance (--alpha)concentration- sweep of tokens-per-expert aligned to 16 (active set shrinking from n_experts down to top_k)--rotate, auto-sized from L2/MALL) so measurements reflect DRAM traffic rather than cache residency.llama_build), not a ctest, since it is a manual perf tool.Test plan
cmake --build build --target benchmark-moe-mmq./bin/benchmark-moe-mmq --legendprints column/distribution help./bin/benchmark-moe-mmq --dist all --proj both --m 512,2048runs on the target backend and emits the table + CSV