Repository navigation
[Other] setup: --custom-gguf accepts any Inkling 2 Mini GGUF (e.g. IQ4_NL) - #254
Draft
okada-shogo wants to merge 5 commits into
Draft
okada-shogo wants to merge 5 commits into
okada-shogo wants to merge 5 commits into
Conversation
Unsloth's files at the top of unsloth/Inkling-2-Mini-GGUF (UD-Q2_K_XL,
UD-IQ3_XXS, ...) say general.architecture inkling2. They are the same
weights as the Mainline_Support inkling2_loop files under other names:
block_count counts the 48 applications, the loop's keys are num_loops /
loop.core_start / loop.core_end, the controllers are loop_{attn,k,v,mlp}_*
(attn = q, mlp = ffn), and the message queries are two global tensors,
loop_res_query and loop_kv_res_query (core layer 6+i: q = res[2i],
k = kv[2i], v = kv[2i+1], ffn = res[2i+1]). Open() refused them.
Inkling2 now takes them: n_layer_ is block_count less the core's later
passes, meta_alias()/tensor_alias() give the other names (only for an
inkling2 file), each application's sliding_window_pattern entry is
checked against its layer, and msg_query() puts the four rows of a core
layer in the dense arena. inkling2_loop files run the same code as
before. Setup's --gguf-dir and serve's registry take the architecture.
The mapping is the one our first engine (simplexai-labs#200) used, by bytes against
ggml-org's inkling2_loop file. Engine by VecSzn; files by Unsloth.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Unsloth file's attention.sliding_window_pattern lists the 48 applications, not the 24 layers, but swa_[il] read entry il: for layers 18 to 23 that is an application of the loop's layers 6 to 11. It was right only because the pattern's period (6) divides the loop's length (12); with another pattern the check below would refuse a valid file. Read visit_of(il, 0) instead. The same values for the published files (period 6), so the same bits. Found by an independent review of the PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
okada-shogo
force-pushed
the
port/setup-custom-gguf-iq4
branch
from
November 23, 2026 04:20
5b217ef to
e1c5ceb
Compare
okada-shogo
marked this pull request as draft
November 23, 2026 04:22
The table's strata-poly rows are made from setup.py's POLY_GGUF_ARCHS (tools/strata_inspect.py --poly-rows), which now takes inkling2 too; tests/terminal/test_own_files_poly.py compares the two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
strata_inspect's POLY_ARCHS had no Inkling architecture, so its verdict for every Inkling 2 Mini file was "not Qwen3.8-Flash-Next" and resolve_custom_gguf refused it. With the architecture mapped, a quant setup does not offer would still have been taken for the first offered size (UD-Q2_K_XL). - POLY_ARCHS maps inkling2_loop and inkling2 (Unsloth's top-level layout, read by the engine since the previous commits) to "Inkling 2 Mini". - FAMILIES["inkling"] has "custom_sizes": a file of another quant (IQ4_NL, Q4_K_M, ...) becomes a size of its own, its experts' bytes and file size read from the header (custom_size()). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review of simplexai-labs#254: - For a family with custom_sizes the quant must equal a size's name: Q2_K was taken for UD-Q2_K_XL (its letters are inside that name), with that size's estimates instead of the file's own. - A ".loop" before ".gguf" (a file rewritten to inkling2_loop) is skipped when the quant is read: ...UD-Q2_K_XL.loop.gguf is UD-Q2_K_XL, not a size called "custom". - --inspect points an Inkling file to --custom-gguf, not --gguf-dir (which takes only the offered sizes' file names). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
okada-shogo
force-pushed
the
port/setup-custom-gguf-iq4
branch
from
November 23, 2026 04:28
e1c5ceb to
74f7a5f
Compare
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.
Stacked on #225 (
--custom-ggufsupport for Unsloth's top-level layout needs #225's engine change). Until #225 merges, this diff also shows #225's commits; its own change is the last commit(s).Problem and result
setup.py --custom-ggufrefused every Inkling 2 Mini GGUF, including the ones setup itself downloads, becausetools/strata_inspect.pydid not map Inkling's architectures to a family. A user with an IQ4_NL file had to hard-linkit under the published name
Inkling-2-Mini-UD-Q4_K_XL.ggufand use--gguf-dir --model UD-Q4_K_XLinstead.general.architecture)Inkling-2-Mini-IQ4_NL.gguf(inkling2_loop)IQ4_NL(its own)Inkling-2-Mini-UD-Q2_K_XL.gguf(inkling2, Unsloth top level)UD-Q2_K_XLInkling-2-Mini-UD-IQ3_XXS.gguf(inkling2)UD-IQ3_XXS(its own)Inkling-2-Mini-UD-Q2_K_XL.loop.gguf(inkling2_loop)UD-Q2_K_XLInkling-2-Mini-Q2_K.gguf(inkling2_loop, test only)Q2_K(its own, not UD-Q2_K_XL)Exact messages, before and after
Before (the top-level files say
'inkling2'):After,
Inkling-2-Mini-IQ4_NL.gguf:After,
Inkling-2-Mini-UD-Q2_K_XL.gguf(inkling2): no message, resolved to--family inkling --model UD-Q2_K_XL.After,
setup.py --inspect Inkling-2-Mini-IQ4_NL.gguf:Related discussion
none. Found while installing an IQ4_NL file on Windows. Needs #225 for the
inkling2files.Approach
POLY_ARCHSinstrata_inspect.pymapsinkling2_loopandinkling2(the architectures in setup'sPOLY_GGUF_ARCHS["inkling"]after [Engine] Inkling 2: read Unsloth's top-level inkling2 GGUF files #225) to "Inkling 2 Mini", soresolve_custom_gguf()reaches its "family" branch.UD-Q2_K_XL) and its estimates. For Inkling only (a
"custom_sizes"flag inFAMILIES["inkling"]), the quant mustequal a size's whole name (
Q2_Kis notUD-Q2_K_XL), a.loopbefore.ggufis skipped, and an unknown quantnow becomes a size of its own: experts' bytes and file size from the header, VRAM beside the experts from the
offered size with the closest expert bytes,
ram_gbcomputed the same way as for the offered sizes. Other familieskeep the old behaviour.
--inspectpoints an Inkling file to--custom-gguf(--gguf-dirtakes only the offered sizes' file names).docs/models/inkling.mdnames--custom-ggufbeside--gguf-dir.Validation
Passed: (revision 74f7a5f on #225's head 42af77e; Linux, CPU only, Python 3.10)
cd terminal && python -m unittestover alltools/test_setup*.py: 1364 tests OK (1 skipped). New tests intools/test_setup_custom_gguf.py: IQ4_NL as its own size, an offered name kept,Q2_Kas its own size,.loopnames, top-level
inkling2files taken, every architecture inPOLY_GGUF_ARCHS["inkling"]mapped inPOLY_ARCHS,--inspectnaming--custom-gguf.python -m unittest tools.test_strata_inspect: 7 OK.tests/terminal/test_own_files*.py: 34 OK.python3 tools/check --only docs: 6 of 6.resolve_custom_gguf()on the four real files in the table: the results shown there (andInkling-2-Mini-UD-IQ3_XXS.loop.gguf:UD-IQ3_XXS, the same estimates as its top-level file). Estimates for IQ4_NL: 15.80 GBof experts, 3.7 GB VRAM beside them, 21 GB RAM; for UD-IQ3_XXS: 10.30, 3.6, 16.
setup.py --custom-gguf Inkling-2-Mini-IQ4_NL.gguf --check(RTX 2070 Super 8 GB, 63 GB RAM): "Inkling 2 Mini IQ4_NL:EXPERIMENTAL, fits by setup's estimate (~21 GB of RAM on this card)".
main()with--custom-gguf Inkling-2-Mini-IQ4_NL.gguf --yes --no-start --context 32768, stopped at step 3 (pipinstall mocked): step 2 shows "about 5 of its 16 GB of experts fit this card" and "size: IQ4_NL".
Failed: none observed.
Not run:
size name for a
--custom-gguffile (no download, no SHA-256 check).Limits
custom.(
model: None, so a new copy is not "set up like the last one"). A plain start uses the config as it is. Every--custom-ggufinstall already behaves like this.--custom-ggufis not applied (setup_mac.py does not read it), as before.🤖 Generated with Claude Code