prefill: the resident lookup in the streamed walk indexes by the model's expert count (#531 follow-up)

#531's peer-aware lookup indexed the residency table with the 512-expert constant NE instead of the model's own
count. The Coder has 256 experts per layer, so from its second layer a resident expert was looked up in the wrong row,
and a prompt long enough for the streamed walk stopped with "an expert is neither resident, streamed nor on the peer"
(found by the 57K real-use check). The 512-expert models index the same row as before.
This commit is contained in:
Niko1221 committed 2026-10-02 23:47:59 +02:00
1 parent cb5cfb7a09
commit 69f4d94801
1 file changed
+2 -2
+2 -2
View File
@@ -2521,8 +2521,8 @@ bool Prefill::run(const int64_t* tokens, int64_t n, int64_t pos0, std::string& e
consumed = ++k;
if (!group_gather || gg_nslots == 0) give_back(consumed); // its group was gathered
} else {
const bool r0 = m.host_res && m.cache && m.host_res[(size_t) l * NE + e] >= 0;
const uint8_t* bp = r0 ? m.cache->device_slot(m.host_res[(size_t) l * NE + e])
const bool r0 = m.host_res && m.cache && m.host_res[(size_t) l * m.g->n_expert + e] >= 0;
const uint8_t* bp = r0 ? m.cache->device_slot(m.host_res[(size_t) l * m.g->n_expert + e])
: (m.pp ? m.pp->peer->slot_ptr(l, e) : nullptr); // over the cap: P2P
if (bp == nullptr) { err = "prefill: an expert is neither resident, streamed nor on the peer"; return false; }
++stats_.experts_resident;