Conversation
Adapt the positional I/O and cache reservation design from ggml-org#25294, with lease-based in-flight safety informed by ggml-org#27861. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Stop aligned reads once the complete expert payload is available and make buffered fallback explicit opt-in so page-cache growth cannot bypass the production memory budget. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Report direct I/O unavailable until the Windows file path supports FILE_FLAG_NO_BUFFERING, and cover strict failure plus explicit buffered opt-in. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adapt the positional I/O and cache reservation design from ggml-org#25294, with lease-based in-flight safety informed by ggml-org#27861. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Stop aligned reads once the complete expert payload is available and make buffered fallback explicit opt-in so page-cache growth cannot bypass the production memory budget. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Report direct I/O unavailable until the Windows file path supports FILE_FLAG_NO_BUFFERING, and cover strict failure plus explicit buffered opt-in. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge the current schema branch and preserve the expert-store source registration in the new core source list. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
4 tasks
Preserve bounded expert execution across the attention/Engram restack and fix failure-safe remapping, Grovemoe lookup IDs, and lease release ordering. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge the updated schema support branch with the normal-RoPE classification needed by the shared model loader. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Retain bounded expert execution safety fixes and select cache buffers using the native quantized MUL_MAT_ID operation. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ajaxdude
marked this pull request as ready for review
September 14, 2026 01:37
Merge the current schema support branch before final expert-store review and validation. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Load contexts that cross disk-owned holes without mmap, discard copied source pages where supported, preserve mlock for safe mapped spans, and make lease publication allocation-safe. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use random file advice when disk-owned tensor ranges are excluded so Linux readahead cannot cross into the expert corpus. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep lazy-table prefetch behavior unchanged, but give external routed tensors a strict policy that disables positive prefetch ranges on every platform. Assisted-by: GPT-5.6 Sol Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Throw before mmap when POSIX_FADV_RANDOM cannot be applied to an external-hole file. Keep legacy sequential advice warning-only and cover both paths through an injectable constructor seam. This successor binds corrective commits 9b53142 and c1a00d2, including c1 tree 56460c3. Assisted-by: GPT-5.6 Sol Copilot-Session: 6df503f4-c9eb-436d-a324-e8c5f8cabed9 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ajaxdude
marked this pull request as draft
September 14, 2026 08:33
Binds rejected provenance parent 3089e0a and its unchanged tree 8c87d1f. The parent reconciles merge commit b18148f with accepted expert-store head f8d537e. The merge ancestry contains accepted Engram runtime head 0fa6b96. Assisted-by: GPT-5.6 Sol Copilot-Session: 9d10038c-5360-458f-b024-26761335c596 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Prepare every allocating remap and pin-tracking vector before changing slot pin counts. Publish the prepared state with moves so allocation failure cannot leak an untracked pin or reduce cache capacity. Add an injected allocation-failure regression that replaces the sole slot after the failed publication. Assisted-by: GPT-5.6 Sol Copilot-Session: 9d10038c-5360-458f-b024-26761335c596 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Own async upload buffers, events, and the upload backend for the full load scope. Clean partial setup immediately and synchronize/free all resources on cancellation, exceptions, and normal completion. Assisted-by: GPT-5.6 Sol Copilot-Session: 9d10038c-5360-458f-b024-26761335c596 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build_moe_ffn()reduction order; this does not port or enable wave-prefill--expert-cache-slotsand--expert-cache-mib; the DeepSeek V4.1 production path requires strict direct I/O and never selects buffered modeMUL_MAT_IDoperationExecution design
A CPU-pinned remap node observes selected original IDs, acquires the deduplicated gate/up/down union atomically, stages complete native payloads into fixed slots, uploads every plane, and publishes the original-ID-to-slot mapping only after all work succeeds. The existing MoE graph keeps original IDs for routing and passes slot IDs only to
ggml_mul_mat_id. The completion dependency releases each layer lease only after the final expert backend work completes.Callback failures publish in-range slot zero as a temporary sentinel, never
-1, so already-queuedMUL_MAT_IDnodes cannot index outside the cache tensors. The original error remains recorded; evaluation synchronizes the graph, reports failure, and then releases leases. Reads complete before any resident eviction, and pin publication reserves all required storage before incrementing pins, so short reads, upload failures, and allocation failures cannot publish partial slots.Grovemoe keeps full expert IDs for probability gathers and derives chunk-local IDs only for tensor lookup. Shared and dense experts remain on the ordinary path. Gate/up remain IQ2_XXS and down remains Q2_K; no dequantization or GGUF change is introduced.
The remap design follows ggml-org#25294 commit
4260e4608; lease safety follows ggml-org#27861 commitbccbacdb8. The implementation reuses the accepted expert-store core from #4.Stack and reconciliation
0fa6b96b2b647500e6033eb28ceebdcbdb40d89f, treeab683c8b7f6fc0e0636bcb5d18123da5571bec3a.f8d537e3642eb03539c5e840a929e86a76dde134, parent8805ae2d415e2ecc155a105659a9d49072550807, treea85d80bc4356981a9e5da1ab236f766961d082dc.b18148f1a4b5f0a1bd1764bbe4af4694ca24ff8a, treeaee2d1db0b2839ccc1ef912927c64f06f88d96b7, parentsc4bab9a74c37ded9ef5b92eda4e81d3ed2ed797fand0fa6b96b2b647500e6033eb28ceebdcbdb40d89f.3089e0a6ba13c536d2e02d56461fd8deb18b661d, tree8c87d1f970caa80d84c89b7a7005d98094b0a1bf, parentsb18148f1a4b5f0a1bd1764bbe4af4694ca24ff8aandf8d537e3642eb03539c5e840a929e86a76dde134, is provenance-ineligible because it andb18148f1a4b5f0a1bd1764bbe4af4694ca24ff8alackCopilot-Session.f5626396d04804ad309b07670e91b6c313fc1057, tree8c87d1f970caa80d84c89b7a7005d98094b0a1bf, parent3089e0a6ba13c536d2e02d56461fd8deb18b661d, is preserved but technically superseded after review found allocation-unsafe pin publication in its unchanged tree.6bdd97133e1209c2aa761b7e11ebb76da31828ac, tree412a656b787d7f9bcff41fd4dd45d6f7f4889df9, parentf5626396d04804ad309b07670e91b6c313fc1057, is preserved but superseded after exact review found async staging resources were not released on cancellation, partial setup, or exceptions.83024f92db6b344b55f75103c43507788d853b0a, tree4f051a9422f9c8db90100fc7883efd29c71cf6f0, parent6bdd97133e1209c2aa761b7e11ebb76da31828ac. It has parsedAssisted-by,Copilot-Session, andCo-authored-bytrailers. No predecessor review or hosted check transfers.c4bab9a74c37ded9ef5b92eda4e81d3ed2ed797f: 14 files, 344 insertions, 67 deletions; binary diff SHA-256cf8aa667432fd9fc827ebea369084654be030aa8a2d428db6cb523a4010741c5; stable patch-idbe4a28ec1ee36a02781c4b1765c81ba79dfe5682.f5626396d04804ad309b07670e91b6c313fc1057to6bdd97133e1209c2aa761b7e11ebb76da31828ac: binary diff SHA-256322b15961771fb68c3d4c2eb6cf971a68f7ea175a134be13e4df9df762afba25; stable patch-id3ec88c433234923912412f8d499ec66f411ea041.6bdd97133e1209c2aa761b7e11ebb76da31828ac: binary diff SHA-256771728378f0deb91b2b20da762799cbcd72ffc89c590c4ac36fcef03c56f6ca6; stable patch-idb87015a3be19342f3a6a1de7900a2fb3d202ec1e.The PR #4 exact-head acceptance was recorded for reviewer
final-expert-reviewagent7dd1c30d-9427-4f56-a850-ac419d2c7426, Turn 2, with no blockers. Two later-created local custody artifacts corroborate that disposition:expert-store-final-review.txt: SHA-256a53e97a70958e22f6c58b8f1d6102f5f20144d30e8b982048c94528aef4bb01e, size 1113, mode 0444.pr4-f8d537e-review-transcript.md: SHA-256becea28e7bc59a5f6402ca2331466591b753bed067359d072f5e2c7fba833870, size 4418, mode 0444.These artifacts are local, unsigned, non-append-proof custodian preservations. Neither is an authenticated raw Turn 2 transcript, and the original background-agent context was unavailable.
Local validation
Passed on exact head
83024f92db6b344b55f75103c43507788d853b0a, tree4f051a9422f9c8db90100fc7883efd29c71cf6f0, on macOS with CPU, Accelerate, Metal, and mock paths where applicable:test-deepseek41-schematest-deepseek41-engramtest-deepseek41-experttest-deepseek41-runtimetest-engramtest-expert-storetest-arg-parsertest-llama-archs -a grovemoetest-llama-archs -a qwen4expgit diff --checkThe model-free expert coverage includes all 120 routed tensor registrations, exact plane extents and offsets, duplicate IDs and multi-token unions, original-ID/slot-ID separation, exact native upload bytes, over-capacity rejection before graph execution, failed read/upload atomicity, real
MUL_MAT_IDexecution after injected callback failure, lease pinning through simulated backend completion, deterministic eviction, Grovemoe lookup separation, shared-expert exclusion, strict external-hole advice policy, allocation-failure rollback without leaked pins, and explicit cache configuration gates. A focused review found that vector allocation after incrementing a logical slot pin could leak an untracked pin and permanently reduce cache capacity. Head6bdd97133e1209c2aa761b7e11ebb76da31828acprepares all allocating pin/remap/active vectors before pin mutation, publishes them with moves, and adds an injectedstd::bad_allocregression proving the sole slot remains replaceable. Its exact review then found raw async staging buffers, events, and the upload backend could leak on cancellation, partial setup, or exceptions. Head83024f92db6b344b55f75103c43507788d853b0ascopes those resources under deterministic cleanup, preserves event-buffer-backend teardown order, and cleans partial setup before synchronous fallback. Reviews and hosted checks for predecessors are superseded and non-transferable. Fresh exact-head reviewer57bd532f-ba1f-41c5-a85e-36c7136f33abreturned ACCEPT at 97% confidence for83024f92db6b344b55f75103c43507788d853b0a, including partial setup, cancellation after staging begins, exception unwind, normal cleanup, synchronization/free ordering, and double-reset safety. The local read-only custodian artifact is SHA-256acd39a8dc8c87468f24994a7c1909748dcd4b890ab786d6f668bbda31da6881b, size 1102, mode 0444; it is later-created, local, unsigned, and non-append-proof, not a raw signed transcript. Exact-head hosted labeler, Ubuntu, and Windows checks passed. Python type-check did not trigger for the final C++-only descendant; the local Python schema suite passed.The generic architecture harness still intentionally skips DeepSeek41 published-model construction, so no DeepSeek41
no_allocarchitecture result is claimed. That downstream enablement is outside this PR.Unverified and incomplete
Written by GPT-5.6 Sol. Local tests were run on an Apple M5; no performance claim is made.