[PR #357] [CLOSED] DeepSeek GGUF: IQ2_XS experts (unsloth's UD-IQ2_XXS still needs them after IQ1_S landed) #485

Closed
opened 2026-10-29 21:25:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/357
Author: @OscarSheng
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: ds4-gguf-iq1s-iq2xs


📝 Commits (1)

  • 4995f29 DeepSeek GGUF: IQ2_XS experts (unsloth's UD-IQ2_XXS down projections)

📊 Changes

4 files changed (+41 additions, -9 deletions)

View changed files

📝 src/ds4/ds4_iq.cu (+30 -1)
📝 src/ds4/ds4_iq.cuh (+6 -5)
📝 src/ds4/ds4_model.cu (+1 -1)
📝 tests/ds4_gguf_test.cu (+4 -2)

📄 Description

Rebased on v1.1.23 (and it merges cleanly into v1.1.26). Thanks for landing IQ1_S / IQ1_M in 85b5acc - that covers the IQ1_S half of this PR, so it now
adds only the other type unsloth's UD-IQ2_XXS uses: IQ2_XS (ggml 17), the down projections of layers 1 and 5-9.
Without it gg_type_of does not know the type, so loading stops at layer 1's down experts
(layers.1.ffn.experts.0.w2: not an MXFP4 or low-bit ... matrix the engine reads (IQ2_XS)).

What it changes: IQ2_XS through the existing decode() / deq8() / DS4_IQ_SWITCH path, the same way as IQ2_XXS /
IQ2_S (4 x (9-bit grid index | 7 sign bits) a 32-value sub-block, a 4-bit scale a half, iq2xs_grid in shared memory);
gg_type_of takes 17 (pack_gguf.py already lists the type). The CPU lane keeps ggml's rows for it (no own rows).

What it leaves alone: every other type's code; the IQ1 kernels' RP / ahead variants; the order of the existing test
pairs (the two new ones go after the IQ1 pairs, so kQPairIQ1 still points at the first IQ1 pair).

Checked on v1.1.23 + this commit (RTX PRO 6000 Blackwell, CUDA 12.8, Windows):

  • ds4_gguf_test ALL OK (0 failed): decode IQ2_XS = ggml's dequantize_row (81,920 values, kernels and tiles); mv
    IQ2_XS at 1 / 3 / 16 activations, max rel err 8.2e-08 .. 1.4e-07; token experts IQ1_S/IQ2_XS 7.5e-08,
    IQ2_XS/IQ3_XXS 1.6e-07; the windows, prompt sets and the lanes (streamed / not, read in place / not) bit for bit.
  • --bench-q IQ2_XS, 6 experts gate/up + down: IQ1_S/IQ2_XS 38.4 us (1,252 GB/s), IQ2_XS/IQ3_XXS 46.6 us (1,460 GB/s).
  • tools/check_hip_compat.py passes. Not built for HIP (no AMD GPU here).
  • The whole model: v1.1.26 + this commit serves UD-IQ2_XXS on this PC (vision tower and DSpark drafter in the pack,
    --mmap-experts off, MAYA_DS4_STREAM=0): a 28,432-token prompt 3,930-4,050 tok/s, decode 78.6-80.7 tok/s, with
    drafting 91-92 (1,500-token answers at temperature 1, two runs). The same IQ2_XS code served it on v1.1.21 since
    2026-10-21.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/357 **Author:** [@OscarSheng](https://github.com/OscarSheng) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `ds4-gguf-iq1s-iq2xs` --- ### 📝 Commits (1) - [`4995f29`](https://github.com/mw00/project-maya/commit/4995f292291803cae4a877208effbf42d00958c6) DeepSeek GGUF: IQ2_XS experts (unsloth's UD-IQ2_XXS down projections) ### 📊 Changes **4 files changed** (+41 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/ds4/ds4_iq.cu` (+30 -1) 📝 `src/ds4/ds4_iq.cuh` (+6 -5) 📝 `src/ds4/ds4_model.cu` (+1 -1) 📝 `tests/ds4_gguf_test.cu` (+4 -2) </details> ### 📄 Description Rebased on v1.1.23 (and it merges cleanly into v1.1.26). Thanks for landing IQ1_S / IQ1_M in 85b5acc - that covers the IQ1_S half of this PR, so it now adds only the other type unsloth's UD-IQ2_XXS uses: **IQ2_XS** (ggml 17), the down projections of layers 1 and 5-9. Without it `gg_type_of` does not know the type, so loading stops at layer 1's down experts (`layers.1.ffn.experts.0.w2: not an MXFP4 or low-bit ... matrix the engine reads (IQ2_XS)`). What it changes: IQ2_XS through the existing `decode()` / `deq8()` / `DS4_IQ_SWITCH` path, the same way as IQ2_XXS / IQ2_S (4 x (9-bit grid index | 7 sign bits) a 32-value sub-block, a 4-bit scale a half, `iq2xs_grid` in shared memory); `gg_type_of` takes 17 (`pack_gguf.py` already lists the type). The CPU lane keeps ggml's rows for it (no own rows). What it leaves alone: every other type's code; the IQ1 kernels' RP / ahead variants; the order of the existing test pairs (the two new ones go after the IQ1 pairs, so `kQPairIQ1` still points at the first IQ1 pair). Checked on v1.1.23 + this commit (RTX PRO 6000 Blackwell, CUDA 12.8, Windows): - `ds4_gguf_test` ALL OK (0 failed): `decode IQ2_XS = ggml's dequantize_row` (81,920 values, kernels and tiles); mv IQ2_XS at 1 / 3 / 16 activations, max rel err 8.2e-08 .. 1.4e-07; token experts IQ1_S/IQ2_XS 7.5e-08, IQ2_XS/IQ3_XXS 1.6e-07; the windows, prompt sets and the lanes (streamed / not, read in place / not) bit for bit. - `--bench-q IQ2_XS`, 6 experts gate/up + down: IQ1_S/IQ2_XS 38.4 us (1,252 GB/s), IQ2_XS/IQ3_XXS 46.6 us (1,460 GB/s). - `tools/check_hip_compat.py` passes. Not built for HIP (no AMD GPU here). - The whole model: v1.1.26 + this commit serves UD-IQ2_XXS on this PC (vision tower and DSpark drafter in the pack, `--mmap-experts off`, `MAYA_DS4_STREAM=0`): a 28,432-token prompt 3,930-4,050 tok/s, decode 78.6-80.7 tok/s, with drafting 91-92 (1,500-token answers at temperature 1, two runs). The same IQ2_XS code served it on v1.1.21 since 2026-10-21. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:25:56 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#485
No description provided.