[PR #257] feat(glm): DFMULTI shared multi-token verification, ragged windows, 32-row arena #431

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/257
Author: @btothec
Created: 10/17/2026
Status: 🔄 Open

Base: main ← Head: feat/dfmulti-shared-verification


📝 Commits (4)

  • 8804221 feat(glm): DFMULTI shared multi-token verification, ragged windows, 32-row arena
  • 498a8d1 feat(glm): fused per-row KDA staging gather for the DFMULTI rows path
  • a16e51c feat(glm): EXL3 trellis helper - the secondary GPU owns complementary experts
  • 8ecb74a fix(glm): include exl3.hpp in remote_experts.hpp (the header names ExpertLayout)

📊 Changes

22 files changed (+1751 additions, -101 deletions)

View changed files

📝 include/strata/core/glm_dflash.hpp (+11 -0)
📝 include/strata/core/glm_model.hpp (+36 -1)
📝 include/strata/core/remote_experts.hpp (+7 -0)
📝 include/strata/kernels/glm_fast.hpp (+19 -3)
📝 serve/server.py (+55 -26)
📝 serve/test_server.py (+36 -0)
📝 serve/web/app.css (+5 -2)
📝 serve/web/app.js (+9 -3)
📝 serve/web/index.html (+7 -3)
📝 src/core/glm_dflash.cu (+246 -2)
📝 src/core/glm_fast_path.cu (+24 -10)
📝 src/core/glm_model.cu (+1 -0)
📝 src/core/glm_multi.cu (+29 -2)
📝 src/core/glm_rows.cu (+571 -11)
📝 src/core/remote_experts.cpp (+44 -0)
📝 src/kernels/cuda/glm_fast.cu (+70 -13)
📝 src/program/generate.cpp (+304 -17)
📝 tests/glm_mv_nt_test.cu (+10 -8)
➕ tests/test_dflash_multi_depth_contract.py (+31 -0)
➕ tests/test_exl3_helper_contract.py (+60 -0)

...and 2 more files

📄 Description

Summary

The several-conversation scheduler (STRATA_GLM_SEQS > 1) previously decoded without DFlash, verifying one target token per context per step. This adds genuine shared multi-token speculative verification on one GPU:

  • Per-conversation DFlash proposal queues feed batched target windows: contexts with queued drafts verify up to their window depth (drafts plus the anchor) in one target call. Row-local residuals, per-window KDA backups and a prefix-commit transaction preserve recurrent state on mismatch.
  • Ragged windows: a step no longer waits for every request to be draft-ready. Draft-ready contexts take their full depth (8/4/2 rows by active request count: STRATA_GLM_DFMULTI_SOLO_DEPTH / STRATA_GLM_DFMULTI_PAIR_DEPTH / STRATA_GLM_DFMULTI_DEPTH), others take exactly one row in the same call. The one-row fallback path remains for steps where nothing forms a window.
  • Multi-vector row arena widened from 8 to 32 target rows (kMaxMvNt, CUDA fused 32-column kernel; HIP keeps chunked widths above 8). glm_mv_nt_test covers the fused path bit-for-bit in typed and generic modes (568 cases).
  • Draft-ahead (STRATA_GLM_DFMULTI_AHEAD=1, default off): the next window's drafter block is kicked on the drafter stream after a commit, waited for at the top of the next step. Measured neutral on a one-GPU rig; kept for split rigs where the drafter stream can overlap real target work.
  • Adaptive depth: each context's rows are clamped by its queued drafts + anchor, its remaining output budget and its context room; truthful tracing records actual rows, accepted drafts and avoided serial calls (STRATA_GLM_DFMULTI_TRACE).
  • Monitor: per-request live decode rates; the aggregate and per-stream numbers no longer mix concurrent counters.

Measurements (RTX PRO 6000 Blackwell, EXL3-3.05bpw + DFlash2, single GPU)

  • 4 concurrent coding requests: ~80-90 tok/s aggregate, holding ~80 as requests drain to 3, 2, 1 (ragged windows at work).
  • Shared depth-2 windows on mixed four-request prompts: ~56 tok/s aggregate vs ~55 on the one-row path; depth-8 (32-row) windows were slower in matched probes, so 8/4/2 is the default operating point.
  • Output equality checked against the one-row path across the tested depths.

Test plan

  • python3 tests/test_glm_multi_window_contract.py (12 cases) and python3 tests/test_dflash_multi_depth_contract.py
  • python3 -m unittest discover -s tests -p 'test_*.py' (13 cases) and the server suite (91 cases)
  • ./build/glm_mv_nt_test typed + generic parity, plus --bench, for the 32-column kernel
  • Live service A/B: solo/2/4-request probes with trace off, warm-up trials discarded (trace-on depresses measured rates; cold-vs-warm expert-cache spread is ~20% solo)

🔄 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/257 **Author:** [@btothec](https://github.com/btothec) **Created:** 10/17/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/dfmulti-shared-verification` --- ### 📝 Commits (4) - [`8804221`](https://github.com/mw00/project-maya/commit/88042219efa8d78a9b8f17e3f03ba077e944d83d) feat(glm): DFMULTI shared multi-token verification, ragged windows, 32-row arena - [`498a8d1`](https://github.com/mw00/project-maya/commit/498a8d1894849314d627dc59884341c3a803e2fe) feat(glm): fused per-row KDA staging gather for the DFMULTI rows path - [`a16e51c`](https://github.com/mw00/project-maya/commit/a16e51cb0e1cf30bdaa9ec9c8298153117a79232) feat(glm): EXL3 trellis helper - the secondary GPU owns complementary experts - [`8ecb74a`](https://github.com/mw00/project-maya/commit/8ecb74a34958687ea4516408696439f29f7aa876) fix(glm): include exl3.hpp in remote_experts.hpp (the header names ExpertLayout) ### 📊 Changes **22 files changed** (+1751 additions, -101 deletions) <details> <summary>View changed files</summary> 📝 `include/strata/core/glm_dflash.hpp` (+11 -0) 📝 `include/strata/core/glm_model.hpp` (+36 -1) 📝 `include/strata/core/remote_experts.hpp` (+7 -0) 📝 `include/strata/kernels/glm_fast.hpp` (+19 -3) 📝 `serve/server.py` (+55 -26) 📝 `serve/test_server.py` (+36 -0) 📝 `serve/web/app.css` (+5 -2) 📝 `serve/web/app.js` (+9 -3) 📝 `serve/web/index.html` (+7 -3) 📝 `src/core/glm_dflash.cu` (+246 -2) 📝 `src/core/glm_fast_path.cu` (+24 -10) 📝 `src/core/glm_model.cu` (+1 -0) 📝 `src/core/glm_multi.cu` (+29 -2) 📝 `src/core/glm_rows.cu` (+571 -11) 📝 `src/core/remote_experts.cpp` (+44 -0) 📝 `src/kernels/cuda/glm_fast.cu` (+70 -13) 📝 `src/program/generate.cpp` (+304 -17) 📝 `tests/glm_mv_nt_test.cu` (+10 -8) ➕ `tests/test_dflash_multi_depth_contract.py` (+31 -0) ➕ `tests/test_exl3_helper_contract.py` (+60 -0) _...and 2 more files_ </details> ### 📄 Description ## Summary The several-conversation scheduler (`STRATA_GLM_SEQS > 1`) previously decoded without DFlash, verifying one target token per context per step. This adds genuine shared multi-token speculative verification on one GPU: - **Per-conversation DFlash proposal queues** feed batched target windows: contexts with queued drafts verify up to their window depth (drafts plus the anchor) in one target call. Row-local residuals, per-window KDA backups and a prefix-commit transaction preserve recurrent state on mismatch. - **Ragged windows**: a step no longer waits for every request to be draft-ready. Draft-ready contexts take their full depth (8/4/2 rows by active request count: `STRATA_GLM_DFMULTI_SOLO_DEPTH` / `STRATA_GLM_DFMULTI_PAIR_DEPTH` / `STRATA_GLM_DFMULTI_DEPTH`), others take exactly one row in the same call. The one-row fallback path remains for steps where nothing forms a window. - **Multi-vector row arena widened from 8 to 32 target rows** (`kMaxMvNt`, CUDA fused 32-column kernel; HIP keeps chunked widths above 8). `glm_mv_nt_test` covers the fused path bit-for-bit in typed and generic modes (568 cases). - **Draft-ahead** (`STRATA_GLM_DFMULTI_AHEAD=1`, default off): the next window's drafter block is kicked on the drafter stream after a commit, waited for at the top of the next step. Measured neutral on a one-GPU rig; kept for split rigs where the drafter stream can overlap real target work. - **Adaptive depth**: each context's rows are clamped by its queued drafts + anchor, its remaining output budget and its context room; truthful tracing records actual rows, accepted drafts and avoided serial calls (`STRATA_GLM_DFMULTI_TRACE`). - **Monitor**: per-request live decode rates; the aggregate and per-stream numbers no longer mix concurrent counters. ## Measurements (RTX PRO 6000 Blackwell, EXL3-3.05bpw + DFlash2, single GPU) - 4 concurrent coding requests: **~80-90 tok/s aggregate**, holding ~80 as requests drain to 3, 2, 1 (ragged windows at work). - Shared depth-2 windows on mixed four-request prompts: ~56 tok/s aggregate vs ~55 on the one-row path; depth-8 (32-row) windows were slower in matched probes, so 8/4/2 is the default operating point. - Output equality checked against the one-row path across the tested depths. ## Test plan - [x] `python3 tests/test_glm_multi_window_contract.py` (12 cases) and `python3 tests/test_dflash_multi_depth_contract.py` - [x] `python3 -m unittest discover -s tests -p 'test_*.py'` (13 cases) and the server suite (91 cases) - [x] `./build/glm_mv_nt_test` typed + generic parity, plus `--bench`, for the 32-column kernel - [x] Live service A/B: solo/2/4-request probes with trace off, warm-up trials discarded (trace-on depresses measured rates; cold-vs-warm expert-cache spread is ~20% solo) --- <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#431
No description provided.