mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #94] [MERGED] Several conversations at once on a layer split (STRATA_GLM_SEQS, off by default): a pipelined decode across the parts #331
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#331
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/94
Author: @0xPreDa
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @mw00
Base:
main← Head:pr-multi📝 Commits (3)
305f450Fair slices for concurrent requests (STRATA_FAIR_SLICE_S) and the engine's PAUSEf05de97Several conversations at once on a layer split (STRATA_GLM_SEQS)fc8bb60generate: kNoImages static, so the multi path's local Ctx has a default constructor on MSVC (#94 on Windows)📊 Changes
11 files changed (+1917 additions, -46 deletions)
View changed files
📝
CMakeLists.txt(+1 -1)📝
README.md(+4 -0)📝
include/strata/core/glm_model.hpp(+45 -0)➕
serve/fake_multi_engine.py(+74 -0)📝
serve/server.py(+368 -13)➕
serve/test_fair.py(+224 -0)➕
serve/test_multi.py(+122 -0)📝
src/core/glm_fast_path.cu(+4 -0)📝
src/core/glm_model.cu(+17 -0)➕
src/core/glm_multi.cu(+278 -0)📝
src/program/generate.cpp(+780 -32)📄 Description
Builds on #93. This branch contains #93's commit: the FairLock and PAUSE it extends. Please review #93 first; the second commit here is this PR's own change.
Why (follows #30)
On a layer split, one part works on a token while the others wait: 3 of 4 cards idle during decode. This PR does not batch rows inside a layer, which is #30's stage 3. It keeps several sequences in flight so that each part works on a different one at the same time.
What changes
Engine
src/core/glm_multi.cu). WithSTRATA_GLM_SEQS=<n>, each part keeps n state arenas, the extra ones sized forSTRATA_GLM_SEQ_CTXtokens. A state is the residual, KDA states, DSA caches, position, snapshot and image rows.load_pack's for the first one; the engine refuses to start on a mismatch.multi_issueenqueues one token of one sequence through every part, with per-sequence pinned hop slots and events, then the head and sampler on the tail, and does not wait.multi_takewaits for that sequence's token. The tier boundary runs everySTRATA_GLM_MULTI_BOUNDARYrounds (default 32), not every token.Serve loop (
run_request's prompt part and pause handling are now shared lambdas; withSTRATA_GLM_SEQSunset, the path and its output are unchanged)GEN ... rid=<id>. Every line a request causes carries the id:T <rid> <tok>,PP <rid> ...,DONE <rid> ...,ERR <rid> ....STOP <rid>andPAUSE <rid> [keep]end one request;STOPalone ends all of them.READY ... multi=<n>.STRATA_GLM_MULTI_ROOMtokens (default 16384) after the prompt, and max tokens are cut to the context.Server
FairLockgets n places. Image encodes, context reloads and updates take all of them./slotsand/propsreport n.README: rows for
STRATA_GLM_SEQS/STRATA_GLM_SEQ_CTX,STRATA_GLM_MULTI_ROOM/_BOUNDARY/_SPECandSTRATA_GLM_MULTI_BENCH.Exactness (
STRATA_GLM_MULTI_BENCH=<n>,<prompt>,<gen>: the token path against the pipeline)Speed (4× RTX 4090, Maya-S24, ctx 262144 + 3 × 65536)
When not to use it
Limitations
DONEhit counters andSTATlines are engine-wide while several requests run.Tests
serve/test_multi.py, against a scripted multi engine (serve/fake_multi_engine.py): routing, STOP of one request, errors, the n places.tools/check_hip_compat.pypasses, and the tools tests give the same results asmain.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.