Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

Document the decode window profiler (STRATA_VERIFY_PROFILE + STRATA_DECODE_TIMING); --gpu-stages points to it on a native pack (#610)

Niko1221a74c61f60806
diff --git a/docs/DETAILS.md b/docs/DETAILS.md
index e2012813d..2374f2d92 100644
--- a/docs/DETAILS.md
+++ b/docs/DETAILS.md
@@ -178,6 +178,15 @@ Its `hit_rate` is the VRAM share of the experts looked up while answering: exper
(engine 0.1.39 or newer, #588) is their share of all routed experts, and the server log and the Monitor tab show it
beside the hit rate.
+**Where a decode window's time goes (profiling, #610):** start the server with `STRATA_DECODE_TIMING=1` (and
+`STRATA_VERIFY_PROFILE=1` for the GPU's side) in the environment. After each request the engine log then has one
+`strata decode timing:` line - windows, tokens per window, and per window the verify time split into the wait for the
+GPU, the CPU expert pool (plan, activation quantization, jobs) and the stage, plus commit and draft - and one
+`strata decode GPU stages (ms/window):` line with the GPU time of each stage (GDN and QSA layers, the VRAM expert
+hits, the router, the head, ...). The GPU profile times every stage with events, so it slows the decode a little:
+use it to compare, not to measure speed. This works with every pack; `--gpu-stages` (a one-token replay of
+per-layer graphs) refuses a native (IQ) pack, which has no such graphs.
+
Time to first token is prompt length / prompt speed: with Q2_0 about 4 s at 4K, 25 s at 32K, under 2 minutes at 128K
and 4.5 minutes at 262K (engine 0.1.13 made long prompts about twice as fast, below).
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index e1f049846..df49bdeab 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -3706,7 +3706,12 @@ int main(int argc, char** argv) {
strata::core::doorbell_reset(db);
double mix = 0, ffn = 0, post = 0;
if (!strata::core::session_replay_stages(g, 0, 0, ss, gr, main_cs, mix, ffn, post, err)) {
- std::fprintf(stderr, "strata generate: %s\n", err.c_str());
+ // #610: a native (IQ) pack captures no per-layer graphs; the serve path times its window's stages
+ std::fprintf(stderr, "strata generate: %s%s\n", err.c_str(),
+ native_pack ? " - a native (IQ) pack has no per-layer graphs to replay. Its decode window's GPU "
+ "stages are printed per request by the serve path instead: STRATA_VERIFY_PROFILE=1 "
+ "STRATA_DECODE_TIMING=1 with --serve (docs/DETAILS.md, \"Where a decode window's "
+ "time goes\")" : "");
return 1;
}
const int reps = 20;