mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3025] Tensor parallel (--tp 2) on 2× RTX 3080: patch attached, correct but not usable yet (~2 % of the layer split's prefill) — open for pickup #1212
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#1212
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?
Originally created by @ZeaMQ on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3025
Patch: branch
tp2-wip— https://github.com/ZeaMQ/Strata/tree/tp2-wip (heade771f5cb, on top of296b59d2, engine 0.1.44.1)Write-up:
docs/TP2-HANDOVER.md(English) /docs/TP2-HANDOVER.zh-CN.md(中文)If you want to pick it up, read The three steps I would try next first.
TP=2 (tensor parallel) is correct but slower than the layer split; its fast path is broken — handing over
I spent a long session adding
--tp 2to a CUDA build of 0.1.44.1 (296b59d2) on 2x RTX 3080 20 GB and I amposting this as a half-finished attempt rather than a PR, because the honest result is: it works, and it is
slower than what you already have.
Relation to #156
This follows up #156 ("support tensor parallelism for multi gpu setup"), closed 2026-09-30 as *not planned
for now: decode is limited by the experts, so tensor parallelism of the dense part gains little here*. I built
it to get the measurement that thread did not have, and the numbers support that decision: the correct TP
path lands at about 2 % of the layer split's prefill throughput (37–52 vs 2 114.8 tok/s), with host grouping
at 47.8 % of the TP prefill and the TP reduce at another 16.2 %. So please read this as evidence for closing
it, plus the two real bugs found on the way — not as a request to reopen it.
What happened
--tp 2with the prompt read through the two-rank verify windows is correct at every length I tried(108 / 3 458 / 6 856 / 14 060 prompt tokens, all read in full, no non-finite logits), and VRAM lands at
19 909 / 19 867 MiB, the same as the layer split on this pack.
But prompt throughput on that correct path is 37–52 tok/s, against 2 114.8 tok/s for the layer split
on the same machine, same pack, same day. Decode 43–58 tok/s against 99.3.
The fast path (one batched prefill,
STRATA_TP_FASTPROMPT=1) does reach 860–990 tok/s but producesnon-finite logits (#879)from the first QSA layer on, for any prompt larger than one KV page. So it shipsdisabled, with the windows as the TP default.
Strata version, GPU, OS
Strata 0.1.44.1, base commit
296b59d2(2026-10-14) · 2x RTX 3080 20 GB (PCIe 4.0 x8) + Quadro P1000for vision · Windows 11 (10.0.26200) · Ryzen 9 5900X, 80 GiB · CUDA source build.
Provenance: AI-assisted, not human-reviewed; the fast path below survived thirteen fix attempts unsolved.
This is a bug report with a patch attached, not a submission.
Engine log
Where I got to
Queries are fine (
qsa q(in)clean); the attention output is not, so the QSA layer reads wrong KV cells.The GDN block's own counts and state offsets are correct; the MoE non-finite is downstream.
page_sizeis 4 (not 64) andstaged=1— the prompt attention reads the staged pool withm.ident_table.I had assumed 64 for most of the session, which invalidated a dozen hypotheses.
Page-stride changes in both directions were tried and reverted: writer
page*2/ readerpage*1gives92 % non-finite, writer
page*1/ readerpage*1gives 100 % - so the write side is not the lever.Two real defects were found and fixed on the way: the QSA query stride (packed at
qh*256, read at themodel's 6144) and the expert-cache sizing (fixed 3/4 shrink threw away 1.83 GiB; that fix alone is what
puts the card at 19.44 GB).
STRATA_GDN_KEYHEAD=0is currently required in TP:gdn_rec_kh_kernelis not parameterised and stilluses the model's full HV/HK.
The three steps I would try next
Print
kv_append_kernel'srow_idfor the first 8 staged cells andprompt_attn_kernel'srfor the samecells, and diff them.
Dump
m.ident_table(prefill.cpp:1204) and confirmident[i] == i.Re-derive with
page_size == 4.What I did not test
CUDA only — no HIP or SYCL build (AGENTS.md asks for all three). One machine, one pack, one model. No
50K–100K measurement, no recall/needle suite, no bitwise single-card regression against
HEAD, no soak.Licence and prior art
Strata is MIT (c) 2026 Niko1221 and the Strata contributors; this report asserts no warranty and claims no
fitness. Model weights / native pack / expert profile are separate artifacts and are not included. No
credentials are included.
This work's tensor-parallel rules were written against llama.cpp / ggml, which Strata already carries as
a pinned, gitignored dependency (
third_party/,.gitignore:31). Both are verbatim MIT, copyright(c) 2023-2026 The ggml authors, and neither is redistributed with the source. Strata cites them inline with
file:line—shard.hppciteshandle_mul_mat:600-603,GGML_BACKEND_SPLIT_AXIS_PARTIAL:591-593and theqwen4exp shapes at
qwen4exp.cpp:242-247. If review finds a function that is an adaptation rather than areimplementation, the ggml notice goes beside it.
@ZeaMQ commented on GitHub (Oct 18, 2026):
Reopening as a handover note rather than an open request: what is left to do, and how to pick it up, is in the body above. Status: not usable yet — correct, ~2 % of the layer split's prefill, fast path broken.
@ZeaMQ commented on GitHub (Oct 19, 2026):
Update 2026-10-19: the fast-path defect is fixed —
ZeaMQ/Stratatp2-wip@7f55fd3.Root cause: the batched prompt path's K/V append (
kv_append_kernel) wrote the model's page stride (2 heads per page, plus the rank's global head offset) into pools that are allocated and read rank-locally (1 head per page at TP=2): the resident slots, the pinned host copy and the staging pool. Every row landed at twice the offset the readers used, past the pool's end for the rank's upper pages; the attention then read never-written INT8 rows, whose scale is 0 and the dequant divides by it — 0/0. The verify-window path never called that kernel, which is why it was always correct.Measured after the fix, same machine and config (
STRATA_TP_FASTPROMPT=1, warm expert cache): prompts of 2 803 / 5 533 / 11 176 tokens all read in full, no non-finite logits anywhere, 1 187 / 1 519 tok/s steady state (the first large prompt pays an ~86 s graph capture), decode ~90 tok/s;12*7answers 84 and the summarize/reasoning answers are coherent end to end.So the fast path is now usable — TP prefill is ~50–70 % of the layer split (2 114–2 900), not 2 %. The #156 rationale still stands: the MoE is replicated, every rank evaluates the full expert set, so TP does not pass the split and this stays a handover rather than a merge request. The handover doc gained a section 0 with the full root cause and the numbers; the 13-attempt search record is kept below it.
@ZeaMQ commented on GitHub (Oct 19, 2026):
Correction to my previous comment: the "~50–70 % of the layer split" figure compared different prompt lengths (TP at 11.8k vs the split at 36k) and was wrong.
Same documents through both paths on the same machine, warm expert cache,
max_tokens=1, client-side wall clock:The fixed fast path matches the layer split at every length measured; prefill rises with length on both paths (a ~1 s fixed per-request cost amortizes and the expert cache warms across chunks), so the author's 2900+ is the long-context end of the same curve, and the earlier short-prompt numbers (860–990 at 3.4k) were mid-ramp on both paths too.
nvidia-smi dmon -s tduring the 123.6k run: 4–7 GB/s mean per card (Rx+Tx) against ~22 GB/s peak bursts — PCIe is not saturated; the shared ceiling is the host-side expert pipeline (grouping + streaming). Decode: TP ~90 vs PP ~99 tok/s.One honest caveat stays:
--pool-workers 5reproduces the originalnon-finite (#879) at N-5on the fixed build (three runs in a row), while the default 11 workers is clean — a timing-dependent defect remains, documented in handover section 0a, not yet investigated. So: usable and at parity with the split on this box, but still a prototype, not human-reviewed, and Q4_0/K8V4/HIP/SYCL untested.@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.