ggml-cuda : optimize mmvq nwarps for Pascal DP4A - #25479
Conversation
|
Hi @animeshsri14, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
|
Why is this PR still a draft? Do you intend to add more changes? |
|
@JohannesGaessler Finalized, just wanted to strengthen the benchmark section for easier review. |
…tiert AtomicBot-ai#3 Pascal CUDA MMVQ Optimization: - MMVQ_PARAMETERS_PASCAL_DP4A zum Enum hinzugefügt - get_device_table_id(): Pascal CC 6.1/6.2 Detection (DP4A bis Volta) - calc_nwarps(): 2 Warps statt 4 für single-token decode auf Pascal (bandwidth-bound auf kleinen SMs) - calc_rows_per_block(): Pascal in GENERIC/GCN/TURING-Gruppe aufgenommen - +3-6% decode auf GTX 1060/1070 (Pascal Consumer) - Minimaler Change (+14 -3 Zeilen), Pascal-spezifisch, keine Auswirkung auf neuere GPUs (Volta+) oder AMD PR ggml-org#25479 ist Draft/open — manuelle Portierung wegen TurboQuant- MMVQ-Modifikationen (eigene Quantisierungstypen, erweiterte Tabellen)
…uell portiert" This reverts commit 5c18849.
…nuell portiert" This reverts commit 0fdd08a.
9cd71ce to
1f6e6f7
Compare
architectures
1f6e6f7 to
daec666
Compare
|
@JohannesGaessler This is ready for review now benchmarks are in the description showing the mmvq nwarps gains on Pascal DP4A. Let me know if you'd like any additional data or changes. Thankyou. |
|
Drafting this for now not abandoning it, but I'd rather put my single open-PR slot toward a higher-impact change (fattn-tile config tuning, which benefits all NVIDIA architectures rather than Pascal only). Branch stays up; happy to proceed or resubmit this once that lands. |
…AtomicBot-ai#5) 4 parallele Subagents (Vulkan/AMD, CUDA/MoE, arXiv Papers, Multi-GPU/Batching). 51 Items gesammelt, dedupliziert, 5 Quick-Wins verifiziert. Verifikation: 3/5 Quick-Wins bereits im Fork (ggml-org#15524=AtomicBot-ai#6, ggml-org#16391=--cram, ggml-org#19754= warmup). PR ggml-org#25479 (Pascal MMVQ) bereits als AtomicBot-ai#3 ✅. PR ggml-org#22887 (4K per Iter) bereits im Fork. 9 neue ROADMAP-Items hinzugefügt: - TheTom#89 Transfer Queue AMD RDNA3 (PR ggml-org#19976) - TheTom#90 MUL_MAT_ID Non-Square Tile (Discussion ggml-org#22598) - TheTom#91 Internal AllReduce Kernel (PR ggml-org#22299) - TheTom#92 RateQuant KV Cache (arXiv:2605.06675) - TheTom#93 InnerQ KV Cache (arXiv:2602.23200) - TheTom#94 FineMoE Expert Offloading (arXiv:2502.05370) - TheTom#95 Shared Expert Aux Stream (TensorRT-LLM) - TheTom#96 Speculative Checkpointing (PR ggml-org#19493) - TheTom#97 Backend-agnostic TP Meta Device (PR ggml-org#19378) Vollständiger Report: docs/fork/2026-07-26_OPTIMIZATION_RESEARCH.md
Overview
Adds a dedicated MMVQ parameter table for Pascal DP4A GPUs (compute capability 6.1 / 6.2 -GTX 10xx, P40, P4) and tunes the warp count for single-token decode.
Previously these cards fell through to
MMVQ_PARAMETERS_GENERIC. This PR introducesMMVQ_PARAMETERS_PASCAL_DP4A, selected for NVIDIA archs in[DP4A, VOLTA)on both the device and host table-id paths, and forncols_dst == 1(single-token decode) uses 2 warps instead of 4. Pascal decode is memory-bandwidth-bound on these small SMs, so the extra warps add scheduling/occupancy pressure without helping throughput. Batched decode and prefill keep the generic behaviour and are unchanged.Measured +2.5% to +5.4% single-token decode across quants (geomean +3.07%) on a GTX 1060 6GB, with no measurable prefill regression.
Additional information
Benchmarked rigorously, both coverage and depth with a self-contained script that builds
HEAD~1(baseline) andHEAD(this PR) into separate binaries and runsllama-benchalternating between them across 6 iterations. Consumer Pascal can't lock clocks (nvidia-smi -lgc), so I report the paired per-iteration delta, which cancels thermal/boost drift;tis the paired t-statistic of the per-iteration Δ%. GTX 1060 6GB (CC 6.1), Llama-3.2-3B-Instruct.Decode (tg) - the mmvq path this PR changes (
-p 0 -n 128 -ngl 99 -r 10)Geomean +3.07%. Q6_K is within noise. An earlier independent 10-iteration run reproduced these to within ~0.2% (geomean +3.08%).
Prefill (pp) - MMQ path, no-regression control (expected ~0%) - two prompt lengths and two
-ubbatch sizes; all rows flat:(The Q4_K_M pp512
+1.64%is noise - σ=4.25%, t=1.03, and the same quant's other prefill configs are flat.)Benchmark script (builds both commits itself; point
MODELS/MODEL_DIRat your GGUFs and run./bench-pascal-mmvq.sh): https://pastebin.com/he3WzqjGRequirements