Repository navigation
Studio: size and offload both Inkling 2 looped GGUF layouts - #18754
Merged
Merged
Conversation
…lots The inkling2_loop layout keeps each physical layer once and lets llama.cpp expand the looped core to one cache slot per visit. Read loop.start, loop.end and loop.count, expand block_count and the per-layer arrays to those slots, and give the layout the same relative-bias compute estimate as inkling2, so both GGUF layouts of one model get the same KV and compute estimates.
llama.cpp counts -ngl, -ts and --n-cpu-moe for looped models in physical layers (llama_model_n_layer_weights), 24 for Inkling-2-Mini on both GGUF layouts, while KV and recurrent state stay per cache slot (48). - llama_cpp: read the visit-indexed loop keys (loop.core_start/core_end, num_loops) and keep a separate _n_weight_layers; n_layers, n_moe_layers, the pipeline-parallel predicate and the output-row device use it, KV sizing keeps the slots. - gguf_metadata: the staged layer_count drops the repeat passes of a visit-indexed loop core, so the gpu-layers ceiling is 24. - routes: runtime layer_count follows the physical layers. - offload_layout: looped layouts list the physical layers as rows, record the physical row of each cache slot and price KV per slot from per-layer head counts; the per-device split and the tensor spill fold slot caches onto their rows. Non-looped architectures, including inkling2 without loop keys, are unchanged.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
1 of 5 tasks
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 21, 2026
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.
Inkling-2-Mini GGUFs come in two layouts: the looped
inkling2files (one block per layer visit, 48 visits) and theinkling2_loopfiles (24 physical layers, loop core expanded to cache slots at load). The next llama.cpp prebuilt loads both through one implementation. This makes Studio size and offload both the same way.inkling2_loopgets the same relative-bias compute buffer estimate asinkling2.-ngl, the gpu-layers ceiling and the offload layout count physical layers (24), the unit llama.cpp uses for looped models (-ngl,-tsand--n-cpu-moe). Each cache slot's KV is placed with its physical layer.inkling2without loop keys, are unchanged.Tests:
tests/test_inkling2_loop_layout.py: both layouts plus a non-looped control (slot count 48, physical count 24,-nglcut-off, UI ceiling, offload rows and slot order, matching KV pricing between layouts, per-device fold).Screenshots
Run settings for Inkling-2-Mini UD-IQ1_S in both layouts, base (left) vs this PR (right). The GPU Layers maximum for the root file drops from 49 to 25, matching the 24 physical layers llama.cpp counts for
-ngl. The mainline file now gets the same KV estimate as the root file, since both allocate 48 cache slots.