Replies: 3 comments 14 replies
10 replies
|
Regarding item 4: "Decode-path (n=1) matvec that skips the q8_1 activation quantize pass — pure overhead when bandwidth-bound — and dequantizes weights straight to float. Includes a fused gate+up SwiGLU variant. Default on for RDNA3.5 only.", Annie has already raised an upstream PR below: |
4 replies
|
For AMD-Ecosystem#32, we plan to split it to several sub-PRs to make it easier to review. I just opened this PR #28195 as the beginning. Could you please review it? Thanks! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AMD PR Set 2 of 6 — Review and Summarization of MMQ and MoE - MatMul Optimizations
Johannes and llama.cpp team, below is a group of related patches from AMD intended to optimize a set of high-priority models on the ROCm backend. I've grouped these together — from a larger set of patches — to hopefully make your job easier in reviewing them, and I've provided a short summary for each. These PR numbers (
#32,#39, etc.) refer to the AMD team's downstream fork atAMD-Ecosystem/llama.cpp, where this work landed first; the goal is to bring it upstream in reviewable batches.This second group is the MMQ path: kernel rewrites, MoE-aware tile sizing, and an decode-path matvec.
2. MMQ / MoE Matmul Optimizations
vec_dot, and the tiny-M path, and documents the HIP/clang codegen workarounds it relies on.MUL_MAT_ID, picks tile width from ~2x the average tokens-per-expert instead of the worst case (all tokens on one expert). RDNA3.5 only; dense and decode untouched. +91% pp128, +39% pp1024 on Qwen3.6-35B-A3B.moe_align_block_size. Was opt-in; now default on, with the env flag removed.mmq_y128 -> 64, warps-per-block 8 -> 4. Measured across 27 dense + MoE models on gfx1151: prefill +14–18% at n=128, +2–8% at 512–4096, decode neutral, PPL bit-identical.benchmark-moe-mmqfor themul_mat_idkernel. Generates controlled routing distributions (uniform / single / zipf / concentration) and reports a roofline per row. Already based on master.Discussions:
AMD PR Set 1 of 6 — Tooling and Profiling modifications and additions
AMD PR Set 2 of 6 — MMQ and MoE - MatMul Optimizations
AMD PR Set 3 of 6 — Flash Attention Optimization RDNA3.5
AMD PR Set 4 of 6 Matvec and Fusion Decode Optimizations
AMD PR Set 5 of 6 — GEMM Prefill Weight Optimizations
AMD PR Set 6 of 6 - Layout and Concurrency Optimizations
All reactions