Adaptive overlap: tell each layer's landing with a stream-ordered copy into pinned memory, not a host function

The per-layer host function made the overlap depend on the driver's callback thread being scheduled: with the pool's
workers spinning on every other CPU it still cost 7 ms per window on a 20-core desktop even with the thread on all CPUs
(RTX 3060, Core Ultra 7 265: 46.5 tok/s with the warmed callbacks against 56.5 with the overlap off). The copy stream now
ends each layer's copies with a 4-byte device-to-host copy of the layer number into a pinned int the gate polls; same stream
order, no host thread. STRATA_ADAPT_SIGNAL=host brings the host functions back. Swaps, residency and answers are unchanged.
This commit is contained in:
Niko1221 committed 2026-10-11 23:00:41 +02:00
1 parent 0e20d9aee9
commit 25e0a2ef79
3 files changed
+29 -3

No files matched your search

+1 -1
View File
@@ -2120,7 +2120,7 @@ void Verifier::accumulate_profile(const unsigned long long* stamps) {
bool Verifier::adapt_gate_wait(int32_t layer, std::string& err) {
const Clock::time_point t0 = Clock::now();
uint32_t spins = 0;
while (adapt_gate_->landed.load(std::memory_order_acquire) < layer) {
while (adapt_gate_->reached() < layer) {
_mm_pause();
if ((++spins & 1023u) != 0) continue;
if (Clock::now() - t0 > std::chrono::seconds(20)) {