Repository navigation
Accept dense JANGH gate and up banks in named mmap - #21
Conversation
The named-region mmap admitted one-expert dense JANGH banks only for down_proj (K2-Horizon). Qwen3.8-27B-JANGH2 is a dense qwen3_5 model whose MLP gate_proj, up_proj and down_proj are all jangtq2 banks, stored under the VLM prefix language_model.model.layers.N.mlp.*. Those names were rejected, so the bundle could not load. The dense pattern now accepts gate/up/down with an optional language_model. prefix. Layer indices still reject leading zeros and overflow, and routed experts keep their own pattern.
|
Merged as 5aba1ef. The merged tree is identical to tested head cda1b47. SOURCE EVIDENCE: LIVE EVIDENCE: fork CPU runtime contracts passed all 15 selected cases. Lint, Fedora aarch64/x86_64 and ASAN/UBSAN passed. Local macOS This proves the mapping contract; it does not claim full Osaurus model qualification, which continues in osaurus-ai/vmlx-swift#565. |
Change
Allow named mmap regions for dense JANGH gate/up/down projection banks, including the
language_model.prefix used by dense Qwen bundles. Previously those names were rejected while K2 down-projection names were accepted.The change retains layer-index validation, the one-expert constraint, packed/scales dtype and byte-length checks, and routed-bank matching.
Validation
Source:
0b94c12cbd4040407f9426306ba43bcec8d1feb9,mlx/io/safetensors.cpp.Executed locally on Apple Silicon through the integrated Swift runtime:
JANGHDenseNamedMmapTests.testDenseNamesRetainMappedOwnershipAndRejectInvalidBankspassed. It checks accepted dense names, mapped ownership/lifetime, invalid prefixes and indices, expert count, dtype and truncated byte spans. Local receipt:/Users/eric/vmlx-private-evidence/qwen-spec-review-20261007/engine-tests002.log(the named-mmap test passes; the larger invocation separately has an unrelated cache regression and test-runner metallib failures, which are being addressed in the Swift integration).This is a loader-name fix. It does not claim model generation, cache or performance qualification; those remain in the downstream Swift/app integration.