PcieAuto: start the PCIe share from the pool size (min(65, 4 GB/s per worker) through the refinement's own formula) instead of the link-only 0.55, so the first answers after a launch do not run ~50 windows at a share the machine does not want; the converged share is unchanged, STRATA_PCIE_START=old keeps the old start

This commit is contained in:
Niko1221 committed 2026-10-31 18:10:43 +01:00
1 parent 3e2598a835
commit 06ebf2e4d6
1 file changed
+15
+15
View File
@@ -11161,6 +11161,21 @@ int main(int argc, char** argv) {
strata::core::FileExpertSource* src;
~FsDetach() { la->set_foresight(nullptr); src->set_foresight_swap(nullptr); }
} fs_detach{&lookahead, &src};
// 0.2.9.1 (BW-MEASURE E26): PcieAuto starts from the pool size instead of the link-only 0.55 (0.15 on gfx12), so the first answers after a launch
// do not run ~50 windows at a share the machine does not want. The pool's expert-byte rate R is assumed to be min(65, 4.0 GB/s per worker)
// (measured: 31-35 GB/s at 6-8 workers, 47-52 at 12, 55-60 at 16-30, 73-75 at 32) and the share is the refinement's own formula, link / (link +
// 1.85 R) rounded to 0.05 and clamped 0.10..0.60, so a weak CPU starts HIGH (4 workers 0.50, 2 workers 0.60). The converged share is unchanged.
// STRATA_PCIE_START=old keeps the link-only start. First answer on an RTX PRO 5000 mimic (32 workers): +4..+12%; 8 workers and the R9700: +-1%.
if (o.pcie_frac_auto && o.pcie_probe_gbps > 0.0) {
const char* ps = std::getenv("STRATA_PCIE_START");
if (ps == nullptr || std::strcmp(ps, "old") != 0) {
const double r = std::min(65.0, 4.0 * (double) pool.workers());
const double f0 = std::min(0.60, std::max(0.10, std::round(o.pcie_probe_gbps / (o.pcie_probe_gbps + PcieAuto::kPoolFactor * r) * 20.0) / 20.0));
std::fprintf(stderr, "strata serve: PCIe share: start %.2f from %d pool workers (assumed %.0f GB/s of expert bytes) and the %.1f GB/s link (was %.2f)\n",
f0, pool.workers(), r, o.pcie_probe_gbps, o.pcie_frac);
o.pcie_frac = f0;
}
}
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; });