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++

batch-mtp: log the accepted proposals in the batch summary

noon-at-cgn70fc0ba46d65
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index f6046aa22..e07686df3 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -8791,7 +8791,7 @@ int main(int argc, char** argv) {
double bt_run = 0, bt_commit = 0, bt_emit = 0;
double bt_wait0 = 0, bt_pool0 = 0;
int64_t bt_miss0 = 0, bt_hits0 = 0, bt_pcie0 = 0;
- int64_t bt_windows = 0, bt_rows = 0, bt_tokens = 0;
+ int64_t bt_windows = 0, bt_rows = 0, bt_tokens = 0, bt_accepted = 0; // bt_accepted: --batch-mtp proposals taken
Clock::time_point bt_start = Clock::now();
int admit_slot = -1; ///< the slot the request being read will continue in (BGEN)
long long admit_max_new = 0;
@@ -8956,7 +8956,10 @@ int main(int argc, char** argv) {
bt_run += msd(w0, w1);
bt_commit += msd(w1, w2);
++bt_windows;
- for (int a = 0; a < A; ++a) bt_rows += keep[active[a]];
+ for (int a = 0; a < A; ++a) {
+ bt_rows += keep[active[a]];
+ bt_accepted += keep[active[a]] - 1;
+ }
for (int t = 0; t < A; ++t) {
const int b = active[t];
BSlot& sl = bs[(size_t) b];
@@ -9014,8 +9017,12 @@ int main(int argc, char** argv) {
const std::string pr = (k == 0 ? ver : stages[k - 1]->ver).profile_report();
if (!pr.empty()) std::fprintf(stderr, "strata batch GPU stages, stage %zu (ms/window):%s\n", k + 1, pr.c_str());
}
+ if (batch_mtp) // each slot-window offers one proposal and yields 1 + (accepted) tokens
+ std::fprintf(stderr, "strata batch: MTP proposals accepted %lld of %lld (%.1f%%)\n",
+ (long long) bt_accepted, (long long) (bt_rows - bt_accepted),
+ 100.0 * (double) bt_accepted / (double) std::max<int64_t>(bt_rows - bt_accepted, 1));
bt_run = bt_commit = bt_emit = 0;
- bt_windows = bt_rows = bt_tokens = 0;
+ bt_windows = bt_rows = bt_tokens = bt_accepted = 0;
}
return true;
};