mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4741] [Engine] a dense projection the pack keeps unquantized (BF16) is reported as "no native GGUF blocks" #2175
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#2175
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 @TheHubUser4860938 on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4741
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
Swift-1.5-Qwen3.8-Flash-Next-Heretic-V2-IQ4_NL(trubisky's quants of jeffpeng3's Heretic v2) loads its weights and then exits 1 on the first standing request, blaming a flag that was on the whole time:--native <shard1>and all eight--native-dense-ggufshards were on the command line. Expected: the model loads and answers. Actual: exit 1 with the message above, repeated on every retry.The same engine, same pack procedure and same
qwen4exparchitecture load and serve a second quant on the same box (HuihuiUD-Q4_K_XL), whose boot prints 301 native projection matrices / 2975.00 MiB and 303 skipped. The failing load is one matrix short and 15.94 MiB short — the size of exactly one 2560x6144 tensor: the one the error names.Smallest steps or command that reproduce it
setup.py --family heretic(IQ4_NL) — downloads the 8 root shards and packs them (pack_args: ["--compat-bf16"]).strata --serve --pack packs/heretic-iq4_nl --native …-00001-of-00008.gguf --native-dense-gguf <all 8 shards> ….The download is intact, so this is not a truncated file: all 8 shards match this fork's
HERETIC_SHARDSpins on size and sha256;split.count=8,split.no0-7, and the eight shards sum to the declaredsplit.tensors.count=1224; upstream lists exactly these 8 files at the repo root.Reproduction status
Reproduced locally — the prompt path and the verify/spec window both read the row after the fix (see Validation). The count of three affected dispatchers is unconfirmed static analysis: two are observed by the boot, the third compiles but is not exercised under
--spec 4.Strata version
Engine 0.1.54, app 0.2.8, built from source on this fork (
memory-corebased5055527). The defect is in the shared tree:src/prefill/prefill.cpp,src/core/verify.cpp,src/core/layer.cpp.Graphics card, memory and system
NVIDIA RTX 4090 (24 GB) + 125 GB system RAM, Arch-based Linux (kernel 7.3.0-5), driver 615.78.08, CUDA build. Context 524288 (YaRN x2 over 262144),
--kv int8 --kv-resident 32768,--conversation-cache-mib 15000,--spec 4 --mtp mtp/rt,--expert-cache auto,--pcie-frac 0.35.Model, quantization and configuration
trubisky/Swift-1.5-Flash-Next-Heretic-ReverseEngineer, IQ4_NL (108.9 GB, 8 shards). The IQ4_XS-plus sibling (6 shards, samesplit.tensors.count=1224) keepsblk.0.attn_gate.weightat Q8_0 — read from its shard metadata on 2026-10-30 — so only IQ4_NL carries the unquantized gate, and only IQ4_NL hits this.Cause (measured, not inferred)
Exactly one of the model's 36 attention gates is unquantized, and it is the one in the error:
BF16 is type id 30 in this repo's own table (
tools/gguf_reader.py:26; alsosrc/qwen35/q36ref.cu:64,T_BF16 = 30).native_mmvq_supported()(src/kernels/cuda/native_mmvq.cu) lists 2, 6, 7, 8, 11-14, 16-18, 20-23, 29, 42 — no 30. SoNativeDensenever binds the row.The pack is correct, and so is the download. Its index row (the 19-field order
src/core/weights.cppparses) keeps the tensor in the plan-v0.3-P6 16-bit-as-is form:index.txtrow forblk.0.attn_gate.weightBf16InF32,raw16)31,457,280 B = 2560 x 6144 x 2, and read out of
dense.binat the pool offset the index records, those bytes are byte-identical to the GGUF's BF16 payload (checked: True); as BF16 they are 15,728,640 finite values, absmax 0.703. The weight is resident and correct — only the dispatch is missing.The engine already reads this form on decode (
include/strata/kernels/bf16_gemv.hpp;src/core/layer.cpp'sproject_bf16, used every layer forssm_alpha,ssm_beta,indexer.q_proj,indexer.k_proj,ple_valueand the router), andsrc/prefill/prefill.cpphas abf16_proj()beside thenative_proj()that refused the row. Three dispatchers ask onlyw->native_data != nullptr, so they call a present tensor absent.The author's card predicts this and names the cure: layer 0's gate is "a giant outlier (the most sensitive tensor family in the model) - kept uncompressed", and "Strata may throw a BF16 kernel not found when you load the model … there's already one in strata somewhere, it'll find it and wire it up."
The fix we are proposing (included)
One shared decision on the row, asked where the three sites asked
native_data. No new kernel, no re-pack, the gate stays BF16.prefill.cppnative_proj(): onBf16it falls through to thebf16_proj()already in the file. The sites whose activation is the layer input pass the BF16 image (m.mixed_bf/m.mixed_bf_lo) as two optional arguments, because the block read and the 16-bit read want different activation images.verify.cpp:projectable_of()for the gate, andmm()/gate_proj()takebf16_gemv_fp32_mmvf_multi— the entry whose own guard isSTRATA_VERIFY_MAX_T, i.e. built for this window.layer.cppgdn_layer(): a 16-bit row is not asked for an S-form; it resolves toproject_bf16.A binding always wins, so no model that works today changes path: measured, the 300 native-eligible matrices in both models are the same 300 names, and huihui has zero BF16 dense rows.
Validation
Passed (RTX 4090, engine 0.1.54, branch
bf16-dense-projection, commitf11a18a9):ninja -C buildof the full engine — exit 0, 0 errors.proj_form_test(new,src/core/proj_form_test.cpp, registered in CMake) — ALL PASS, 9 checks. Five sabotage variants each fail the check that owns them: the oldnative_data-only test, theq8_scaleguard,!quantized(),data != nullptr, theNativecase.ctest --test-dir build -j8with and without the patch (patch stashed for the baseline): the same 69 failures either way, all "CUDA: out of memory" with a serving engine holding the card; 43 → 44 passed, the +1 being the new test.cartridge: seeded MEM-CRG-325c2290.bin (5 standing files, 392,268,732 B)) and it answers —done: 479 tokens in 12 s (90.3 tok/s) (stop).strata verify: captured the 1..6-token window (upload no error, sync no error)— six windows, each running all 36 GDN layers, layer 0 being the BF16 gate.native projection matricesstays 300 by design: the gate is not a native matrix, it is read from the pack.Failed: none observed, beyond the 69 CUDA-memory failures above (environmental, identical in the baseline).
Not run: HIP and SYCL builds (this box has CUDA only) — the touched files are shared, so those backends compile-check the same call sites and are unverified here;
gdn_layer's BF16 branch under a non-speculative decode; a huihui byte-identity check; the QSAattn_q/k/vrows; throughput on other hardware.Limits
ssm_alphadoes), the verify window takes the FP32 window (asgdn_ab_multidoes), andSTRATA_PREFILL_BF16X2is off by default so no low plane is added.attn_qkv,ssm_out,attn_q/k/v/outputorffn_*_shexprow that arrives unquantized still errors, now naming the row's form and the missing activation image.Two smaller asks
--nativeis on. Naming what the row is ("a BF16 pack row; this projection has no BF16 activation plane") points at the cause.NativeDense::served_names()andload()are separate walks of the shards — one decides what the pack may leave out, the other what gets bound. One pass would make this class of mismatch structurally impossible.Reported and patched by the fork's owner, with agent assistance; claims verified against source and command output before submission.
@github-actions[bot] commented on GitHub (Oct 30, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 30, 2026):
Thanks, this follows the format now.
@TheHubUser4860938 commented on GitHub (Nov 4, 2026):
Confirmed on the box the report came from: engine 0.1.56 (from v0.2.10), RTX 4090, the heretic IQ4_NL pack,
--nativeplus eight--native-dense-ggufshards. The Q8_0 binding loads and answers; the boot printsand 301 native projection matrices / 2,975.00 MiB against the 300 / 2,959.06 MiB the BF16 route gives — the +15.94 MiB is the one 2560×6144 tensor, and it lands the boot on exactly the numbers huihui UD-Q4_K_XL prints, which is the control the original report used.
The commit says the Q8_0 copy is "not bit-exact against reading the BF16 values (a Q8_0 rounding on one 2560x6144 matrix, the same format its siblings have)". We measured that rounding on the real bytes, and the part worth knowing is which of the 36 gates it is:
So the one projection the pack leaves unquantized is the peakiest gate in the model — which is the reason trubisky's card gives for keeping it ("a giant outlier (the most sensitive tensor family in the model) — kept uncompressed"). Q8_0's step is set by the block maximum, so a peaky block pays for it: the binding lands this tensor at 1.5× the noise its siblings already carry, and 5.2× the noise of the form the pack stores.
In model space (same engine 0.1.56, same flags,
STRATA_DENSE_Q8the only variable; 12 closed-form prompts, temp 0, 64 tokens, 6 repeats, top-5 logprobs; 28 rows, 243 scored positions, 241 tokens of shared sequence):last_threeagainstlast3So the conversion is not free: it moves the distribution by ~0.014 nats a token and the perplexity of the text the two arms agree on by ~0.4%, on the one matrix of 36. Small, measurable, and in the direction the peakiness predicts. It is also a top-k approximation on 243 positions, so read it as an order of magnitude, not a third decimal.
Calibrating "1 of 28" against the box's own jitter — the same prompt sent twice in the same boot, answers byte-identical:
Switching the gate moves the answer about as much as asking the same question twice. The part that is not jitter is the direction: PPL +0.37% one way, on the text both arms wrote, and the shape of it — arithmetic and JSON rows at 0.00000-0.00009 nats, the prose and translation rows at 0.029-0.134.
What PPL means here: the perplexity of the shared greedy sequence (the tokens both arms emitted, up to the first divergence), not a fixed-corpus PPL — the server has no prompt-logprob path, so a teacher-forced corpus PPL is the natural follow-up for someone with the time.
On "NOT tested: any run": that is about the 14 packages, and this closes one of them (CUDA sm_89, the IQ4_NL pack). The other thirteen are as unmeasured as they were.
Our fork keeps the BF16 read as the default (
proj_form(), f11a18a9) and puts the Q8_0 binding behindSTRATA_DENSE_Q8=1, because the two fixes are orthogonal — the binding lives innative_dense.cpp, the dispatch inweights.hpp/prefill.cpp/verify.cpp/layer.cpp— and the engine already reads 16-bit rows on every path:Gemm::bf16in the prompt path (cuBLAS BF16 on sm_80+, hipBLASLt bf16 on AMD),project_bf16on decode. This model's pack carries 484 BF16 rows of 1,079, so the BF16 route is a hot path, not a new one.The ask, if it is not too late for a 0.2.10.x: say in the release notes that the BF16 gate is served as Q8_0, so a person choosing this pack knows the one uncompressed tensor is compressed at load. And if the tensor is worth 15.94 MB of the pack, a BF16 entry in
native_mmvq_supported()(type 30) gets the author's form on the native path with no re-pack — the reader kernels are already in the tree.— the fork's owner, with agent assistance