[PR #48] [MERGED] NextN draft: STRATA_GLM_MTP_KEEP=<n> - fetch only the draft's n best-scored missing experts #301

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/48
Author: @sociolog
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mw00

Base: main ← Head: pr4-mtp-keep


📝 Commits (2)

  • 751524e NextN draft: STRATA_GLM_MTP_KEEP= - fetch only the n best-scored missing experts of the draft's route
  • ee0c318 README: the Tuning table's row for STRATA_GLM_MTP_KEEP

📊 Changes

4 files changed (+17 additions, -11 deletions)

View changed files

📝 README.md (+1 -0)
📝 include/strata/kernels/glm_fast.hpp (+1 -1)
📝 src/core/glm_fast_path.cu (+8 -4)
📝 src/kernels/cuda/glm_fast.cu (+7 -6)

📄 Description

What

The draft block skips every routed expert that is not in VRAM (mtp_skip_miss): a draft only has to be a good
guess. On a 2-GPU split that is ~40 % of its experts, and its acceptance shows it. STRATA_GLM_MTP_KEEP=<n> is in
between skipping all and STRATA_GLM_MTP_MISS=1 (fetch all): the missing experts among the route's n best-scored
ones are computed (CPU lane / PCIe as the plan says for any route), the rest skipped. moe_route takes skip_from
(the first route rank whose missing experts are skipped: 0 = all, 8 = none) in place of the skip_miss flag.
README row added (it also documents MTP_MISS).

Why

A rejected draft costs the head half a full redo of its position, and the draft that skips ~40 % of its experts guesses
worse. Clean A/B on v1.0.23 (RTX 3090 + RTX 3060 split 30, Maya-M, 245760 context, STRATA_GLM_KV_INT8=1,
RAM_RESIDENT=1): the --bench questions plus one answer after a 20K-token context, MTP_KEEP 0 and 2 interleaved,
three rounds each:

MTP_KEEP=0 (default) MTP_KEEP=2
draft acceptance (12 answers each) 77.6 % 87.1 %
decode, mean of the 4 answers, per round 19.49 / 19.61 / 20.27 20.37 / 20.66 / 21.13
decode, mean 19.79 tok/s 20.72 tok/s (+4.7 %)
the answer at 20K depth 19.77 19.97 (+1 %, within noise)

KEEP=2 won every round. Fetching all missing experts (MTP_MISS=1) drafts best (~91 %) but costs the draft more
(7.2 vs 3.7 ms a step on the 3060) and came out ~3 % slower than KEEP=2 here. Output tokens are the trunk's own
either way - only the draft changes.

Where it helps: a split whose draft block misses VRAM often (consumer cards, a large quant). It does nothing on one
GPU (no pipelined speculation there) or where the experts all fit in VRAM - which is why it stays off by default.

Checks: on v1.0.21 (whose CUDA sources are those of v1.0.23): build (sm_75, sm_86); glm_dsa_parity, glm_ffn_parity, glm_hc_parity, glm_kda_parity, glm_layer_parity --selftest: all PASS; the --bench request sequence on the real model (RTX 3090 + 3060 split): runs clean. On v1.0.23, as CI runs them: tools/check_hip_compat.py passes (no new CUDA names); server tests OK (3 skipped); tools tests: the one error is test_iq_pack needing the llama.cpp clone (third_party/), the same on plain v1.0.23.


The code, the measurements and this description were produced with the help of Claude, an AI assistant by Anthropic.


🔄 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/48 **Author:** [@sociolog](https://github.com/sociolog) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `pr4-mtp-keep` --- ### 📝 Commits (2) - [`751524e`](https://github.com/mw00/project-maya/commit/751524ec68139dbdbd19b98a66083b2575000984) NextN draft: STRATA_GLM_MTP_KEEP=<n> - fetch only the n best-scored missing experts of the draft's route - [`ee0c318`](https://github.com/mw00/project-maya/commit/ee0c318fd460a3c1d1e59d1810c606b426237f14) README: the Tuning table's row for STRATA_GLM_MTP_KEEP ### 📊 Changes **4 files changed** (+17 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -0) 📝 `include/strata/kernels/glm_fast.hpp` (+1 -1) 📝 `src/core/glm_fast_path.cu` (+8 -4) 📝 `src/kernels/cuda/glm_fast.cu` (+7 -6) </details> ### 📄 Description ## What The draft block skips every routed expert that is not in VRAM (`mtp_skip_miss`): a draft only has to be a good guess. On a 2-GPU split that is ~40 % of its experts, and its acceptance shows it. `STRATA_GLM_MTP_KEEP=<n>` is in between skipping all and `STRATA_GLM_MTP_MISS=1` (fetch all): the missing experts among the route's n best-scored ones are computed (CPU lane / PCIe as the plan says for any route), the rest skipped. `moe_route` takes `skip_from` (the first route rank whose missing experts are skipped: 0 = all, 8 = none) in place of the `skip_miss` flag. README row added (it also documents `MTP_MISS`). ## Why A rejected draft costs the head half a full redo of its position, and the draft that skips ~40 % of its experts guesses worse. Clean A/B on v1.0.23 (RTX 3090 + RTX 3060 split 30, Maya-M, 245760 context, `STRATA_GLM_KV_INT8=1`, RAM_RESIDENT=1): the `--bench` questions plus one answer after a 20K-token context, `MTP_KEEP` 0 and 2 interleaved, three rounds each: | | `MTP_KEEP=0` (default) | `MTP_KEEP=2` | |---|---:|---:| | draft acceptance (12 answers each) | 77.6 % | 87.1 % | | decode, mean of the 4 answers, per round | 19.49 / 19.61 / 20.27 | 20.37 / 20.66 / 21.13 | | decode, mean | 19.79 tok/s | **20.72 tok/s (+4.7 %)** | | the answer at 20K depth | 19.77 | 19.97 (+1 %, within noise) | `KEEP=2` won every round. Fetching all missing experts (`MTP_MISS=1`) drafts best (~91 %) but costs the draft more (7.2 vs 3.7 ms a step on the 3060) and came out ~3 % slower than `KEEP=2` here. Output tokens are the trunk's own either way - only the draft changes. **Where it helps:** a split whose draft block misses VRAM often (consumer cards, a large quant). It does nothing on one GPU (no pipelined speculation there) or where the experts all fit in VRAM - which is why it stays off by default. **Checks:** on v1.0.21 (whose CUDA sources are those of v1.0.23): build (sm_75, sm_86); `glm_dsa_parity`, `glm_ffn_parity`, `glm_hc_parity`, `glm_kda_parity`, `glm_layer_parity` `--selftest`: all PASS; the `--bench` request sequence on the real model (RTX 3090 + 3060 split): runs clean. On v1.0.23, as CI runs them: `tools/check_hip_compat.py` passes (no new CUDA names); server tests OK (3 skipped); tools tests: the one error is `test_iq_pack` needing the llama.cpp clone (`third_party/`), the same on plain v1.0.23. --- *The code, the measurements and this description were produced with the help of Claude, an AI assistant by Anthropic.* --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:23:58 +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#301
No description provided.