MCPcopy Create free account
hub / github.com/Niko1221/Strata / begin_layer

Method begin_layer

engine/src/core/expert_source.cpp:3835–3851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3833}
3834
3835void FileExpertSource::begin_layer(int64_t layer, const int32_t* ids, int64_t k) {
3836 (void) ids;
3837 (void) k;
3838 if (!staged()) return;
3839 bool new_window = false;
3840 {
3841 std::lock_guard<std::mutex> lk(stage_mu_);
3842 if (layer != last_layer_) {
3843 ++epoch_;
3844 new_window = layer < last_layer_;
3845 last_layer_ = layer;
3846 io_epoch_.store(epoch_, std::memory_order_relaxed); // 149-prefetch: the workers' deadline clock
3847 }
3848 }
3849 if (new_window && io_sched_) io_window_tick();
3850 if (new_window && gate_on_ && tl_decode) { gate_capacity(); gate_tick(); }
3851}
3852
3853bool FileExpertSource::transient(int64_t layer, int64_t expert) const {
3854 // the io-prefetch staging of the experts.bin tier is the decode's: the prompt path keeps reading the mapping

Callers 4

expert_pool_dispatchFunction · 0.45
arenaFunction · 0.45
test_io_prefetchFunction · 0.45

Calls 2

stagedFunction · 0.50
storeMethod · 0.45

Tested by 2

arenaFunction · 0.36
test_io_prefetchFunction · 0.36