[PR #519] [CLOSED] DeepSeek drafter: cap each DSpark block's experts in VRAM (MAYA_DS4_DRAFT_VRAM) #574

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/519
Author: @pepuscz
Created: 10/26/2026
Status: ❌ Closed

Base: main ← Head: pr/ds4-up-h-draft-vram


📝 Commits (10+)

  • 973526c ds4: DS4_HELPER_RECENT - a table copy that did not end cleanly is a helper failure
  • 8c8e72f ds4: DS4_HELPER on a group - a member other than 0 holding any helper or recent-slot field refuses the load
  • a5067f3 docs: the helper on a tensor-parallel group's layers - MAYA_DS4_HELPER with MAYA_DS4_TP_GGUF_UNEVEN
  • 81bab00 ds4: DS4_DRAFT_VRAM - a cap under a mixed-precision block's experts refuses the load
  • 739f651 docs: the DSpark blocks' VRAM experts - MAYA_DS4_DRAFT_VRAM
  • 001d578 ds4: DS4_HC_FUSE - a decoded token's hc_split and hc_pre_norm in one launch, the attention input rounded there
  • fddc0f2 ds4: DS4_ROUTE_FUSE - a decoded token's router stage on the lead in two launches instead of four
  • 8e9e97b ds4: DS4_ROUTE_FUSE - nothing published after a launch that did not go in; one eligibility check before any enqueue
  • ed91be7 ds4: DS4_FLOW_HELPER - the prompt's experts the helper holds copied out of its pool, not read from the files
  • 3be770a ds4: DS4_FLOW_HELPER_CHECK by prompt run, DS4_FLOW_HELPER_FAIL, IoQueue device-copy test

📊 Changes

13 files changed (+3688 additions, -137 deletions)

View changed files

📝 docs/SETTINGS.md (+73 -1)
➕ src/ds4/ds4_borrow.hpp (+42 -0)
📝 src/ds4/ds4_gguf.cu (+18 -2)
📝 src/ds4/ds4_gguf.cuh (+14 -0)
📝 src/ds4/ds4_kernels.cu (+434 -0)
📝 src/ds4/ds4_kernels.cuh (+76 -0)
📝 src/ds4/ds4_main.cpp (+14 -0)
📝 src/ds4/ds4_model.cu (+2491 -129)
📝 src/ds4/ds4_model.hpp (+4 -0)
📝 src/ds4/ds4_pool.hpp (+35 -3)
📝 tests/ds4_gguf_test.cu (+121 -1)
➕ tests/ds4_pool_test.cpp (+335 -0)
📝 tools/test_ds4_prompt_skip.py (+31 -1)

📄 Description

Part of #510 (PR H of 9: A, B, C, C2, D, E, F, G, H). Stacked on #518: until that merges, this PR also shows its commits; this PR's own are the last ones listed. Glad to rebase as main moves.

What. In place_experts the DSpark drafter's blocks go first, each out of its own member's room (#412). On a group whose profile has seen the drafter, a block keeps the experts that cover 99 % of its routes, then adds more only while its member keeps the room of the group's next tightest member (#344). On a box whose cards hold only a small part of the model, the trunk's experts are worth more per byte of VRAM than a block's colder ones, but no setting caps a block.

Change. MAYA_DS4_DRAFT_VRAM=<n> or <n0>,<n1>,<n2> (unset: exactly as before):

  • each DSpark block keeps at most that many of its experts' slots in VRAM, the profile's hottest, as room goes;
  • the rest go on the CPU lane;
  • the profile rule above is not used for a capped block, and the trunk's placement is unchanged.

A load line names each block's slots ("DSpark block N: X of its 128 experts' slots in VRAM, at most C"). Each served request logs its drafter picks and how many went to the CPU lane. A cap below a mixed-precision block's own experts refuses the load.

Why it matters here: with the series' other settings, capping the blocks at 96 / 48 / 32 is the placement our measured setup uses.

Tested on one box, 2x RX 7900 XTX (gfx1100) + Radeon 8060S (gfx1151), HIP: this PR's head builds on its own (each PR of the series was built in order), and the full series passed its load checks and --bench (numbers in #510). Not built or run on CUDA.

🤖 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/519 **Author:** [@pepuscz](https://github.com/pepuscz) **Created:** 10/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/ds4-up-h-draft-vram` --- ### 📝 Commits (10+) - [`973526c`](https://github.com/mw00/project-maya/commit/973526ce631f4919877d0949019be21c3a9ff99d) ds4: DS4_HELPER_RECENT - a table copy that did not end cleanly is a helper failure - [`8c8e72f`](https://github.com/mw00/project-maya/commit/8c8e72f8efe8409a0992cb4048a356408e8d3728) ds4: DS4_HELPER on a group - a member other than 0 holding any helper or recent-slot field refuses the load - [`a5067f3`](https://github.com/mw00/project-maya/commit/a5067f3dd865320768c5286144c452da0ded7b5a) docs: the helper on a tensor-parallel group's layers - MAYA_DS4_HELPER with MAYA_DS4_TP_GGUF_UNEVEN - [`81bab00`](https://github.com/mw00/project-maya/commit/81bab00686784423f84e2270f49c78695d4a1a7b) ds4: DS4_DRAFT_VRAM - a cap under a mixed-precision block's experts refuses the load - [`739f651`](https://github.com/mw00/project-maya/commit/739f65181860d9461e04531dea3361ca110bec17) docs: the DSpark blocks' VRAM experts - MAYA_DS4_DRAFT_VRAM - [`001d578`](https://github.com/mw00/project-maya/commit/001d5788f3522fc3004501924b9d525c30cc3b71) ds4: DS4_HC_FUSE - a decoded token's hc_split and hc_pre_norm in one launch, the attention input rounded there - [`fddc0f2`](https://github.com/mw00/project-maya/commit/fddc0f2d09cf35307e77ad96270a3d28377771c3) ds4: DS4_ROUTE_FUSE - a decoded token's router stage on the lead in two launches instead of four - [`8e9e97b`](https://github.com/mw00/project-maya/commit/8e9e97bb15180a14d759c1bdf06054c30a7c3739) ds4: DS4_ROUTE_FUSE - nothing published after a launch that did not go in; one eligibility check before any enqueue - [`ed91be7`](https://github.com/mw00/project-maya/commit/ed91be70e412878716e13a2f7f5f8c31a36ec4e9) ds4: DS4_FLOW_HELPER - the prompt's experts the helper holds copied out of its pool, not read from the files - [`3be770a`](https://github.com/mw00/project-maya/commit/3be770a4e0bcbb518ed044e25723c1f59852e257) ds4: DS4_FLOW_HELPER_CHECK by prompt run, DS4_FLOW_HELPER_FAIL, IoQueue device-copy test ### 📊 Changes **13 files changed** (+3688 additions, -137 deletions) <details> <summary>View changed files</summary> 📝 `docs/SETTINGS.md` (+73 -1) ➕ `src/ds4/ds4_borrow.hpp` (+42 -0) 📝 `src/ds4/ds4_gguf.cu` (+18 -2) 📝 `src/ds4/ds4_gguf.cuh` (+14 -0) 📝 `src/ds4/ds4_kernels.cu` (+434 -0) 📝 `src/ds4/ds4_kernels.cuh` (+76 -0) 📝 `src/ds4/ds4_main.cpp` (+14 -0) 📝 `src/ds4/ds4_model.cu` (+2491 -129) 📝 `src/ds4/ds4_model.hpp` (+4 -0) 📝 `src/ds4/ds4_pool.hpp` (+35 -3) 📝 `tests/ds4_gguf_test.cu` (+121 -1) ➕ `tests/ds4_pool_test.cpp` (+335 -0) 📝 `tools/test_ds4_prompt_skip.py` (+31 -1) </details> ### 📄 Description Part of #510 (PR H of 9: A, B, C, C2, D, E, F, G, H). **Stacked on #518**: until that merges, this PR also shows its commits; this PR's own are the last ones listed. Glad to rebase as `main` moves. **What.** In `place_experts` the DSpark drafter's blocks go first, each out of its own member's room (#412). On a group whose profile has seen the drafter, a block keeps the experts that cover 99 % of its routes, then adds more only while its member keeps the room of the group's next tightest member (#344). On a box whose cards hold only a small part of the model, the trunk's experts are worth more per byte of VRAM than a block's colder ones, but no setting caps a block. **Change.** `MAYA_DS4_DRAFT_VRAM=<n>` or `<n0>,<n1>,<n2>` (unset: exactly as before): - each DSpark block keeps at most that many of its experts' slots in VRAM, the profile's hottest, as room goes; - the rest go on the CPU lane; - the profile rule above is not used for a capped block, and the trunk's placement is unchanged. A load line names each block's slots ("DSpark block N: X of its 128 experts' slots in VRAM, at most C"). Each served request logs its drafter picks and how many went to the CPU lane. A cap below a mixed-precision block's own experts refuses the load. **Why it matters here:** with the series' other settings, capping the blocks at 96 / 48 / 32 is the placement our measured setup uses. **Tested** on one box, 2x RX 7900 XTX (gfx1100) + Radeon 8060S (gfx1151), HIP: this PR's head builds on its own (each PR of the series was built in order), and the full series passed its load checks and `--bench` (numbers in #510). Not built or run on CUDA. 🤖 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:27:03 +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#574
No description provided.