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++
[Engine] SYCL: the pipelined commit skips the graph for a one-token window
Niko122111d337537cea
diff --git a/sycl/src/core/verify.cpp b/sycl/src/core/verify.cppindex 51cdbcc3d..57e399e17 100644--- a/sycl/src/core/verify.cpp+++ b/sycl/src/core/verify.cpp@@ -3998,6 +3998,23 @@ bool Verifier::pl_commit_async(int n_keep, std::string &err) try {return false;}}+ // A one-token window advanced the GDN state itself (record_window), so the serial path's commit() skips the+ // commit graph for it. The pipelined path ran the graph anyway and advanced the state twice per+ // single-token window; the first decode window is always one token, so the two paths' GDN states were+ // equal after the prompt and different after that window (STRATA_PIPELINE_DUMP), and the tokens diverged+ // at the fourth. With this skip the pipelined windows are token-identical to the serial path.+ if (last_t_ == 1 && one_token_self_commit()) {+ h_commit_[0] = n_keep;+ h_commit_[1] = n_keep - 1;+ for (int t = 0; t < max_t_; ++t) h_commit_[2 + t] = t < n_keep ? (int32_t) (last_pos0_ + t) : -1;+ if (ple_stage())+ for (int t = 0; t < n_keep; ++t) {+ ss_->ple_prev[0] = ss_->ple_prev[1];+ ss_->ple_prev[1] = last_tokens_[t];+ }+ ms_commit += ms_since(t0);+ return true;+ }h_commit_[0] = n_keep;h_commit_[1] = n_keep - 1;for (int t = 0; t < max_t_; ++t) h_commit_[2 + t] = t < n_keep ? (int32_t) (last_pos0_ + t) : -1;diff --git a/sycl/src/program/generate.cpp b/sycl/src/program/generate.cppindex 10da48053..52eb10c58 100644--- a/sycl/src/program/generate.cpp+++ b/sycl/src/program/generate.cpp@@ -11771,6 +11771,31 @@ int main(int argc, char **argv) try {return 1;}// the window's first a + 1 tokens are in the session now (the last output is not: it is next x)+ // STRATA_PIPELINE_DUMP=<file>: the serial half of the pipelined window's state diff (see the same block+ // in the pipelined loop): the first stage's GDN state after every committed window.+ {+ static const char* sd = std::getenv("STRATA_PIPELINE_DUMP");+ if (sd != nullptr) {+ const int64_t gf = g.ssm_state_size * g.ssm_v_heads * g.ssm_state_size ++ g.ssm_conv_channels * (g.ssm_d_conv - 1);+ const size_t n = (size_t) ss.gdn_alloc * (size_t) gf;+ std::vector<float> h(n);+ (void) DPCT_CHECK_ERROR(ver.stream()->memcpy(h.data(), ss.gdn_state, n * sizeof(float)).wait());+ uint64_t hs = 1469598103934665603ull;+ double sum = 0.0;+ for (size_t i = 0; i < n; ++i) {+ uint64_t bb = 0;+ std::memcpy(&bb, &h[i], sizeof(float));+ hs = (hs ^ bb) * 1099511628211ull;+ sum += (double) h[i];+ }+ if (std::FILE* df = std::fopen(sd, "a")) {+ std::fprintf(df, "pos %lld serial gdn %zu sum %.9g hash %016llx\n", (long long) (p + a + 1), n,+ sum, (unsigned long long) hs);+ std::fclose(df);+ }+ }+ }for (int i = 0; i <= a; ++i) consumed.push_back(window[(size_t) i]);draft_offered += T - 1;draft_accepted += a;