prefill: scale the research switch-point rule per card

The floor from STRATA_SWITCH_POINT=1 now takes the cache mean blob, the
start-up link probe and the SM count (copy terms by blob / link, compute
terms by 1 / SM); the floor is the real crossing rounded down to the 256 grid,
and the CPU share limit of a card whose floor moved is floor x 1.6. An unknown
card (no probe) keeps 1,024. Research only, default off.
This commit is contained in:
Niko1221 committed 2026-11-13 02:29:07 +01:00
1 parent e84392acc0
commit d877f150a0
6 files changed
+220 -136

No files matched your search

+2 -2
View File
@@ -11002,7 +11002,7 @@ int main(int argc, char** argv) {
(long long) xcache.slots(), (long long) (g.n_layers * g.n_expert));
if (share_pool && stages.empty() && !multi_gpu && share_has_work && !share_default_ok()) share_has_work = false; // H11
if (stages.empty() && !multi_gpu && o.batch <= 0) // STRATA_SWITCH_POINT (research): one card, no batch slots; before any bytes_needed, like the share
strata::prefill::Prefill::set_card_expert_share((int64_t) xcache.slots(), (int64_t) (g.n_layers * g.n_expert));
strata::prefill::Prefill::set_card_expert_share((int64_t) xcache.slots(), (int64_t) (g.n_layers * g.n_expert), xcache.slots() > 0 ? (double) xcache.bytes() / (double) xcache.slots() / 1e6 : 0.0, o.pcie_probe_gbps);
strata::prefill::Prefill::arm_cpu_share(share_pool, share_pool && stages.empty() && !multi_gpu && share_has_work);
void* borrow = nullptr;
uint64_t borrow_bytes = 0;
@@ -20653,7 +20653,7 @@ int main(int argc, char** argv) {
int64_t spec_pos = strata::spec::kSpecNotStarted; // plan v0.3 P6: where the speculative loop starts (0 is a real position: a 1-token prompt on a native pack)
strata::prefill::Prefill prefill;
if (!multi_gpu && o.batch <= 0) // STRATA_SWITCH_POINT (research): before any bytes_needed, like the share
strata::prefill::Prefill::set_card_expert_share((int64_t) xcache.slots(), (int64_t) (g.n_layers * g.n_expert));
strata::prefill::Prefill::set_card_expert_share((int64_t) xcache.slots(), (int64_t) (g.n_layers * g.n_expert), xcache.slots() > 0 ? (double) xcache.bytes() / (double) xcache.slots() / 1e6 : 0.0, o.pcie_probe_gbps);
// #1595: not by default when the cache holds every expert (nothing to take)
strata::prefill::Prefill::arm_cpu_share(!multi_gpu && !o.no_pool,
!multi_gpu && !o.no_pool && o.batch <= 0 &&