arena: pin by need - blob_at (the async tier's source) follows the padded layout; no padded layout with a shared arena file (one layout for every process)

This commit is contained in:
Niko1221 committed 2026-10-13 14:53:19 +02:00
1 parent ab6bce05de
commit 55e1283174
1 file changed
+2 -2
+2 -2
View File
@@ -4598,7 +4598,7 @@ bool ArenaExpertSource::open(const std::string& pack_dir, int64_t n_layers, int6
// writes experts.bin from the arena). The file offsets (loff) stay packed; only the destination moves.
padded_ = false;
pad_ = PadMap{};
if (pin_by_need_ && !pin_pairs_.empty() && !arena_mmap) {
if (pin_by_need_ && !pin_pairs_.empty() && !arena_mmap && shared_arena_file.empty()) { // (a shared arena file has one layout for every process: the packed one)
padded_ = true;
uint64_t at = 0;
for (int64_t l = 0; l < n_layers; ++l) {
@@ -4905,7 +4905,7 @@ const uint8_t* ArenaExpertSource::blob_at(int64_t layer, int64_t expert) const {
if (base_ == nullptr || layer < 0 || expert < 0 || expert >= n_expert_) return nullptr;
const int64_t idx = layer * n_expert_ + expert;
if (idx < 0 || idx >= blobs_) return nullptr;
return base_ + strata::kernels::cpu::expert_layout().blob_offset(layer, expert);
return base_ + arena_off(layer, expert); // (the padded layout of pin by need too)
}
} // namespace strata::core