[PR #527] ds4: extend helper-GPU execution to EXL3 and allow DSpark sharing #582

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/527
Author: @LostVector
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: upstream/ds4-exl3-helper-20261026


📝 Commits (7)

  • e735f37 Allow opt-in DSpark block GPU placement across target groups
  • be49f33 Add opt-in EXL3 overflow helper sharing the DSpark GPU
  • 7dc4456 Document the explicit recent-cache setting used for helper measurements
  • b69bb03 Document portable EXL3 helper flags and separate benchmark tuning
  • f376d39 Clarify shared-helper device selection and complete example commands
  • ea3d7ff Document EXL3 static-pool boundary with upstream recent helper slots
  • ddb52ea Account for the full preallocated shared helper pool

📊 Changes

7 files changed (+571 additions, -22 deletions)

View changed files

📝 CMakeLists.txt (+5 -0)
➕ docs/EXL3-HELPER.md (+107 -0)
📝 docs/SETTINGS.md (+37 -2)
➕ src/ds4/ds4_draft_placement.hpp (+46 -0)
📝 src/ds4/ds4_model.cu (+161 -20)
➕ tests/ds4_draft_placement_test.cpp (+33 -0)
➕ tests/hip/ds4_exl3_helper.cpp (+182 -0)

📄 Description

On three 32 GB R9700s, decode increased from 28.38–29.04 to 34.11 tokens/sec (+17.4–20.2%) in an opt-in, same-binary off/on/off experiment. When the target GPUs miss an expert, an extra GPU can answer from its own resident expert pool while the CPU handles the remaining misses. That extra GPU can also host DSpark.

Workload Helper off A Helper on Helper off B
Coding 26.05 30.97 24.18
Async workers 34.15 41.09 32.06
16K context 28.08 31.92 30.15

Each arm emitted 3,072 timed tokens: two 512-token requests per workload after a 256-token warmup. Initial prompts, expert profile and hipBLASLt picks were matched. Aggregate controls drifted 2.3%; per-workload drift was larger. Natural continuations differed even between the controls, so this is observed end-to-end throughput, not a fixed-work or output-equivalence claim. No process swapping, decode KFD queue evictions, helper fallback or helper-dead state was observed.

This extends the existing GGUF helper to uniform EXL3 layers, including layers sharded across TP2. The helper is one explicitly selected extra GPU, not necessarily GPU 2 or the third installed card. The engine supports one helper device, rather than an arbitrary pool of helpers. The helper stores complete experts and executes the original router's selections on its own stream. Activations and results cross its link during decode; its expert weights remain resident. CPU backing remains available for recoverable fallback. This is resident overflow execution, not predictive prefetching.

Shared mode reserves the requested helper pool before drafter placement, so the drafter sees the remaining VRAM. It requires loaded DSpark blocks, TP2 and zero target layers on the helper. Dedicated EXL3 helpers are also supported. Mixed-format EXL3 layers are not selected.

The opt-in settings are documented in docs/SETTINGS.md and docs/EXL3-HELPER.md:

  • MAYA_DS4_HELPER and MAYA_DS4_HELPER_GB: visible GPU ID and explicit decimal-GB pool budget.
  • MAYA_DS4_HELPER_EXL3=1: enable EXL3 helper execution.
  • MAYA_DS4_HELPER_SHARED=1: also allow DSpark on that GPU; use MAYA_DS4_DRAFT_GPU for placement and MAYA_DS4_SPLIT to keep target layers off it.
  • MAYA_DS4_WARM_CAP_GB: required host warm-copy budget; this is not a total-process RAM limit with mmap disabled.
  • MAYA_DS4_HELPER_CHECK=1: upload byte checks, CPU/GPU execution checks and forced CPU fallback.

The native executable also accepts DS4_* names. The measured configuration used split 40,0, drafter/helper GPU 2, a 20 GB pool, a 200 GB host warm budget, CPU threads 8, recent slots 0, context 262,144, prefill chunk 4,096, mmap off and four-bit DSpark at confidence 0.65. Predictive prefetch was disabled; HSA_USE_SVM=0 was held constant. These are benchmark choices; no GPU IDs, memory sizes, CPU thread counts or cache policies become defaults. Both modes use about 189.6 GB of CPU expert backing in this mmap-off test.

The diff includes general visible-GPU drafter placement because existing DRAFT_DEV selects members only within the drafter's original group. Related #464 offers group-level placement; this branch uses visible GPU IDs to match helper selection and permits per-block placement. It does not depend on #464 or include the packed-host/direct-transfer work in #493. Earlier combined-stack measurements on our fork are separate from the clean-branch table above.

Validation: clean Release CMake build of maya-ds4 and the helper primitive; placement parser checks include noncontiguous selected IDs and invalid lists. The real model's load checks verified every helper upload byte, both represented EXL3 formats, grouped versus per-token GPU execution and CPU fallback with/without an existing contribution. The optional real-weight primitive covers windows of 1–6 tokens, repeated experts, unowned picks and an empty row.

A separate, longer confirmation of the combined optimized stack measured 40.35 tokens/sec versus served-engine controls of 34.50/34.61 (+16.6–17.0%), with 6,144 timed tokens per arm and 0.32% control drift. This is not an isolated measurement of this PR. In that comparison, warm 16K prefill took 21.10 seconds versus 19.03–19.08 seconds (about 10.7% longer), with zero model read bytes during those warm revisits. That remaining prefill tradeoff cannot be attributed solely to cold disk reads; it remains unresolved and the experimental stack has not replaced the serving configuration.

Limitations: CPU/GPU arithmetic differs, so model outputs need not be bit-identical; operator checks do not establish broad answer quality. Cold 16K prefill was 56.6 seconds in the helper arm versus 26.3/32.3 seconds in the controls, with unresolved I/O variability. The helper is opt-in and this is not a default-performance recommendation. Fatal GPU errors can also affect DSpark sharing that device; CPU fallback does not guarantee recovery. Linux AMD is the measured platform; CUDA and Windows shared-helper behavior have not been hardware-validated here.

Validation after rebasing onto v1.1.36

The rebase onto f031a23 (v1.1.36) preserves upstream's newer GGUF helper behavior, including uneven tensor-parallel support and recent-slot settings. EXL3 uses its static helper pool; a nonzero DS4_HELPER_RECENT fails loading explicitly because upstream's recent-fill path reads GGUF weights.

The rebased engine and real-weight primitive compile and link in a clean HIP Release build. The placement parser passes. Both real K3/K4 fixtures pass windows of 1–6 tokens, repeated experts, unowned picks and an empty output row: 12 cases, 215,040 grouped/per-token output values exact.

The throughput figures above remain historical measurements of the earlier pinned base. These build and operator checks do not establish current-base throughput or broad answer quality. Current-base model loading passed with all helper upload byte checks enabled. Both represented EXL3 formats passed the CPU/GPU tolerance (largest relative discrepancies 0.000509 and 0.000554, tolerance 0.001), grouped versus single-token equality (40,960 values), and forced retained-CPU fallback checks with and without an existing contribution. Two short API requests returned content; the 64-token request reached its cap, so it is a serving smoke check, not a completed-answer quality test. The previous serving engine is restored after validation.


🔄 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/527 **Author:** [@LostVector](https://github.com/LostVector) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `upstream/ds4-exl3-helper-20261026` --- ### 📝 Commits (7) - [`e735f37`](https://github.com/mw00/project-maya/commit/e735f3750fd85abef6b771349e54610922896e82) Allow opt-in DSpark block GPU placement across target groups - [`be49f33`](https://github.com/mw00/project-maya/commit/be49f331e830cc21537e92455432f22f6c43010b) Add opt-in EXL3 overflow helper sharing the DSpark GPU - [`7dc4456`](https://github.com/mw00/project-maya/commit/7dc4456d0a309bbdb1c470ed88c994ace8abb8d2) Document the explicit recent-cache setting used for helper measurements - [`b69bb03`](https://github.com/mw00/project-maya/commit/b69bb030e07b53ca627cf1e3e37504936e909dea) Document portable EXL3 helper flags and separate benchmark tuning - [`f376d39`](https://github.com/mw00/project-maya/commit/f376d39680f1dc546224556f96f7d3985fc3b6d4) Clarify shared-helper device selection and complete example commands - [`ea3d7ff`](https://github.com/mw00/project-maya/commit/ea3d7ffb41e2a3bc43a8373b87270cbe85d5f692) Document EXL3 static-pool boundary with upstream recent helper slots - [`ddb52ea`](https://github.com/mw00/project-maya/commit/ddb52eaeb407b31a0504b7a853bceb364f9ac8ec) Account for the full preallocated shared helper pool ### 📊 Changes **7 files changed** (+571 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+5 -0) ➕ `docs/EXL3-HELPER.md` (+107 -0) 📝 `docs/SETTINGS.md` (+37 -2) ➕ `src/ds4/ds4_draft_placement.hpp` (+46 -0) 📝 `src/ds4/ds4_model.cu` (+161 -20) ➕ `tests/ds4_draft_placement_test.cpp` (+33 -0) ➕ `tests/hip/ds4_exl3_helper.cpp` (+182 -0) </details> ### 📄 Description On three 32 GB R9700s, **decode increased from 28.38–29.04 to 34.11 tokens/sec (+17.4–20.2%)** in an opt-in, same-binary off/on/off experiment. When the target GPUs miss an expert, an extra GPU can answer from its own resident expert pool while the CPU handles the remaining misses. That extra GPU can also host DSpark. | Workload | Helper off A | Helper on | Helper off B | | --- | ---: | ---: | ---: | | Coding | 26.05 | 30.97 | 24.18 | | Async workers | 34.15 | 41.09 | 32.06 | | 16K context | 28.08 | 31.92 | 30.15 | Each arm emitted 3,072 timed tokens: two 512-token requests per workload after a 256-token warmup. Initial prompts, expert profile and hipBLASLt picks were matched. Aggregate controls drifted 2.3%; per-workload drift was larger. Natural continuations differed even between the controls, so this is observed end-to-end throughput, not a fixed-work or output-equivalence claim. No process swapping, decode KFD queue evictions, helper fallback or helper-dead state was observed. This extends the existing GGUF helper to uniform EXL3 layers, including layers sharded across TP2. The helper is one explicitly selected extra GPU, not necessarily GPU 2 or the third installed card. The engine supports one helper device, rather than an arbitrary pool of helpers. The helper stores complete experts and executes the original router's selections on its own stream. Activations and results cross its link during decode; its expert weights remain resident. CPU backing remains available for recoverable fallback. This is resident overflow execution, not predictive prefetching. Shared mode reserves the requested helper pool before drafter placement, so the drafter sees the remaining VRAM. It requires loaded DSpark blocks, TP2 and zero target layers on the helper. Dedicated EXL3 helpers are also supported. Mixed-format EXL3 layers are not selected. The opt-in settings are documented in `docs/SETTINGS.md` and `docs/EXL3-HELPER.md`: - `MAYA_DS4_HELPER` and `MAYA_DS4_HELPER_GB`: visible GPU ID and explicit decimal-GB pool budget. - `MAYA_DS4_HELPER_EXL3=1`: enable EXL3 helper execution. - `MAYA_DS4_HELPER_SHARED=1`: also allow DSpark on that GPU; use `MAYA_DS4_DRAFT_GPU` for placement and `MAYA_DS4_SPLIT` to keep target layers off it. - `MAYA_DS4_WARM_CAP_GB`: required host warm-copy budget; this is not a total-process RAM limit with mmap disabled. - `MAYA_DS4_HELPER_CHECK=1`: upload byte checks, CPU/GPU execution checks and forced CPU fallback. The native executable also accepts `DS4_*` names. The measured configuration used split `40,0`, drafter/helper GPU 2, a 20 GB pool, a 200 GB host warm budget, CPU threads 8, recent slots 0, context 262,144, prefill chunk 4,096, mmap off and four-bit DSpark at confidence 0.65. Predictive prefetch was disabled; `HSA_USE_SVM=0` was held constant. These are benchmark choices; **no GPU IDs, memory sizes, CPU thread counts or cache policies become defaults**. Both modes use about 189.6 GB of CPU expert backing in this mmap-off test. The diff includes general visible-GPU drafter placement because existing `DRAFT_DEV` selects members only within the drafter's original group. Related #464 offers group-level placement; this branch uses visible GPU IDs to match helper selection and permits per-block placement. It does not depend on #464 or include the packed-host/direct-transfer work in #493. Earlier combined-stack measurements on [our fork](https://github.com/LostVector/project-maya/pull/55) are separate from the clean-branch table above. Validation: clean Release CMake build of `maya-ds4` and the helper primitive; placement parser checks include noncontiguous selected IDs and invalid lists. The real model's load checks verified every helper upload byte, both represented EXL3 formats, grouped versus per-token GPU execution and CPU fallback with/without an existing contribution. The optional real-weight primitive covers windows of 1–6 tokens, repeated experts, unowned picks and an empty row. A separate, longer confirmation of the combined optimized stack measured 40.35 tokens/sec versus served-engine controls of 34.50/34.61 (+16.6–17.0%), with 6,144 timed tokens per arm and 0.32% control drift. This is not an isolated measurement of this PR. In that comparison, warm 16K prefill took 21.10 seconds versus 19.03–19.08 seconds (about 10.7% longer), with zero model read bytes during those warm revisits. That remaining prefill tradeoff cannot be attributed solely to cold disk reads; it remains unresolved and the experimental stack has not replaced the serving configuration. **Limitations:** CPU/GPU arithmetic differs, so model outputs need not be bit-identical; operator checks do not establish broad answer quality. Cold 16K prefill was 56.6 seconds in the helper arm versus 26.3/32.3 seconds in the controls, with unresolved I/O variability. The helper is opt-in and this is not a default-performance recommendation. Fatal GPU errors can also affect DSpark sharing that device; CPU fallback does not guarantee recovery. Linux AMD is the measured platform; CUDA and Windows shared-helper behavior have not been hardware-validated here. ### Validation after rebasing onto v1.1.36 The rebase onto `f031a23` (v1.1.36) preserves upstream's newer GGUF helper behavior, including uneven tensor-parallel support and recent-slot settings. EXL3 uses its static helper pool; a nonzero `DS4_HELPER_RECENT` fails loading explicitly because upstream's recent-fill path reads GGUF weights. The rebased engine and real-weight primitive compile and link in a clean HIP Release build. The placement parser passes. Both real K3/K4 fixtures pass windows of 1–6 tokens, repeated experts, unowned picks and an empty output row: 12 cases, 215,040 grouped/per-token output values exact. The throughput figures above remain historical measurements of the earlier pinned base. These build and operator checks do not establish current-base throughput or broad answer quality. Current-base model loading passed with all helper upload byte checks enabled. Both represented EXL3 formats passed the CPU/GPU tolerance (largest relative discrepancies 0.000509 and 0.000554, tolerance 0.001), grouped versus single-token equality (40,960 values), and forced retained-CPU fallback checks with and without an existing contribution. Two short API requests returned content; the 64-token request reached its cap, so it is a serving smoke check, not a completed-answer quality test. The previous serving engine is restored after validation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#582
No description provided.