mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1253] [CLOSED] Enable serial multi-GPU batch MTP #3338
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3338
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/Niko1221/Strata/pull/1253
Author: @ilumn
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:feat/multi-gpu-batch-mtp📝 Commits (10+)
8fc9490Isolate concurrent multimodal positions and batch-MTP draft paths0de9365Support serial split batch MTP with last-stage slot drafters4a0557fMerge upstream main into multimodal slot recoveryb87b45cMerge updated slot recovery and upstream main into split batch MTP96118a1Add token-gated staggered batch and solo promotion regression97728fcMerge branch 'fix/pr1242-staggered' of ../Strata-pr1242-staggered into fix/pr1253-staggered08b39baRequire overlap after each staggered admissionc993d77Merge branch 'fix/pr1242-staggered' of ../Strata-pr1242-staggered into fix/pr1253-staggered92d60a8Cover sparse pipeline slot IDs and leading pad rows1a53f7fMerge branch 'fix/pr1242-staggered' of ../Strata-pr1242-staggered into fix/pr1253-staggered📊 Changes
16 files changed (+1058 additions, -145 deletions)
View changed files
📝
CMakeLists.txt(+26 -0)📝
docs/BATCHING.md(+55 -6)📝
docs/MULTI_GPU.md(+12 -0)📝
include/strata/core/mtp.hpp(+1 -4)📝
include/strata/core/session.hpp(+4 -0)📝
include/strata/kernels/mrope.hpp(+10 -0)➕
include/strata/program/vision_records.hpp(+49 -0)📝
src/core/mtp.cpp(+15 -1)📝
src/core/verify.cpp(+39 -16)📝
src/program/generate.cpp(+83 -39)➕
tests/core/vision_records_test.cpp(+36 -0)➕
tests/cuda/mrope_slot_graph_test.cpp(+90 -0)➕
tools/batch_http_test.py(+189 -0)➕
tools/batch_mtp_split_test.py(+145 -0)📝
tools/batch_test.py(+229 -79)➕
tools/test_batch_test.py(+75 -0)📄 Description
This enables per-slot multi-token prediction (MTP) when the target model is split across CUDA GPUs. Previously,
--layer-split 24 --batch 4 --batch-mtpdisabled batch MTP and used ordinary batching. The enabled path verifies one proposal per slot through the stages serially, with--batch-groups 1, and commits the same accepted prefix on every stage.A slot drafter needs the target model's final residual and output head, which reside on the last GPU in a layer split. Slot drafters now bind that GPU's weights and head, retain their residual buffers and draft-KV copies there, and use the first stage's PLE history. Each target stage supports eight-row verification windows with bounded graph caching. Allocations, idle waits and cleanup select the GPU that owns the corresponding buffers. Shared draft-vocabulary metadata supports the top-two diagnostic.
This depends on #1242, which isolates concurrent slots' image positions and corrects shared draft-head metadata. That dependency is included in this main-based PR. The serial multi-GPU feature commit is
0de9365f18a2ddcc7e428cc70a639ffcdfcc3b55(7 files, 210 additions, 25 deletions), based on dependency commit8fc9490e9cb62e4d3c3ab5f09c1ca8d42f4a8623; validation used main82f46a8c8f475f001ad76d92f58f4a4f8ffb0253.Validation on Talos
CUDA 13 / GNU 13.3 Release build, 2× RTX 5090 32 GiB, Swift IQ3_XXS, native Q5_K head, 106299-token draft subset, 8K allocated context, split 24, visible device order 1 then 0, 3 GiB reserve per GPU. Exactness controls:
STRATA_IQ_MT_MIN=1 --pcie-frac 0 --adapt-every 1000000 --no-prefill-borrow. Requests generated up to 64 tokens; long prompt 1210 tokens. Independent review covered this serial implementation and its validation evidence.--mtp-q4 head,STRATA_MTP_TOP2=1Speculative runs were checked for grouped-row captures and no disabled-option warning; lifecycle logs prove cache and turn-checkpoint restore paths ran.
Performance and limits
Four fixed prompts, 64 tokens each, same binary/settings, 3 repetitions per batch mode/profile. Rates below are median tokens/s. Normal MTP solo controls ran in each invocation; its rates separate decode from prompt reading. Batch overall includes admissions; the second batch rate starts at the first batch token and still includes overlapping admissions.
Batch MTP was slower than ordinary pipelined batching in both measured profiles. It adds opt-in compatibility for split models; the default is unchanged. These 64-token measurements do not establish long-context or sustained server-load performance.
Explicit fallbacks remain for
--batch-groups > 1, same-device split stages, helper caches, remote expert optimization and peer devices.--pipeline-windowsremains off with batch slots. Validated scope is two CUDA GPUs and the existing model/runtime above. HIP, more than two GPUs, more than five slots, worst-case context/memory pressure, other model formats and speculative pipeline groups are unrun. The existing idle split BYIELD path is outside this validation; the new harness checks supported staggered admission. Penalty sampling and coupled draft sampling were not validated.With a compatible two-GPU model config, the included tools reproduce rotating batches and lifecycle checks:
Mixed-image/performance harnesses, exact local command records and logs are retained separately in the validation bundle.
Longer-run exactness investigation
A separate experimental implementation overlaps speculative slot groups across the GPU stages. Its 32-request workload at concurrency 4 and 512 generated tokens per request produced intermittent exact-token mismatches, including with overlap disabled while retaining the experiment's private verifier/drafter structure. Its benchmark matrix is paused. The cause and whether the published serial implementation is affected remain unresolved; the scoped results above do not establish long-run exactness for that experiment.
The existing QFUSE activation-quantization issue (#1139) was investigated as a possible explanation: batched GDN can consume stale quantized activations when
STRATA_QFUSE=1. The QFUSE correction in the concurrent-generation PR (#1209) addresses that path, with runtime validation reported on gfx1151. The Talos CUDA diagnostic configurations leave QFUSE disabled, so this specific mechanism is inactive there. Other underlying causes remain under investigation.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.