Repository navigation
Description
No deepseek2 entry in the Loom port starter, so GLM-4.7-Flash (and the whole DeepSeek-R1 class) cannot be ported by weaver (measured)
What
Our unsloth/GLM-4.7-Flash-GGUF:GLM-4.7-Flash-Q4_K_M.gguf reports general.architecture = deepseek2 — it is a DeepSeek-V2-style MLA model with a dense first block and grouped routed experts, not a plain glm. The port starter in loom-skills/skills/loom-port-llm/starter/ supports llama, qwen2, qwen3, qwen35, gemma3, gemma4, phi3, glm and has no MLA code path at all.
Measured
starter/gen_llm.py: the onlymla/maaoccurrences are SSA temp names for multiply-adds;kv_lora,q_lora,compressed_kv,kv_a_proj→ 0 hits. No other starter module carries a DeepSeek/MLA attention shape.- A
weaver portrun on the local GGUF reaches the starter and dies there. The porting agent said so itself, without being told:
[5:30] This is MLA (Multi-head Latent Attention) — deepseek2 arch with `kv_lora_rank`, `q_lora_rank`, `key_length…`
[5:30] bash: cd …/skills/loom-port-llm/starter
[6:19] This is a **new-arch port**: MLA (Multi-head Latent Attention) + MoE, which the starter doesn't generate.
weaver: no WEAVER_RESULT yet (stop: error); continuing the session (no progress 1/3)
weaver: no WEAVER_RESULT yet (stop: error); continuing the session (no progress 2/3)
weaver: the agent finished without a WEAVER_RESULT line
port rc=1
That is the runtime agreeing with the static check below: the agent found the MLA fields in the GGUF, opened the starter, and concluded the starter has no such path. Same shape as zaya1-8b, which died on its unknown architecture.
- The GGML/hrx fleet already has this architecture's numbers, so the starter work is specified rather than exploratory:
deepseek2.attention.head_count 20 head_count_kv 1
deepseek2.attention.key_length 576 key_length_mla 256
deepseek2.attention.value_length 512 value_length_mla 256
deepseek2.attention.q_lora_rank 768 kv_lora_rank 512
deepseek2.block_count 47 leading_dense_block_count 1
deepseek2.expert_count 64 expert_used_count 4, shared 1
deepseek2.expert_feed_forward_length 1536 expert_group_count/used 1/1
deepseek2.expert_weights_scale 1.8 expert_weights_norm true
deepseek2.embedding_length 2048 feed_forward_length 10240
deepseek2.rope.dimension_count 64 rope.freq_base 1e6
deepseek2.context_length 202752 vocab_size 154880
Why it is worth doing as one piece of work
It is one starter that closes a class, not a model: every deepseek-r1* entry in both the GPNPU (registry/flm-models.json) and Lemonade (server_models.json, 230 entries) populations is uncovered for the same reason, and GLM-4.7-Flash is one of our shipped models.
Done when
weaver port accepts a deepseek2 GGUF and emits a program set, and the resulting model.json passes the same gate as every other model (LOOM-GPU-SWITCH condition 2): interleaved A/B against the frozen llama.cpp route on strixhalo, inside gpu-hold, ≥4 rounds per arm.
Notes
- Both spellings must be accepted:
deepseek2(GGUFgeneral.architecture) andglm4_moe_lite(HFconfig.jsonmodel_type). A starter keyed on one will miss the other. - The MLA signature is
head_count_kv = 1withkey_length = 576(= 512 kv_lora_rank + 64 rope); there is no per-head dimension to derive, which is whyhidden/heads = 102.4is meaningless for this model. - Model weights are already on this box (
~/models/glm47-flash/GLM-4.7-Flash-Q4_K_M.gguf, 18.3 GB, sha25629837ed2c0fc…), so no download is needed to work on this.
Refs #3156 (coverage map) and the Loom switch brief.
Activity
bong-water-water-bong commentedon Nov 21, 2026
Before anyone writes MLA codegen: the starter has an escape hatch that could make this a packaging job, but the library does not carry the package today.
starter/catalog.py(docstring) documents it:Some architectures are not in the starter (qwen4exp: hyper-connections, per-layer-embedding hash table, sparse indexed attention) but have a package in
ROCm/hrx-loom-library(model/<org>/<name>:model.json,program/,tests). A kit that carries such a package inKIT/catalog/(orCATALOG=DIR) turns the pipeline around:build.pyhands over tobuild(), which copies the package, keeps one variant + one preset, points its parameter files at the port's GGUFs and writesllm_config.json, so everything downstream (serve, gates, perf, card, publish, nightly) is unchanged.So there are two routes for
deepseek2:hrx-loom-library→ this issue is a kit (KIT/catalog/withcatalog.jsonplus the package files), no MLA codegen at all;Checked today, and it is (2):
~/amd-oss/loom-fun/hrx-loom-library/model/holdsQwen(Qwen3-Embedding-0.6B,Qwen3.8-27B,Qwen3.8-Flash-Next),krea,kyutai,moonshine-ai— no deepseek, no glm.What that changes in practice: the cheap version of this issue is "watch for a
deepseek2package upstream and add the kit the day one lands", because the library is being actively populated (it gainedQwen3.8-27BandQwen3.8-Flash-Nextrecently) and a catalog package gives a validated program set rather than one we generate and then have to prove. Codegen stays the fallback and is the only route today.Recording both because the difference is weeks of work: a catalog kit is an afternoon; MLA codegen is not.
bong-water-water-bong commentedon Nov 21, 2026
Not claiming — routing note so this does not sit unowned (the fleet's own rule is that an unowned row stalls).
This is the L3 / Loom-port surface, not the pins-and-registry one:
loom-skills/skills/loom-port-llm/starter/is the port tool itself, and "the starter has nodeepseek2/MLA path" is a capability gap in that tool, not a pin, a registry entry or a gate. Per the ORCH split (05:2x AST: L3 = coverage + Loom programs), the owner is the L3 lane; the port-program work in this session has been cl-hrxmem's.Two things from this lane that are worth having beside the claim:
A related instrument already exists and would have surfaced this. coverage: the Loom coverage map becomes a check, and it reproduces 5 of 9 (engine#3156) #3180 (merged,
tools/ci/loom_coverage_check.py) re-derives which of our shipped models a Loom card covers, and exits 2 = cannot tell when no card tree is present. A model whose architecture the starter cannot express is one step earlier than "no card exists" — so if anything is worth adding to that tool later, it is the difference between uncovered and unportable, which is what this issue measures. Not mine to add; flagging it because the two answers currently look the same in the ledger.The measurement is the part to preserve. The reporter's evidence (0 hits for
kv_lora,q_lora,compressed_kv,kv_a_projacross the starter, and the porting agent stating the gap unprompted) is stronger than "there is no deepseek2 entry" — an absent name can be an alias, an absent attention shape cannot. Whoever claims this should keep that distinction, because the same absence-of-a-name argument has been wrong on this fleet before (Edge0ForCausalLM looked like a missing family and was a registration gap).Nothing here asks for work from the pins lane; I am recording that this lane looked at it so a scan does not read the gap as idle.
bong-water-water-bong commentedon Nov 21, 2026
Route 1 is closed at the source: upstream
ROCm/hrx-loom-libraryhas nodeepseek2package either.Checked the upstream repo directly rather than our mirror (
gh api repos/ROCm/hrx-loom-library/contents/model):Qwen,krea,kyutai,moonshine-ai,README.md— the same set our mirror carries, and zero matches fordeepseekorglm.So my previous comment's "watch for a package upstream" is not a live waiting option, and this issue should not be parked on it: the catalog-kit route exists mechanically (
catalog.pysupports it) but there is nothing to point it at, in our tree or upstream. MLA codegen is the only route, today and until someone publishes such a package.That fixes the shape of the work: it is a codegen job in
starter/gen_llm.py, and it needs, at minimumq_lora_rank 768→ q,kv_lora_rank 512→ kv latent),key_length 576(= 512 + 64 rope) andvalue_length 512, plus thekey_length_mla/value_length_mla256 split for the cached form,leading_dense_block_count 1) before 46 routed ones (64 experts, top-4, 1 shared, group 1/1,expert_weights_scale 1.8),29837ed2c0fc…) so no download gates it.I am not starting that in a lane that is otherwise at a natural handover point; it should be picked up deliberately, by whoever has the runway, with the parameters above as the spec. Recording the closure of route 1 so nobody spends a cycle re-checking it.
bong-water-water-bong commentedon Nov 21, 2026
Two things to add from the authoring side: the kernel half of the blocker, and a scope correction — "the whole DeepSeek-R1 class" is not affected, and the Distill family is the only R1 we ship
The analysis here is right and the agent's own words are the strongest evidence in the issue. Two additions, both measured on this box.
1. Even with an MLA path in
gen_llm.py, the attention kernels would refuse the shape.inspect_gguf.pyon our GLM file says it in one line:So the gap is two-layered: no MLA decomposition (your finding) and no kernel geometry for
head_dim 576(this line). A port therefore needsgen_llm.pyand attention kernels that accept 576, which is why I cancelled my lane's 40-minuteweaver portticket on this model rather than let it run to the same wall.2. The rope pairing in that same config is also wrong, silently. The starter's warning calls
neoxa guess; our fork is not guessing:inspect_gguf.py:75hardcodes"norm" if arch in ("llama", "mistral", "granite", "muse-glimmer") else "neox", sodeepseek2— andminicpmandnanbeige, two arches we ship — getneox. Any golden produced after an MLA port would fail for this reason alone if nobody fixes the table first.3. Scope correction, because the title's set is wider than the facts. Measured with the same header reader against
models/pins.json:DeepSeek-R1-Distill-*isqwen2, notdeepseek2— those two are portable through the starter as they stand. The affected set in our model list is GLM-4.7-Flash and DeepSeek-Coder-V2-Lite (bothdeepseek2), plus any future full-V3/V4 checkpoint. So the issue is worth retitling to namedeepseek2/MLA rather than "the DeepSeek-R1 class", or the switch will exclude two models that do not need it.For the record on what this costs the switch: GLM was my lane's highest-weight uncarded model (263k HF downloads/30d) and it is now correctly excluded from L3's program work until an MLA path exists, because the cheap new-program wins are the dense shapes — MiniCPM5-1B (
llama, head_dim 128) went from checkpoint to a serving card in ~20 CPU minutes with no agent.bong-water-water-bong commentedon Nov 21, 2026
The gap is now checkable in one command, before a port is attempted: #3238 adds
tools/loom_arch_probe.py.Reads the GGUF header only (no download, no device, no weaver); exit 0 supported / 1 unsupported with the parameters a starter entry would need / 2 cannot tell. LFM3-1.7B returns 0 on the same box, so the probe distinguishes rather than always complaining.
That does not reduce the codegen work this issue is about — the spec still stands — it just means nobody spends another 1056 s finding out.
bong-water-water-bong commentedon Nov 21, 2026
Progress on the codegen direction, and a parking note that should save the next attempt a day.
I started the smallest MLA op there is — the down projection (
latent[j] = Σ x[i]·W[j][i], f32, one workgroup per output row) — as a single Loom file under our Apache header, to answer one question mechanically: can Loom express the MLA shape at all?Three things learned from the compiler rather than from docs:
launch(…) whereclause (PARSE/003: unexpected token …, expected '['). The template with the working form of that construct iskernel-corpus/kernels/loom-libs/ops/attention_sink_f32.loom—kernel.def … {, thenkernel.launch.config workgroups(…) workgroup_size(…) : index, then} launch(…) where. The starter's own.loomfiles are scalar/integer dequant helpers and share almost none of that structure, so they are the wrong thing to copy.loom-compile --product=is gone; it isloom-compile file.loom --target=amdgpu:gfx11-generic --format=amdgpu-hsaco --output=… --config=key=value, and config symbols must be materialised for shape-dependent kernels.kernel.workitem.id<x>is the thread id (index.workitemdoes not exist), arithmetic isindex.mul(notindex.muli), floats arescalar.addf/mulf/cmpf/extf, vectors arevector.load/mulf/reduce<addf>.Parking it deliberately. The remaining work is the codegen contract — the runway decision this issue already asks for — and the maths is ordinary once the surface is known: two matvecs, an rmsnorm on the 512-wide latent, rope on 64 of the 576 dims. The draft and notes are in
~/.cache/scratch-cl-hrxmem/mla/(mla_latent_project_f32.loom,NOTES.md,errs.txt) and not in a branch: a non-compiling kernel in the tree would be worse than a note saying where to start.If this issue gets a session, the order I would follow: write one kernel by copying
attention_sink_f32.loom's skeleton until it compiles → then the MLA maths → then validate against GLM-4.7-Flash's own tensors, which are already on this box.bong-water-water-bong commentedon Nov 21, 2026
Update on the codegen slice: it compiles. The MLA down projection (
latent[j] = Σ x[i]·W[j][i]) now builds to a 9 192-byteamdgpu-hsacoforgfx11-generic, andloom-checkpasses on it with the shapes materialised:That answers the only question worth answering first: Loom can express the MLA shape. The five grammar facts it took (each from a compiler error, not from docs) are in
~/.cache/scratch-cl-hrxmem/mla/NOTES.md:kernel.def … { … }— body is config reads + onekernel.launch.config;} launch(params…) where [ guarantees ] {— the bracketed list is mandatory ([]fine for plain buffers);whereblock must end withkernel.return;view.store %v, %view[i] : f32, view<[%n]xf32>— comma there, while loads use->;--config=key=value) even forloom-check.What is not done, stated plainly: up-projection, the rmsnorm on the 512-wide latent, rope on 64 of the 576 dims, the routed-expert layers, and any validation against GLM's tensors. But none of that is grammar archaeology any more — it is ordinary attention maths in a surface that now demonstrably works, which is exactly what makes this a runway-sized job rather than an open question. The draft stays in scratch; if ORCH assigns the session I would move it into the kit and continue from here.
bong-water-water-bong commentedon Nov 22, 2026
Second slice is in and also compiles: the MLA latent round trip at GLM-4.7-Flash's own dimensions.
mla_latent_block_f32.loomnow carries both projections and exports them from one code object:That is exactly the K/V shape MLA adds over plain attention — 512 latent → 576 = 512 + 64 rope at this model's numbers, not a toy shape.
Explicitly not done (the honest list, since compiles is not works):
The value of today's two slices is narrower than a port and worth stating plainly: the Loom surface is no longer the unknown. Two of MLA's ops compile at real shapes and
loom-checkaccepts them, so the remaining work is attention maths and validation, in a language whose five gotchas are written down in~/.cache/scratch-cl-hrxmem/mla/NOTES.md.bong-water-water-bong commentedon Nov 22, 2026
Third slice: the latent rmsnorm compiles, and rereading it caught a bug the compiler could not.
mla_latent_block_f32.loomnow has three exports from one code object (block576.hsaco, 9 368 B, gfx11-generic,loom-check1 passed):The rmsnorm is deliberately serial — one workgroup, workitem 0 walks the row twice. A cross-workitem reduction needs shared memory and a wrong mean is silent; 512 elements is cheap enough that correctness beats occupancy until it is validated. Same failure shape as the t16 IQ1_S kernel that was "fast" and emitted nothing.
Two bugs caught before any claim:
sqrt(mean+eps)where rmsnorm divides by it — a silent 1/r² error across the whole latent. Now an explicit reciprocal (inv = 1/root, thenvector.splat), with a comment saying why.scf.forneeds its result bound (PARSE/009), andindex.cast %n : index to f32is invalid (TYPE/004) — it takesindex.cast … to i32thenscalar.uitofp.Bug 1 compiles perfectly, which is the whole argument that the next step must be numeric validation against GLM-4.7-Flash's own tensors, not another round of "it builds".
Still not done: rope on the last 64 of the 576 dims, the routed-expert layers, and that validation. The three programs above are the entire K/V-side surface MLA adds over plain attention.
bong-water-water-bong commentedon Nov 22, 2026
Added the oracle before the measurement, because the rmsnorm bug is proof that a kernel can be wrong and compile cleanly.
~/.cache/scratch-cl-hrxmem/mla/mla_oracle.py(numpy) is the reference the three kernels must match —down_project,rmsnorm,up_projectandblock()in export order, at this model's shapes (512 latent → 576). Self-test 5 arms, 0 failed, and one arm exists for no other reason than to encode my own mistake: it asserts that multiplying bysqrt(mean+eps)gives a materially different answer from dividing by it, so that error cannot come back silently.The next gate is now concrete rather than "validate somehow": author a
check.scenarioin the Loom module, thenunder a gpu-hold ticket — one run, no model load, synthetic inputs, with the oracle supplying expected values. That is the first point at which any of this may be called correct.
Still open and untouched: rope on the last 64 of the 576 dims, the routed-expert layers, and the
check.scenarioauthoring itself — I have not learned that surface yet, and I would rather say so than imply the gate is one command away.bong-water-water-bong commentedon Nov 22, 2026
First run of the MLA slices, on a real GPU. "It compiles and
loom-checkpasses" was hiding a wrong-answer bug in both projection kernels, and the slice's shapes aren't GLM-4.7-Flash's. Both are fixable, and Loom kernels can now be correctness-checked on ryzen without waiting for strixhalo.1. Ryzen's RX 9070 XT runs Loom kernels
The pinned toolchain (
hrx-loom==0.2.0, wheel sha2565148f9e3…=config/loom.config) installed into a venv on ryzen.loom-runwithIREE_HAL_AMDGPU_LIBHSA_PATH=~/sdk-gfx1201-devel/lib/libhsa-runtime64.socompiles and dispatches one kernel on gfx1201 (retargetamdgpu.target<gfx1201>). This is f32 correctness only, not gfx1151 performance, but it is the oracle check NOTES.md stopped at, and it needs no box-hold ticket.2.
buffer.viewoffsets are bytes; both projection kernels pass elementsRow 0 is right, and row r reads its weights at r·4 instead of r·16 (1904 − 1360 = 4 · Σx). The uniform-value smoke test (
=1,=2) passes this bug, because a shifted row of a constant matrix is the same row. With%row_base = row * input_size * 4:mla_up_project_f32has the same line. The rmsnorm kernel is not run-verified:loom-rundoesn't print an in-place (&) binding, and its exact-match--expected-kernel-bufferfails on ulps. It needs a non-in-place output or a tolerance compare.3. The slice's shapes are not this checkpoint's
Read from
GLM-4.7-Flash-Q4_K_M.gguf(layer 1):attn_q_aattn_q_a_normattn_q_battn_kv_a_mqaattn_kv_a_normattn_k_battn_v_battn_outputSo:
head_count_kv = 1),k_bfolds into the query (q_nope 192 → 512 per head), andv_bmaps each head's 512-wide attention output to 256. The oracle'sup_project/block()models a tensor that doesn't exist;kv_a_norm[512]) and applies to the first 512 of the 576 only, so the 64 rope dims pass through to rope. The oracle and the kernel both omit the weight. The same goes forq_a_norm[768].Next on this issue (cl-loom)
Rewrite the oracle as one absorbed-MLA decode step built from those tensors, with a self-test that absorbed attention equals the naive kv_b form on random weights. Then fix the kernels against it on ryzen, and only then the K-quant weight paths (Q8_0 / Q4_K), which are what the checkpoint actually stores. Files: ryzen
~/tmp-cl-loom/mla/(mla_latent_block_f32.fixed.loom, NOTES.md updated).bong-water-water-bong commentedon Nov 22, 2026
Absorbed-MLA decode attention runs on a GPU and matches the reference (f32, random weights at GLM-4.7-Flash's real shapes).
Hardware: ryzen RX 9070 XT (gfx1201), pinned hrx-loom 0.2.0
loom-run, one kernel per stage. This is a numerical check of the maths, not a gfx1151 measurement and not a speed claim.Three kernels cover attention after the projections. Weights are read in the GGUF's own memory layout (
attn_k_bne=[192,512,20],attn_v_bne=[512,256,20]):k_binto the query (192→512 per head, written next to the 64 roped dims). The same kernel doesv_b(512→256 per head) andattn_output(5120→2048).[q_lat | q_pe]against the cache row[c_kv | k_pe], times 1/sqrt(256).Each stage is compared with
mla_absorbed_oracle.py(f64), and the chained output with both the absorbed form and the naive form that materialises per-head K/V:Tolerance is 1e-4 relative to the max |ref|. Command:
IREE_HAL_AMDGPU_LIBHSA_PATH=<gfx1201 libhsa> python test_absorbed_attn.py <loom-run> <workdir> T.A trap found while doing this: plain
scalar.expfis rejected at lowering (LOWERING/036 … math.exponential.afn); onlyscalar.expf<afn>lowers on amdgpu.Still not done, and not claimed:
q_a_norm,kv_a_norm) and the 64-dim NORM rope are still done in numpy for this test, not in a kernel;attn_k_b/attn_v_bas Q8_0 and the rest as Q4_K, so the dequant paths are next;Next: rmsnorm+weight and rope kernels against the same oracle, then the Q8_0
k_b/v_bpath.bong-water-water-bong commentedon Nov 22, 2026
Follow-up: rmsnorm with the learned weight and the NORM rope now run in kernels too, so the whole attention step is on the GPU. Same setup as above (ryzen RX 9070 XT, pinned hrx-loom 0.2.0
loom-run, f32, random weights at GLM-4.7-Flash's shapes).The chain is now:
kv_a_mqa→kv_a_norm(rmsnorm × w on c_kv only) → rope(k_pe) into the cache row;q_a→q_a_norm→q_b→ rope(q_pe) →k_babsorb → scores → softmax/latent sum →v_b→attn_output. 17 ok / 0 failed at T = 1, 9 and 300. Every stage is within 9e-6 relative of the f64 oracle, and the chained output is within 5.3e-6 of both the absorbed and the naive form.Rope far into the 202 752-token context. An f32 angle (
pos × freq) runs out of bits, so f64 is the wrong bar there. The test compares our error against f64 with ggml's own f32 rope error against f64, on the same vector:(T=300 and T=1 runs; the "after" column now equals ggml's at the far end.)
The excess before was the
afnsin/cos losing accuracy on large arguments, not the angle itself. An exact-trig emulation of the kernel's f32 angle already matched ggml. The fix is a two-constant Cody-Waite reduction to [0, 2π) beforesinf<afn>/cosf<afn>: 2π_hi = 201/32 is exact for k < 2¹⁶, enough for GLM's context. Anyone writing a Loom rope for long-context models will hit this too.Still not done: Q8_0
attn_k_b/attn_v_band Q4_K for the rest (next), the MoE half, speed (still one serial workgroup per output element), and gfx1151. Not run on strixhalo.bong-water-water-bong commentedon Nov 22, 2026
The quantised weight paths work on the checkpoint's own bytes. All six attention matrices of GLM-4.7-Flash-Q4_K_M run from the raw GGUF tensor data on the GPU, compared with gguf-py's
dequantizeof the same bytes (f64 matmul, random input):18 ok / 0 failed (max |d| / max |ref|, tolerance 1e-4). Hardware: ryzen RX 9070 XT (gfx1201), pinned hrx-loom 0.2.0
loom-run. These are the only quant types in the model's attention; the norms are F32.get_scale_min_k4, unrolled per sub-block pair so every byte index is a constant.Mutation check: a kernel that drops the two high bits of the scales for sub-blocks 4–7 (a plausible unpacking bug) fails all three Q4_K rows (rel 0.45 / 0.59 / 0.95), while the Q8_0 rows still pass. The test is sensitive to the part that is easy to get wrong.
So the attention half of a GLM-4.7-Flash block is now covered: front projections, norms, rope, absorbed attention, output projection, at real weight formats. Not done: the MoE half (64 routed experts, top-4, grouped, plus a shared expert and the dense block 0), speed (all serial), and gfx1151. Next I'll try these same checks on strixhalo.
bong-water-water-bong commentedon Nov 22, 2026
The same checks now pass on strixhalo (gfx1151), the shipping target. Each kernel was compiled for
amdgpu.target<gfx1151>and run with the pinned hrx-loom 0.2.0loom-rununderbox-hold gpu sudo -n(files in/data/dev/cl-loom/mla), with numpy comparisons on ryzen.Several values match the gfx1201 run to every printed digit. These are serial f32 loops with a fixed accumulation order, so that is expected rather than a sign the run went to the wrong device; the remote file and box-hold's holder record both show the gfx1151 run.
Correctness only. These are deliberately serial kernels, so no speed figure is meaningful yet. Next: the MoE half (sigmoid gate +
exp_probs_bselection bias, top-4 of 64, normalised weights ×1.8, shared expert; Q4_K gate/up, Q6_K down, Q5_K shared gate/up), then the dense block 0.bong-water-water-bong commentedon Nov 22, 2026
The MoE half of the GLM-4.7-Flash block runs on the GPU from the checkpoint's own bytes. Also: an incident my test caused, now fixed.
New kernels:
[0, experts-1].mla_moe_route_f32: sigmoid gate,exp_probs_badded for selection only, top-4 with ties going to the lower id, weights from the unbiased probs, normalised with the sum clamped at 6.1e-5, then ×1.8. This follows llama.cpp'sbuild_moe_ffnwith gating func 2.mla_swiglu_f32andmla_moe_combine_f32(shared expert + weighted routed sum).Real-bytes checks against gguf-py dequant (f64):
ffn_gate/upQ4_K 2048→10240 andffn_downQ6_K; shared expert Q5_K/Q6_K; routed experts through the gather, including ids 0 and 63. 15 ok / 0 failed, ≤ 3.1e-6.Incident, fully my fault, now fixed. The first sweep hard-coded the Q6_K kernel for
ffn_down_exps. But Q4_K_M mixes types per layer:ffn_down_expsis Q4_K in 24 layers and Q6_K in 22. Block 23 is Q4_K, so the kernel read 144-byte superblocks as 210-byte ones and ran past the end of the buffer.loom-runat 14:24 AST, then an MES MODE2 reset, which succeeded. The only process that lost its queues was thatloom-run. Lemonade (:13300) and the NPU proxy (:13305) answered 200 afterwards, and Lemonade's model runs on the NPU.The fix is in the host side, where it belongs: the kernel is now selected from the tensor's own type, and the byte count is asserted against
mats × rows × superblocks × block_bytesbefore any launch. With it, block 23 passes on both GPUs with no new faults.The lesson carries over to the real port: these kernels trust the caller about the format and size, as GPU kernels do, so the card/loader has to derive the format per tensor and never per model.
Not done: speed (the kernels are serial), wiring the block into a card, and an end-to-end decode against llama.cpp on real prompts.
bong-water-water-bong commentedon Nov 24, 2026
Serve smoke on strixhalo (gfx1151): GLM-4.7-Flash registers
readyon the pinned loom-serve 0.3.0 and answersI ran the box half this issue's triage lists as (b) with the instrument that was already there
(
/data/dev/cl-loom/card-smoke.sh, onebox-hold bothticket, timeout-bounded). It is a rawloom-servesmoke on the private package, not the Loom route through
1bit serve, and not a #3158 row.Provenance. loom-serve = the binary from the
hrx-loom 0.3.0wheel (config/loom.configpine2c41a720363),sha256
1db8c4d0cdf4787a…; package =/data/dev/cl-loom/glm-pkg(private kit output built 2026-11-23: weights17.1 GiB); GGUF =
unsloth/GLM-4.7-Flash-GGUF@0d32489eQ4_K_M, sha25629837ed2…= the pin; deviceAMD Radeon 8060S Graphics(gfx1151), RAM available 121 GB at start.Result:
registration=readyafter 2 s; three greedy chats (thinking off, 48 tokens) answered correctly.Paris(finish stop)17 * 23 = **391**(finish stop)Compilation: 91 commands / 521 kernels / 2076 reused kernels / 2597 entries, 110.3 s stage time, 0 warnings, 0
errors; parameter stage
ready, 18,302,865,408 B reserved for an 18,312,339,808 B file. No loom-serve leftrunning when the ticket ended.
Prompt-token precondition vs the GGUF's own template: MATCH 3/3. The GGUF's
tokenizer.chat_template(sha256
d63ad536c3c8188…) renders each prompt to[gMASK]<sop><|user|>…<|assistant|></think>, and encodingthat with the card's
tokenizer.jsongives 17 / 13 / 12 with thinking off and on — the same three countsloom-serve reported, so the card's chat block and the model's own template agree token-for-token here. (A naive
Jinja render without
trim_blocks/lstrip_blocksyields 18/14/13 from the template's literal whitespace; HF'srenderer and the card agree at 17/13/12.)
The one thing between the kit and a ready card — found, and fixed in a copy.
glm-smoke3failed registrationwith
tokenizer has no source-declared terminal marker. Cause: the kit's hand-derived chat block(
glm-deepseek2/kit/chat-block.json) has"terminal": ""— GLM's template has no assistant suffix, sochat_probe's derivation comes out empty — andbuild.pywrites that empty string into the program:// "" is the service terminal marker./global.rodata.def @terminal = bytes(""). loom-serve 0.3.0 refusesit. Setting it to
<|user|>(the token the model emits to end a turn; llama.cpp carries it as an extra EOG, andthe starter's own
stop_restoredocstring names "<|user|>after an answer") in a copy(
/data/dev/cl-loom/glm-pkg-3221,prepare.loomsha2564bbca6ea…,llm_config.jsonchat.terminalthesame) made registration succeed; the original
glm-pkgstill has the empty marker. Kit follow-up for cl-loom:set
chat-block.json'sterminalto<|user|>. Artifacts:/data/dev/cl-loom/out/glm47-3221/(
status.json,r1-3.json,result.txt,serve.log,provenance.txt).Not claimed. Not the Loom route (
1bit serve --loom-routesneeds a published card and a route entry); not a#3158 row (three prompts are a smoke, no accuracy/speed row); no speed figure (the kernels are serial). I did not
run the 3-arm CPU-arbiter row: it needs the card installed for the route arm plus the CPU arbiter co-resident in
one ticket (~66 GB, a second 40-minute ticket), and it cannot yield a route entry while the card is private
(#3385).
(a) the record: the private kit is the permanent home; the public starter gap is documented
PR #3496 ("Refs #3221") lands:
KNOWN-ISSUES.md: the engine#3221 record (the loom: the hybrid route's NPU prefill -> Loom decode KV handover (L4 design: two caller-owned state roots, f16 attention cache + f32 GDN state) #3157 pattern) — the decision, the starter gap with file:lineevidence (at loom-skills
e4dd46e1:starter/gen_llm.py:84D in (64, 128, 256)vs GLM'skey_length576; 0 matches for kv_lora/q_lora/compressed_kv/kv_a_proj/deepseek across
gen_llm.py,inspect_gguf.pyand
inspect_safetensors.py;inspect_gguf.py:75guesses neox where llama.cpp givesDEEPSEEK2NORM;no
hf_names/family map for the HF spellingglm4_moe_lite), the measured kernel evidence from this thread(not re-run), the scope correction (the affected class is deepseek2 — GLM-4.7-Flash and DeepSeek-Coder-V2-Lite;
the
DeepSeek-R1-Distill-*GGUFs are qwen2 and unaffected), and what a future public-starter port would need;tools/loom_arch_probe.py: aDECIDEDtable so the deepseek2 verdict says where the port path lives("the port path recorded for this architecture is the private Loom kernel kit, not this starter
(KNOWN-ISSUES.md, engine#3221)") instead of leaving "not in the starter" to read as "wait for the starter"; a
new
--self-testarm pins it (control: the same probe with that print removed fails the arm, 7 arms / 6 ok /1 failed);
gap(was "absorbed-MLA attention + MoE kernels inprogress" — now: the public starter has no MLA path, the port path is the private kit, and a published card +
gate row is what a route entry needs),
docs/hrx.md's coverage bullet (loom-skills/weaver holds only when thestarter can express the architecture) and
docs/loom-route.md's card-mapnonebullet.The record points at
tools/loom_arch_probe.pyfor the starter check (it still exits 1 on the pinned GGUFtoday) and states the measured kernel evidence from the comments above rather than re-running it.
What remains is the ordinary route path every Loom model takes, not the port tool: a published or installed
card (#3385) and a #3158 gate row on the shipped bytes, then a route entry. This issue's own "Done when" allows
the recorded decision; closing is the Lead's call.
loom: a deepseek2 checkpoint had no recorded port path - the private …
loom: a deepseek2 checkpoint had no recorded port path - the private …
bong-water-water-bong commentedon Nov 24, 2026
Resolved on both halves of the issue's own "Done when".
(a) The private kit is recorded as the permanent home, and the starter gap is documented — merged as #3496 (main
50917a7a):KNOWN-ISSUES.mdgains theengine#3221record (in the loom: the hybrid route's NPU prefill -> Loom decode KV handover (L4 design: two caller-owned state roots, f16 attention cache + f32 GDN state) #3157 pattern): the decision, the starter gap with file:line evidence, the measured kernel/route evidence from this thread (not re-run), the corrected scope, what a future public-starter port would need, and the docs corrected with it.starter/gen_llm.py:84at loom-skillse4dd46e1:D in (64, 128, 256); GLM-4.7-Flash'skey_lengthis 576), and there is no MLA decomposition at all (0 matches for kv_lora / q_lora / compressed_kv / kv_a_proj / deepseek acrossgen_llm.py,inspect_gguf.py,inspect_safetensors.py).docs/hrx.mdanddocs/loom-route.mdnow say the weaver/loom-skills route holds only when the starter can express the architecture, and point at the record for when it cannot;tools/loom_arch_probe.pygains aDECIDEDtable (deepseek2) with a self-test arm; the card map's GLM gap note is corrected in both the generator and its build output.deepseek2— GLM-4.7-Flash and DeepSeek-Coder-V2-Lite. TheDeepSeek-R1-Distill-*GGUFs areqwen2and unaffected, so the original title's "whole DeepSeek-R1 class" over-stated it.(b) The serve smoke on strixhalo passes — GLM-4.7-Flash on the Loom route, shipped
loom-serve 0.3.0(e2c41a72) with theglm-pkgcard, onebox-hold bothticket as root:readyafter 2 s; compilation 91 commands / 521 kernels in 110 s (2,076 kernels reused, 0 warnings / 0 errors), 18.3 GB reserved in the pool;Paris,17 * 23 = 391, primes2, 3, 5, 7, 11— so the MLA programme serves, not just compiles.Not done here: a route entry still needs a published card and a gate row (#3385's publication decision + #3158's gate) — the kernels are verified on both GPUs and the port path is recorded, so that is delivery, not a port gap. Closing.
docs: trim kit internals from KNOWN-ISSUES #3221 and docs/npu.md, fix…