[PR #324] [MERGED] GLM split rows: even groups from all running requests, opt-in (MAYA_GLM_EVEN_GROUPS) #470

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/324
Author: @somnergy
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @mw00

Base: main ← Head: pr/even-groups


📝 Commits (2)

  • 62c985f GLM split rows: even groups from all running requests (STRATA_GLM_EVEN_GROUPS, off by default)
  • 43621a4 GLM multi bench: every sequence's tokens to a file (STRATA_GLM_MULTI_DUMP)

📊 Changes

5 files changed (+140 additions, -6 deletions)

View changed files

📝 CMakeLists.txt (+2 -2)
📝 docs/SETTINGS.md (+2 -1)
➕ include/strata/core/split_groups.hpp (+36 -0)
📝 src/program/generate.cpp (+36 -3)
➕ tests/core/split_groups_test.cpp (+64 -0)

📄 Description

What

MAYA_GLM_EVEN_GROUPS=1 (STRATA_GLM_EVEN_GROUPS, off by default) changes how the split decode (MAYA_GLM_SPLIT_ROWS = k on two GPUs or more) groups the running requests.

Today the scheduler fills groups of k in turn. With k or fewer requests that is a single group, and the split's parts take turns on it: while the group's token is on the second GPU, the first one has nothing to do. With the setting on, the running requests are cut into max(2, ceil(n / k)) groups of near-equal size (k at most), so the pipeline always has a group for each part:

running requests, k = 4 today even groups
2 one group of 2 1 + 1
4 one group of 4 2 + 2
5 4 + 1 3 + 2
8 4 + 4 4 + 4

The size comes from all running requests, not from the ones ready at this step: in steady state only the group that just came back is ready, and cutting it again would end in groups of one. The rule is strata/core/split_groups.hpp; the server's step and the multi bench's split-rows path both use it.

A second commit adds MAYA_GLM_MULTI_DUMP=<file>: the multi bench writes every sequence's tokens to the file, so two builds or settings can be compared token for token instead of by the first 12 tokens it prints. It is independent and can be dropped.

How to enable

MAYA_GLM_EVEN_GROUPS=1 beside MAYA_GLM_SPLIT_ROWS (2 or more GPUs, --parallel > 1). Rows in docs/SETTINGS.md.

How it was verified

The setup: 2x RTX PRO 5000 Blackwell 72 GB, GLM-5.3-Flash EXL3 3.1 bpw (every expert in VRAM), split rows 4, --parallel 8 at 512K, KV streaming (window 196608), int8 KV, greedy. main and this branch were built the same way with nvcc 13.4.

  • CI checks: the HIP-name check, the server tests and the installer and tools tests pass. split_groups_test (CPU) covers:
    • the old rule unchanged;
    • the even rule's sizes;
    • steady state, where only the returning group is ready;
    • every (ready, active, k) split up to 8.
  • C++ tests on the GPU: the same pass/fail set as main (54/60 vs 53/59; the 6 failures are missing data files and an mlock limit on both).
  • Exactness: a workload where 4 greedy decoders run while a ~90K-token prompt is read gave identical text with the setting off and on, and identical to main with it off. The workload also has a cancelled read, a client that disconnects mid-read and a queued request.
  • Before / after: aggregate decode while N streams of ~126K-token prompts decode at once:
streams main this branch, MAYA_GLM_EVEN_GROUPS=1
8 131.6 tok/s 131.4 tok/s (same groups: 4+4)
4 73.2 tok/s 122.1 tok/s (+67%)
2 64.9 tok/s 99.8 tok/s (+54%)

The 8-stream aggregate of builds at main's behaviour varied 131.4-131.8 tok/s across five runs.

I didn't use the greedy texts of the 8 x ~126K workload as an identity check. Two fresh starts of main alone already differ on 3 of 8 streams there: the 8 simultaneous requests are read in whatever order they arrive, and the read order changes which experts the second GPU lends during later reads. The validation logs and a summary of them follow in a comment.


🔄 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/324 **Author:** [@somnergy](https://github.com/somnergy) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `pr/even-groups` --- ### 📝 Commits (2) - [`62c985f`](https://github.com/mw00/project-maya/commit/62c985fc11b24dc7971cd4c91099bc33d3916cd1) GLM split rows: even groups from all running requests (STRATA_GLM_EVEN_GROUPS, off by default) - [`43621a4`](https://github.com/mw00/project-maya/commit/43621a4cfc649d30e8a9742f8cd6c348ee0b8d0a) GLM multi bench: every sequence's tokens to a file (STRATA_GLM_MULTI_DUMP) ### 📊 Changes **5 files changed** (+140 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+2 -2) 📝 `docs/SETTINGS.md` (+2 -1) ➕ `include/strata/core/split_groups.hpp` (+36 -0) 📝 `src/program/generate.cpp` (+36 -3) ➕ `tests/core/split_groups_test.cpp` (+64 -0) </details> ### 📄 Description ## What `MAYA_GLM_EVEN_GROUPS=1` (`STRATA_GLM_EVEN_GROUPS`, off by default) changes how the split decode (`MAYA_GLM_SPLIT_ROWS` = k on two GPUs or more) groups the running requests. Today the scheduler fills groups of k in turn. With k or fewer requests that is a single group, and the split's parts take turns on it: while the group's token is on the second GPU, the first one has nothing to do. With the setting on, the running requests are cut into max(2, ceil(n / k)) groups of near-equal size (k at most), so the pipeline always has a group for each part: | running requests, k = 4 | today | even groups | |---|---|---| | 2 | one group of 2 | 1 + 1 | | 4 | one group of 4 | 2 + 2 | | 5 | 4 + 1 | 3 + 2 | | 8 | 4 + 4 | 4 + 4 | The size comes from all running requests, not from the ones ready at this step: in steady state only the group that just came back is ready, and cutting it again would end in groups of one. The rule is `strata/core/split_groups.hpp`; the server's step and the multi bench's split-rows path both use it. A second commit adds `MAYA_GLM_MULTI_DUMP=<file>`: the multi bench writes every sequence's tokens to the file, so two builds or settings can be compared token for token instead of by the first 12 tokens it prints. It is independent and can be dropped. ## How to enable `MAYA_GLM_EVEN_GROUPS=1` beside `MAYA_GLM_SPLIT_ROWS` (2 or more GPUs, `--parallel` > 1). Rows in `docs/SETTINGS.md`. ## How it was verified The setup: 2x RTX PRO 5000 Blackwell 72 GB, GLM-5.3-Flash EXL3 3.1 bpw (every expert in VRAM), split rows 4, `--parallel 8` at 512K, KV streaming (window 196608), int8 KV, greedy. `main` and this branch were built the same way with nvcc 13.4. - **CI checks:** the HIP-name check, the server tests and the installer and tools tests pass. `split_groups_test` (CPU) covers: - the old rule unchanged; - the even rule's sizes; - steady state, where only the returning group is ready; - every (ready, active, k) split up to 8. - **C++ tests on the GPU:** the same pass/fail set as main (54/60 vs 53/59; the 6 failures are missing data files and an mlock limit on both). - **Exactness:** a workload where 4 greedy decoders run while a ~90K-token prompt is read gave identical text with the setting off and on, and identical to main with it off. The workload also has a cancelled read, a client that disconnects mid-read and a queued request. - **Before / after:** aggregate decode while N streams of ~126K-token prompts decode at once: | streams | main | this branch, `MAYA_GLM_EVEN_GROUPS=1` | |---|---|---| | 8 | 131.6 tok/s | 131.4 tok/s (same groups: 4+4) | | 4 | 73.2 tok/s | 122.1 tok/s (+67%) | | 2 | 64.9 tok/s | 99.8 tok/s (+54%) | The 8-stream aggregate of builds at main's behaviour varied 131.4-131.8 tok/s across five runs. I didn't use the greedy texts of the 8 x ~126K workload as an identity check. Two fresh starts of main alone already differ on 3 of 8 streams there: the 8 simultaneous requests are read in whatever order they arrive, and the read order changes which experts the second GPU lends during later reads. The validation logs and a summary of them follow in a comment. --- <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:47 +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#470
No description provided.