mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #326] Native pack rejects the BF16 blk.1.ple_key.weight that --compat-bf16 writes for OrcaRouter IQ3_XXS #155
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#155
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gen4536 on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/326
Hello
I've been testing your backend and it has been working quite nicely so far, but I've had to make some modifications to get it to work with
orcarouter/Qwen3.8-Flash-Next-Uncensored-GGUF(IQ3_XXS).The Issue
docs/ORCA.mdtells users to packorcarouter/Qwen3.8-Flash-Next-Uncensored-GGUF(IQ3_XXS) withtools/iq_pack.py --compat-bf16, then launch with--nativeand--ple-gguf. That pack storesblk.1.ple_key.weightas BF16. A current stock engine treats the GGUF's IQ3_XXS key as a native matrix, causes the packed BF16 row to be skipped, and then rejects the canonical BF16WeightRefas incompatible, exiting with:The PLE runtime already knows how to use a packed BF16 key. The load never gets that far. This is still the case in tag
v0.1.30(30ec18e).In a few words, we get this incompatibility, which means that I can't even load the model without patching the backend.
When it started
v0.1.25introduced it.v0.1.24still loads this pack.In
v0.1.24,eligible()accepts only a Q2_0 key (GGML type 42). The comment there says other quantized keys are converted to BF16 byiq_packand their packed bytes stay resident. The Orca packer rule was already present in that tag: a non-Q2_0blk.1.ple_key.weightis written as BF16, so the IQ3_XXS GGUF tensor is not treated as a native matrix and the packed row loads.v0.1.25widened that check in commitdaa121b(PR #121, the AMD HIP backend, 2026-09-29).eligible()now also accepts IQ3_XXS (type 18) and IQ4_XS (type 23):The packer was not changed. The Orca GGUF key is type 18, so from
v0.1.25onward the loader skips the packed BF16 row and then rejects it. The same check is still inv0.1.26,v0.1.27, andv0.1.30.Workaround I tested
Two edits on
v0.1.27(a790805). The packer, the GGUF, andsrc/kernels/cuda/ple.custay as they are. The PLE wiring later ingenerate.cppalready useswk->dataas BF16 when the pack row is not quantized.1. Keep a BF16 key in the weight arena (
src/program/generate.cpp).After
served_namesfills the skip set, read theblk.1.ple_key.weightrow of<pack>/index.txt. Thecode_bitsfield is the same valueWeightRef::quantized()uses.code_bits == 0means the pack stored BF16. Remove that name from the skip set so those bytes are loaded. A nonzerocode_bitsstays skipped, andNativeDenseuploads the GGUF matrix as before.2. Do not upload the GGUF key over that BF16 row (
src/core/native_dense.cpp).eligible()still matches the GGUF tensor, because it is IQ3_XXS. InNativeDense::load, before the shape check that returnsincompatible matrix, skip only this key when the pack row is not quantized:A Q2_0, IQ3_XXS, or IQ4_XS key whose pack row is still quantized falls through and keeps the current native upload, shape check, and kernel path. The same
loadfunction covers the layer-split call.After both edits the engine reports
PLE onand serves the packed BF16 key. One edit alone does not: leaving the key skipped means the arena has no key, and loading the BF16 bytes without thecontinuestill dies onincompatible matrix.I'm not 100% sure this is the way to go, to be honest with you, but the patch worked fine and I've been able to test the model without running into the
native dense: incompatible matrix blk.1.ple_key.weighterror.Possible intended fix
Since
v0.1.25intentionally added native IQ3_XXS and IQ4_XS PLE support, another possible solution may be to update the packer instead.For example, the PLE-key part of
needs_bf16()could treat every currently supported native PLE format as native:Then a newly generated OrcaRouter IQ3_XXS pack would leave that PLE key on the native path rather than dequantizing it to BF16.
That seems consistent with the
v0.1.25eligible()change and avoids unnecessarily converting a tensor that the runtime can now execute natively.It would, however, leave existing
--compat-bf16packs unloadable unless the loader also accepts a resident BF16 PLE key as a fallback. So preserving the BF16 fallback in the loader may still be useful for backward compatibility.At the moment the three pieces appear to disagree:
native_dense.cpp: Q2_0 / IQ3_XXS / IQ4_XS are native PLE types.iq_pack.py: only Q2_0 is considered native for the PLE key.docs/ORCA.md: the IQ3_XXS key is converted to BF16 and the native loader retains that converted key.Additional info (which to be fair, you already know, but might as well post it here)
What the packer does
tools/iq_pack.pyconverts a non-Q2_0 PLE key to BF16:OrcaRouter IQ3_XXS stores
blk.1.ple_key.weightas IQ3_XXS (GGML type 18), not Q2_0 (type 42).--compat-bf16dequantizes it and writes a BF16 row (code_bits == 0, 52,428,800 bytes) into the pack. The GGUF file is left unchanged. Official GSQ-RCO files that already store a Q2_0 key are not converted and stay on the native key path.docs/ORCA.mdstates that the native loader retains this converted PLE key, and that the existing native Q2_0 path remains available for the original model.What the loader does
With
--native, startup fails in two steps. Either step alone still leaves this pack unloadable.NativeDense::served_namessees the GGUF key.eligible()accepts Q2_0, IQ3_XXS, and IQ4_XS (native_dense.cpp). The IQ3_XXS name is added to the skip set, so the packed BF16 copy is not loaded into the weight arena. For a native pack,generate.cpponly erasesblk.1.ple_key.weightfrom that set when the pack is not native:NativeDense::loadthen requires the pack'sWeightRefto be quantized and to match the GGUF shape. The pack row is BF16, so the check fails and the engine returnsnative dense: incompatible matrix blk.1.ple_key.weight.Keeping the BF16 bytes in the arena without the second change still hits that error. Skipping the native upload without putting the BF16 bytes in the arena leaves PLE with no key. The wiring later in
generate.cppalready selects the right pointer once a resident row exists:wk->dataas BF16 when!wk->quantized(), and the native upload when the pack row is still quantized.@Niko1221 commented on GitHub (Oct 1, 2026):
Confirmed - thanks for the analysis and the fallback. 0.1.32 keeps a non-quantized ple_key row in the weight arena instead of uploading the GGUF matrix over it, so OrcaRouter IQ3_XXS packs load again.
@dazld commented on GitHub (Oct 1, 2026):
for the fix testing - Bartowski's IQ4_XS also has the same issue, which I patched up locally.
@Niko1221 commented on GitHub (Oct 1, 2026):
Fixed in 0.1.32: an unquantized ple_key row stays in the weight arena. Thanks!