[PR #100] [CLOSED] fix: honor native per-layer layouts in file-backed expert loading #2455

Closed
opened 2026-11-04 02:00:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/100
Author: @midhatn
Created: 9/29/2026
Status: ❌ Closed

Base: main ← Head: fix/native-mmap-layout


📝 Commits (1)

  • b758e8f fix: honor native per-layer layouts in file-backed expert loading

📊 Changes

4 files changed (+107 additions, -7 deletions)

View changed files

📝 CMakeLists.txt (+5 -0)
📝 include/strata/core/expert_source.hpp (+3 -1)
📝 src/core/expert_source.cpp (+39 -6)
➕ src/core/native_mmap_test.cpp (+60 -0)

📄 Description

Native expert packs can have different blob sizes in different layers. FileExpertSource still sizes experts.bin and addresses every blob using the canonical fixed stride, so --mmap-experts rejects these native packs or uses the wrong layout.

This uses the already-loaded native layout's per-layer offsets, strides and total size. It validates geometry and extents, retains the canonical path, and unmaps the actual mapping length on POSIX. The pinned-arena path is unchanged.

Validation on Windows/MSVC, against current main (c1e9033, v0.1.20):

  • Built the engine and native_mmap_test.
  • The regression fails against the unmodified loader at native mapping opens, and passes with this patch.
  • Covers mixed native layer strides, every byte of each fixture blob, axis bounds, geometry mismatch, truncated files, close, and canonical compatibility.

This is a loader correctness fix, not a throughput claim. The POSIX path has not been run locally. It is related to #80's memory goal, but does not add tiering or change its policy; keeping native file addressing correct should be useful independently.

Reproduce with a CUDA-enabled build: build target native_mmap_test, then run the resulting executable. It uses synthetic files and requires no model download.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/100 **Author:** [@midhatn](https://github.com/midhatn) **Created:** 9/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/native-mmap-layout` --- ### 📝 Commits (1) - [`b758e8f`](https://github.com/Niko1221/Strata/commit/b758e8f63a175d3aa570317ec98dec9e26a0ef0d) fix: honor native per-layer layouts in file-backed expert loading ### 📊 Changes **4 files changed** (+107 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+5 -0) 📝 `include/strata/core/expert_source.hpp` (+3 -1) 📝 `src/core/expert_source.cpp` (+39 -6) ➕ `src/core/native_mmap_test.cpp` (+60 -0) </details> ### 📄 Description Native expert packs can have different blob sizes in different layers. `FileExpertSource` still sizes `experts.bin` and addresses every blob using the canonical fixed stride, so `--mmap-experts` rejects these native packs or uses the wrong layout. This uses the already-loaded native layout's per-layer offsets, strides and total size. It validates geometry and extents, retains the canonical path, and unmaps the actual mapping length on POSIX. The pinned-arena path is unchanged. Validation on Windows/MSVC, against current main (`c1e9033`, v0.1.20): - Built the engine and `native_mmap_test`. - The regression fails against the unmodified loader at `native mapping opens`, and passes with this patch. - Covers mixed native layer strides, every byte of each fixture blob, axis bounds, geometry mismatch, truncated files, close, and canonical compatibility. This is a loader correctness fix, not a throughput claim. The POSIX path has not been run locally. It is related to #80's memory goal, but does not add tiering or change its policy; keeping native file addressing correct should be useful independently. Reproduce with a CUDA-enabled build: build target `native_mmap_test`, then run the resulting executable. It uses synthetic files and requires no model download. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2455
No description provided.