layer split overlap: off beside --pipeline-windows (#859)

--pipeline-windows runs its own overlapped decode loop with its own hand-offs, so
STRATA_SPLIT_OVERLAP now switches itself off when it is set (one log line says so).

Rebased onto main 1735d64: the early launch of the next stage keeps #871's graph
variant (the next stage's refresh_ar() runs before its capture and prelaunch, and
not again in its run() when it was prelaunched), resets the plan error word like
run()'s launch, and the chain path checks that word after its sync as well.
This commit is contained in:
bsvinay authored and Niko1221 committed 2026-10-14 12:26:10 +02:00
1 parent 090b8e9f13
commit cbc1578a2f
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -207,7 +207,7 @@ flag: the earlier stage's GPU writes the hand-off with volatile stores and raise
next stage's graph is staged and launched on a helper thread while the earlier stage is still running and waits for
the flag on its GPU (`wait_flag_ge`), and the host goes straight from serving one stage's layers to the next, syncing
the earlier stage only once the chain is done. It takes one stream sync and one graph launch per window off the
critical path. Batch windows (several conversations) keep the serial order.
critical path. Batch windows (several conversations) keep the serial order. It is off beside `--pipeline-windows`, whose loop overlaps the stages its own way.
Measured on 2x RX 7900 XTX (gfx1100, ROCm, Linux), Ryzen 9 9900X, 52 GB RAM, Swift 1.5 IQ3_XXS, 128K context, 8-bit
KV, layers 0-25 / 26-47; 512-token greedy answers, median of 8 runs:
+6 -1
View File
@@ -7836,10 +7836,15 @@ int main(int argc, char** argv) {
// STRATA_SPLIT_OVERLAP=1 (opt-in; measured on 2x RX 7900 XTX only): a ready word per hand-off, raised by the
// writing stage's GPU, so the next stage's window is launched early and the host never syncs between
// stages (Verifier::set_handoff_flags). Not for --split-device 0 (both stages on one GPU).
const bool overlap = !split_same && [] {
const bool overlap_asked = [] {
const char* v = std::getenv("STRATA_SPLIT_OVERLAP");
return v != nullptr && std::atoi(v) != 0;
}();
// --pipeline-windows (#859) runs its own overlapped loop with its own hand-offs: the two do not mix
const bool overlap = overlap_asked && !split_same && o.pipeline_windows == 0;
if (overlap_asked && o.pipeline_windows > 0)
std::fprintf(stderr, "strata serve: STRATA_SPLIT_OVERLAP is off beside --pipeline-windows %d "
"(that loop overlaps the stages itself)\n", o.pipeline_windows);
std::vector<uint32_t*> hflag_h((size_t) n_stages - 1, nullptr), hflag_d((size_t) n_stages - 1, nullptr);
if (overlap)
for (size_t i = 0; i < hflag_h.size(); ++i) {