ggml-cuda : optimize mmvq nwarps for Pascal DP4A#25479
Open
animeshsri14 wants to merge 1 commit into
Open
Conversation
architectures
|
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. |
Contributor
|
Why is this PR still a draft? Do you intend to add more changes? |
Author
|
Finalized, just wanted to strengthen the benchmark section for easier review. |
fukuro-kun
pushed a commit
to fukuro-kun/fukuro-llama-cpp-turboquant
that referenced
this pull request
Jul 12, 2026
…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)
fukuro-kun
pushed a commit
to fukuro-kun/fukuro-llama-cpp-turboquant
that referenced
this pull request
Jul 12, 2026
…uell portiert" This reverts commit 5c18849.
fukuro-kun
pushed a commit
to fukuro-kun/fukuro-llama-cpp-turboquant
that referenced
this pull request
Jul 12, 2026
…nuell portiert" This reverts commit 0fdd08a.
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.
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