spec: sizes not yet calibrated follow the sizes that are

A size that real requests reach rarely (the 4-row lookup: about one round per
request) stayed at its learned price for 16 requests while the sizes next to
it were already calibrated, and a price that is only a little lower than its
neighbours' flips a close choice (JSON decode 6 % slower than live costs).

The table file now keeps the learned costs on its bucket lines and the cost
of each real size on rc lines. A size with 2 or more rows that is not real yet
is priced at its learned cost x the mean of (real cost / learned cost) over
the real sizes of 2 or more rows, until it has its own 16 rounds (all sizes
scaled alike would change no choice). Nothing is scaled while no such size is
real. Unit test draft_policy_test: 147 of 147.
This commit is contained in:
Niko1221 committed 2026-11-13 03:58:17 +01:00
1 parent c3a861156d
commit d71da59b29
4 files changed
+126 -37

No files matched your search

+2 -2
View File
@@ -14568,7 +14568,7 @@ int main(int argc, char** argv) {
sizes += (sizes.empty() ? "" : ", ") + std::to_string(cf.tables[(size_t) k].size());
}
dc_file = cf;
policy.start_calibration(cf.state_effect, cf.real, cf.cal);
policy.start_calibration(cf.state_effect, cf.real, cf.cal, cf.real_cost);
dc_calib = policy.calibrating();
if (cf.cpu_share >= 0.0) strata::prefill::Prefill::fix_cpu_share(cf.cpu_share);
std::string extra = cf.cpu_share >= 0.0 ? "; CPU prompt share " + std::to_string(cf.cpu_share).substr(0, 4) : "";
@@ -20085,7 +20085,7 @@ int main(int argc, char** argv) {
policy.reset_learning();
dc_learning = false;
dc_file = cf;
policy.start_calibration(cf.state_effect, cf.real, cf.cal);
policy.start_calibration(cf.state_effect, cf.real, cf.cal, cf.real_cost);
dc_calib = policy.calibrating();
std::string t0;
char b[24];