STRATA_TRACE: the prompt chunk line carries its stage range and elapsed ms

Same diagnostic as the request-step timestamps: with a layer split the chunk
line now says which stage is starting a chunk and when, so a prompt's stage
overlap can be read off the log.  STRATA_TRACE only; no behaviour change.

Measured with it on z440 (Q2_0, split 24, 16,383-token prompt): serial reads
run stage 0's two 8,192-token chunks 3,332 ms apart and the whole read takes
8,788 ms; --prefill-pipe 1500 reads four 4,096-token chunks 1,582 ms apart and
the read takes 8,375 ms, so the stages overlap only partially at best.
This commit is contained in:
Niko1221 committed 2026-10-25 20:15:58 +01:00
1 parent 91d4d7ff86
commit 14d076ee2e
1 file changed
+9 -1
+9 -1
View File
@@ -2717,7 +2717,15 @@ bool Prefill::run_impl(const int64_t* tokens, int64_t n, int64_t pos0, std::stri
stopped_at_ = c0;
break;
}
if (std::getenv("STRATA_TRACE")) { std::fprintf(stderr, "strata trace: prompt chunk %lld of %lld\n", (long long) c0, (long long) n); std::fflush(stderr); }
if (std::getenv("STRATA_TRACE")) {
static thread_local Clock::time_point t0;
static thread_local bool set = false;
if (!set) { t0 = Clock::now(); set = true; }
const double ms = std::chrono::duration<double, std::milli>(Clock::now() - t0).count();
std::fprintf(stderr, "strata trace: prompt chunk %lld of %lld stage [%lld,%lld) %.1f ms\n", (long long) c0,
(long long) n, (long long) stage_lb_, (long long) stage_le_, ms);
std::fflush(stderr);
}
const int64_t T = std::min(C, n - c0), p0 = pos0 + c0;
core::progress_at("reading the prompt (batched): preparing the chunk from token", p0); // #251
#if defined(STRATA_HAVE_DFLASH2)