mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[PR #473] [CLOSED] DeepSeek GGUF: MAYA_DS4_DENSE_REQ - re-quantize the attention's Q8_0 dense matrices at load (opt-in, +6% decode on a 24 GB card) #548
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#548
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/473
Author: @cryptedy
Created: 10/25/2026
Status: ❌ Closed
Base:
main← Head:pr/ds4-dense-req📝 Commits (1)
593136bDeepSeek GGUF: MAYA_DS4_DENSE_REQ - the attention's Q8_0 dense matrices re-quantized at load (opt-in)📊 Changes
4 files changed (+174 additions, -3 deletions)
View changed files
📝
docs/SETTINGS.md(+26 -0)📝
src/ds4/ds4_gguf_cpu.hpp(+5 -0)📝
src/ds4/ds4_iq_cpu.cpp(+39 -0)📝
src/ds4/ds4_model.cu(+104 -3)📄 Description
What
A DeepSeek GGUF pack keeps its dense weights in Q8_0. Every decoded token reads all of them, and on a 24 GB card they take VRAM that experts could use. Here, Maya-S's dense weights are 8.46 GB, and the GPU holds only 1,177 of its 15,360 experts.
MAYA_DS4_DENSE_REQ=q5_k(opt-in) re-quantizes the largest of these matrices at load. By default these are the attention'swq_b,wo_aandwo_b, about 5 GB over 40 layers;MAYA_DS4_DENSE_REQ_MATCHchanges the list.ggml_quantize_chunk) does it on the CPU threads, from the Q8_0 values.<pack>/dense-req-<type>/<tensor>.bin. Each file has a header with the source's size, a sampled checksum and the type. The first start converts (about 20 s for DeepSeek-V4.1-Flash); later starts read the cache (about 2 s). A cache whose header does not match is converted again. If the cache cannot be written, the only cost is the conversion on the next start.q4_kandiq4_xsare also accepted. An unknown value leaves everything in Q8_0 and logs a line saying so. Rows that do not split into 256-value blocks also stay Q8_0, and the reason is logged once.docs/SETTINGS.md. The engine reads them asSTRATA_DS4_DENSE_REQ*(a config'sMAYA_DS4_DENSE_REQ*), withDS4_DENSE_REQ*as a fallback.This changes the answers a little, so it is off by default.
Measured
Test machine:
--mmap-experts off,DS4_COPY_GB=96,MAYA_DS4_DISK_SKIP_W=0.20MAYA_DS4_COPY_SWAP=1(PR from 2026-10-24).VRAM, and chat decode with the calibration workload (2 runs each):
q5_kiq4_xsQuality, against the unmodified model (no skip, Q8_0):
q5_kq4_kiq4_xsq5_kchanges the answers about as much asDISK_SKIP_W=0.20itself does. The two-way difference over the 16K-token document is +0.0032 ± 0.0009.q4_kandiq4_xscost two to three times as much KL, for only a little more speed. That is why the docs point toq5_k.I also tried Q6_K with a kernel of my own. Its 210-byte blocks need byte-wise loads; it gave KL 0.0208 (the same as Q8_0) but no speed gain (18.4 vs 18.7 tok/s), so it is left out.
Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.