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

HIP: STRATA_ROUTE_TAIL_SKIP=7 is the default on gfx1200/gfx1201 under the CUDA rules (#1884 cached-share line included); other AMD parts unchanged

Niko1221ad2aef7648ec
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index 52a209276..45276b245 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -8085,14 +8085,13 @@ int main(int argc, char** argv) {
drive.d.pcie_num = std::max(0, std::min(256, (int) (o.pcie_frac * 256.0 + 0.5)));
const bool all_experts_resident = !host_res.empty() &&
std::all_of(host_res.begin(), host_res.end(), [](int32_t r) { return r >= 0; });
- // STRATA_ROUTE_TAIL_SKIP: ON BY DEFAULT on CUDA builds (owner decision, 0.1.42): a missed expert that every token of
+ // STRATA_ROUTE_TAIL_SKIP: ON BY DEFAULT on CUDA builds (owner decision, 0.1.42) and on HIP gfx1200/gfx1201 (0.1.43): a missed expert that every token of
// a verify window routes at rank 7 or lower is neither copied nor computed (answers differ slightly from 0.1.41,
// KL ~0.003-0.006; docs/DETAILS.md). =0 restores 0.1.41's bytes. Nothing to do, so no default and no line, when every
// expert is in VRAM; off with --batch slots (a window then mixes requests, and one request's skip would depend on
// another's tokens) and, as in the dispatch, with a peer or helper GPU. A layer split is fine: each stage skips by itself.
{
const char* tse = std::getenv("STRATA_ROUTE_TAIL_SKIP");
-#if !defined(STRATA_USE_HIP)
// #1884: with nearly every expert in the GPU cache (V100 32 GB, Coder IQ1_M: 94.8% of the experts, 99.9% decode hits) the few
// misses are cheap and the skip costs more draft acceptance (70.1% -> 68.2%) than it saves: -1..2% decode. No default then.
size_t cached_experts = 0;
@@ -8103,14 +8102,12 @@ int main(int argc, char** argv) {
const bool nearly_all_cached = !host_res.empty() && !all_experts_resident &&
(double) cached_experts >= max_cached * (double) host_res.size();
const bool tail_default_ok = tse == nullptr && !all_experts_resident && !nearly_all_cached && o.batch == 0 &&
+ decode_defaults_arch_ok() &&
o.peer_device < 0;
- if (tse == nullptr && nearly_all_cached && o.batch == 0 && o.peer_device < 0)
+ if (tse == nullptr && nearly_all_cached && o.batch == 0 && o.peer_device < 0 && decode_defaults_arch_ok())
std::fprintf(stderr, "strata serve: STRATA_ROUTE_TAIL_SKIP is off by default: %.1f%% of the experts are in the GPU cache, so "
"few are missed and skipping them costs more draft acceptance than it saves; "
"STRATA_ROUTE_TAIL_SKIP=7 turns it on\n", 100.0 * (double) cached_experts / (double) host_res.size());
-#else
- const bool tail_default_ok = false; // HIP and SYCL stay as they were
-#endif
if (tail_default_ok) strata::core::set_tail_skip_rank(7);
if (strata::core::tail_skip_rank() > 0 && !all_experts_resident)
std::fprintf(stderr, "strata serve: STRATA_ROUTE_TAIL_SKIP=%d is ON%s: a missed expert that every token of a verify window routes at rank %d or "