From b884451697213990871bf454091aa7100e3efc18 Mon Sep 17 00:00:00 2001 From: mes Date: Wed, 14 Oct 2026 14:55:47 +0300 Subject: [PATCH] Layer split auto: STRATA_SPLIT_UNIFORM=1 restores the uniform miss cost 0.1.41 scaled each stage's miss term by its probed link (0391e478); 0.1.44 scales from a 4x gap against the fastest link (9d41e18b, #2007). On an x16+x4 dual-3090 rig (26.9 vs 6.4 GB/s, 4.2x) either rule moves auto off the balanced placement (K=27 -> K=19/K=31): decode -4..-8%, prefill +15..+19% at 10K / -6..-9% at 90K vs 0.1.40.x at matched calibration. Opt-in restore next to STRATA_SPLIT_LINK_ABS, default off. --- src/program/generate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 403fe931..62be0cff 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -4073,11 +4073,15 @@ int main(int argc, char** argv) { } // #2007: relative to the fastest stage's link and only from a 4x gap on (split_rules::link_miss_scale): a // symmetric rig, or a moderate gap, keeps the fitted formula. STRATA_SPLIT_LINK_ABS=1: 0.1.41's 20 GB/s rule. + // STRATA_SPLIT_UNIFORM=1: no per-link scaling at all (the pre-0.1.41 uniform miss cost), for A/B on links + // where any scaling moves auto off the balanced placement. static const bool link_abs = [] { const char* v = std::getenv("STRATA_SPLIT_LINK_ABS"); return v && v[0] == '1'; }(); + static const bool split_uniform = [] { const char* v = std::getenv("STRATA_SPLIT_UNIFORM"); return v && v[0] == '1'; }(); std::vector link_scale = strata::program::split_rules::link_miss_scale(link_gbps); for (int i = 0; i < ns; ++i) { const double bw = link_gbps[(size_t) i]; - if (link_abs) link_scale[(size_t) i] = bw > 0.0 ? std::clamp(20.0 / bw, 1.0, 64.0) : 1.0; + if (split_uniform) link_scale[(size_t) i] = 1.0; + else if (link_abs) link_scale[(size_t) i] = bw > 0.0 ? std::clamp(20.0 / bw, 1.0, 64.0) : 1.0; std::fprintf(stderr, "strata generate: layer split auto: CUDA%d link %.1f GB/s -> miss cost x%.2f\n", i == 0 ? 0 : stages[(size_t) i - 1]->dev, bw, link_scale[(size_t) i]); }