Skip to content

npu: convert a real d3 pack (qwen3_5) — names, the three transforms, two load fixes (#796 host rung) - #819

Merged
bong-water-water-bong merged 4 commits into
mainfrom
npu/d3-lite-converter
Nov 2, 2026
Merged

bong-water-water-bong merged 4 commits into
mainfrom
npu/d3-lite-converter

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Host rung of #796, engine-side half. The route (#653), the contract (#765) and the readout head (#763) are
already on main; this is the pack those run on. No device row, and none claimed — see the last section
for the one artifact that is still missing.

What it does

tools/safetensors_to_q4nx.py pack <pack> <model dir> --arch qwen3_5 (auto-detected from the pack's
language_model.* names, so plain pack works) converts a Decision-3.0 pack's backbone. Three transforms
are the whole point, because each one loads and computes garbage rather than failing when it is wrong —
each is named in the docstring and has a known-answer test:

from to transform
linear_attn.A_log linear_attn.ssm_a -exp(A_log), F32 — the forward evaluates expf(ssm_a * softplus(dt)), so the raw A_log decays backwards
linear_attn.conv1d.weight [CD,1,CK] linear_attn.ssm_conv1d.weight transpose to tap-major [CK,CD] — the forward indexes conv[j*CD + c] (q4nx_forward.cpp:1802)
linear_attn.in_proj_a/b ssm_alpha_proj/ssm_beta_proj rows zero-padded to 32 so they tile; the forward dequantises at the stored height and keeps the first NVH rows (deq_pad, :1640). q4_1 where the FLM config asks Q8_0 — a deviation verify measures (rel rms 0.078–0.086) instead of hiding

Everything else is a rename taken from configs/q4nx/qwen3.5_0.8b.json's q4nx_name column (in_proj_qkv
→ qkv_proj, in_proj_z → self_attn.gate_proj, out_proj → ssm_out_proj, dt_bias → ssm_dt.bias,
language_model.* → model.*), and visual.* is skipped because the forward runs the text path. An
unmapped language_model.* tensor is a refusal naming the tensor, never a silent drop.

Two bugs the engine found (both load failures, not opinions)

  1. The embedding was written 1-D, so model_load derived vocab=254279680 hidden=0 from
    shape[0]/shape[1] (model.c:890). bf16 tensors now keep the shape the source gave them.
  2. A d3 pack nests the text model under text_config, and the engine reads config.json at depth 1
    only
    (q4nx_semantics.c's value_for_top), so hidden_size stayed 0 and the layer count fell back to
    a default (num_hidden_layers (28) does not match the 24 layers). text_config's keys are now lifted to
    the top level; text_config itself is left in place.

A bug in my own plan generator, found by using it

tools/npu_plan.py's attn QKV N ignored attn_output_gate, so P1's plan asked for a 1024×3072 QKV
kernel on a container whose rows are 5120. The C side already doubles q under the gate
(npu/forward/src/q4nx_pack.c:150); the generator now does too, with a row in ctest npu_plan_generate.

Measured (this box, host-side only: no device opened; journalctl -k | grep -c "amdxdna.*ERROR" = 0 after every run)

Real pack, vllm-sr/d3-lite (1.7 GB, 473 tensors), at ~/models/npu/d3-lite-src:

row result
pack 8.6 s, 320 tensors, 821 MB, 153 visual skipped, 36 F32 (ssm_a + ssm_dt.bias × 18 GDN layers)
verify 320/320 tensors ok, worst q4_1 rel rms 0.0905 (layers.19.self_attn.v_proj [512,1024])
ssm_a 18/18 GDN layers exactly -exp(A_log), every value negative
ssm_conv1d 18/18 layers tap-major, 0 of 24576 entries out of place per layer
npu_plan.py on the converted dir 24 layers, 6 designs' worth of geometry; attn QKV now N=5120
the engine on the converted dir H=1024 NL=24 NH=8 NKV=2 HD=256 IM=3584 NV=248320, 18 GDN layers, attn_output_gate=1, derived 6 designs
ctest safetensors_to_q4nx npu_plan npu_plan_generate npu_sampling systemone_contract systemone_route decision_head 7/7 PASS, 26 new assertions
tools/copyright.py --check rc 0

What this does not do, and why

The engine accepts the container and then refuses by name at the one thing the box has not got:

forward init failed: plan .../plan.json: this model's plan needs the QKV kernel
"full_i8_QKV_K1024_N5120.elf" in ... (missing)

The forward asserts ELF existence even under NPU_INFER_HOST_GEMM=1 (q4nx_forward.cpp:874), so
#796's rung 1 ("loads and answers, no device needed") is gated on the same artifact as rung 2. Measured,
not inferred: the refusal above came from a host-GEMM run of the converted pack.

The set is six designs for this geometry, not seven — GDN's ssm_out reuses O:

design K N on this box
QKV (full-attn, q|gate|k|v) 1024 5120 missing
O (also GDN ssm_out) 2048 1024 exists (1bit-MONSTER-iso-build/.../xclbins)
GU 1024 7168 missing
D 3584 1024 missing
GDN QKV 1024 6144 missing (the 0.6B set has GU_K1024_N6144: same GEMM, different role name)
Z (GDN gate) 1024 2048 missing

#796's table has QKV 1024×1536 and O 1024×1024, which do not match the pack: its full attention has
head_dim 256, 8/2 heads and attn_output_gate: true, so q_proj is [4096,1024] (+ the gate) and
o_proj is [1024,2048]. The issue is being corrected in a comment, not left for the kernel build to
discover.

No accuracy row, no parity-vs-d3_runtime.py row: both need the backbone to run, i.e. that set.
Refs #796.

…and two load fixes (engine #796)

`tools/safetensors_to_q4nx.py pack --arch qwen3_5` now converts a Decision-3.0 pack's
backbone: `language_model.*` -> the names Q4nxNpuForward loads (configs/q4nx/qwen3.5_0.8b.json's
q4nx_name column is the authority), `visual.*` skipped as the text path, and the three GDN
transforms that load and compute garbage when they are wrong:

  A_log -> ssm_a          -exp(A_log), F32 (the forward does expf(ssm_a * softplus(dt)))
  conv1d [CD,1,CK]        transposed to tap-major [CK,CD]: the forward indexes conv[j*CD + c]
  in_proj_a/b             rows zero-padded to 32 so they tile (q4_1 where the FLM config asks
                          Q8_0 - a deviation verify() measures, not one it hides)

Two converter bugs the engine found, both load failures rather than opinions:

  * the embedding was written 1-D, so model_load derived "vocab=254279680 hidden=0" from
    shape[0]/shape[1] (model.c:890).  bf16 tensors now keep the source shape.
  * a d3 pack nests the text model under text_config and the engine reads config.json at
    depth 1 only (q4nx_semantics.c's value_for_top), so hidden_size stayed 0 and the layer
    count fell back to a default; text_config's keys are now lifted to the top level.

Also fixes tools/npu_plan.py: the attn QKV N ignored `attn_output_gate`, so the plan asked for
a 1024x3072 QKV kernel on a container whose rows are 5120 (npu/forward/src/q4nx_pack.c:150 is
the doubling the C side already does).  Found by running the generator on the real pack.

Measured on this box, host-side only (no device opened, `journalctl -k | grep -c amdxdna.*ERROR`
= 0 after every run):

  * the real vllm-sr/d3-lite pack (1.7 GB, 473 tensors) converts in 8.6 s: 320 tensors,
    821 MB, 153 visual skipped, 36 F32 (ssm_a + ssm_dt.bias for 18 GDN layers)
  * `verify`: 320/320 tensors ok, worst q4_1 rel rms 0.0905
    (model.layers.19.self_attn.v_proj.weight [512,1024])
  * known answers on the real weights: 18/18 GDN layers have ssm_a == -exp(A_log) exactly and
    every value negative; 18/18 conv1d are tap-major with 0 of 24576 entries out of place
  * the engine accepts the container: H=1024 NL=24 NH=8 NKV=2 HD=256 IM=3584 NV=248320,
    18 GDN layers, attn_output_gate=1, "derived 6 designs", then refuses by name at the one
    artifact the box does not have:
      forward init failed: plan .../plan.json: this model's plan needs the QKV kernel
      "full_i8_QKV_K1024_N5120.elf" in ... (missing)

So the host rung stops one step short of "loads and answers", and not for a code reason: the
forward asserts ELF existence even under NPU_INFER_HOST_GEMM=1, so the remaining item is the
six-design set for this geometry (QKV 1024x5120, O 2048x1024, GU 1024x7168, D 3584x1024,
GDN QKV 1024x6144, Z 1024x2048 - O is shared with GDN's ssm_out, so six and not seven).

Tests: ctest safetensors_to_q4nx gains a d3-shaped fixture (renames, all three transforms with
known answers, the 2-D embedding, the lifted config, the refusal for an unmapped tensor);
ctest npu_plan_generate gains the attn_output_gate row.  26 new assertions, 7/7 green,
tools/copyright.py --check rc 0.
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 141176f)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

796 - Partially compliant

Compliant requirements:

  • Host-side conversion of the real d3 pack with proper name mapping and three transforms
  • The converter handles non-2-D tensors correctly (235 non-2-D tensors)
  • Name map from HF names to llama.cpp-style names using the authority in configs/q4nx/qwen3.5_0.8b.json
  • Three transforms with known-answer checks instead of silently failing
  • The real pack converts and loads under NPU_INFER_HOST_GEMM=1
  • Numeric parity against the pack's own d3_runtime.py with three transforms covered by known-answer tests

Non-compliant requirements:

  • Device-side ELF set for the 0.8B-GDN geometry (7 designs) - not covered in this PR

Requires further human verification:

  • Verification that the ELF set is correctly implemented and available for device-side execution
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect tensor shape handling for conv1d

The transform for linear_attn.conv1d.weight assumes a specific shape [CD, 1, CK] but doesn't validate that the actual tensor dimensions match this expectation. If a tensor with a different shape is encountered, it could lead to incorrect transposition or data corruption. The code should explicitly check the tensor shape and raise an error if it doesn't match the expected format.

if w.ndim != 3 or w.shape[1] != 1:
    raise SystemExit(f"{name}: conv1d is expected as [CD, 1, CK], got {list(w.shape)}")
return np.ascontiguousarray(w.reshape(w.shape[0], w.shape[2]).T).reshape(-1), None
Potential silent failure in alpha/beta padding

The padding of alpha/beta rows to 32 rows for tiling may silently fail if the tensor dimensions are not properly handled. If the tensor has more than 32 rows, the padding logic may not correctly zero-pad the excess rows, leading to incorrect data being written. The code should validate that the padding is applied correctly and that the excess rows are properly zeroed.

prows = -(-w.shape[0] // ROWS) * ROWS
if prows == w.shape[0]:
    return w, None
out = np.zeros((prows, w.shape[1]), dtype=np.float32)
out[:w.shape[0]] = w
return out, None
Missing test coverage for edge cases in transforms

The test suite covers the main transforms but lacks comprehensive edge case testing. Specifically, there's no test for handling tensors with shapes that are not exactly divisible by 32 for padding, or tensors with unexpected shapes for conv1d. These edge cases could lead to silent failures or incorrect behavior in production.

# ---- the d3 pack's convention: language_model.* names, GDN renames, three transforms
q = qwen35_model(os.path.join(tmp, "hf_qwen35"))
qout = os.path.join(tmp, "q4nx_qwen35")
r7 = run("pack", q["dir"], qout)
check(r7.returncode == 0, f"a qwen3_5 pack converts (stderr: {r7.stderr[-300:]})")
check("arch qwen3_5" in r7.stdout, "the arch is detected from the language_model.* names")
t, d = read_q4nx(os.path.join(qout, "model.q4nx"))
check(not any(n.startswith(("language_model.", "visual.")) for n in t),
      "nothing keeps its HF name and no visual tensor is written")
check("skipped 1 tensor(s)" in r7.stdout, "the skipped visual tensor is counted, not silent")
# the renames the engine loads (configs/q4nx/qwen3.5_0.8b.json's q4nx_name column)
for hf, want in (("in_proj_qkv.weight", "linear_attn.qkv_proj.weight"),
                 ("in_proj_z.weight", "self_attn.gate_proj.weight"),
                 ("in_proj_a.weight", "linear_attn.ssm_alpha_proj.weight"),
                 ("in_proj_b.weight", "linear_attn.ssm_beta_proj.weight"),
                 ("out_proj.weight", "linear_attn.ssm_out_proj.weight"),
                 ("conv1d.weight", "linear_attn.ssm_conv1d.weight"),
                 ("norm.weight", "linear_attn.ssm_norm.weight"),
                 ("A_log", "linear_attn.ssm_a"),
                 ("dt_bias", "linear_attn.ssm_dt.bias")):
    qn = f"model.layers.0.{want}"
    check(qn in t, f"linear_attn.{hf} -> {want}")
check("model.embed_tokens.weight" in t and "model.norm.weight" in t,
      "embed_tokens and the final norm keep their engine names")
check(t["model.embed_tokens.weight"]["shape"] == [8, H],
      "the embedding keeps its 2-D shape (model_load reads vocab/hidden off it)")
qcfg = json.load(open(os.path.join(qout, "config.json")))
check(qcfg.get("num_hidden_layers") == 2 and qcfg.get("hidden_size") == H,
      "text_config's keys are lifted to the top level, where the engine reads them")
check(qcfg["text_config"]["num_hidden_layers"] == 2, "text_config itself is left in place")
check("model.layers.1.self_attn.q_proj.weight" in t, "a full-attention layer keeps its names")

# transform 1: A_log -> ssm_a = -exp(A_log), F32 (the engine's expf(ssm_a*softplus(dt)))
ent = t["model.layers.0.linear_attn.ssm_a"]
check(ent["dtype"] == "F32", "ssm_a is F32, which is what the loader reads")
lo, hi = ent["data_offsets"]
got = np.frombuffer(d[lo:hi], dtype=np.float32)
check(np.array_equal(got, (-np.exp(bf16r(q["A_log"]))).astype(np.float32)),
      "ssm_a is exactly -exp(A_log)")
check(bool((got < 0).all()), "every ssm_a is negative (a positive one decays backwards)")

# ... and dt_bias is carried raw, in F32
ent = t["model.layers.0.linear_attn.ssm_dt.bias"]
check(ent["dtype"] == "F32", "ssm_dt.bias is F32")
lo, hi = ent["data_offsets"]
check(np.array_equal(np.frombuffer(d[lo:hi], dtype=np.float32), bf16r(q["dt_bias"])),
      "ssm_dt.bias is the pack's dt_bias, unchanged")

# transform 2: conv1d [CD,1,CK] -> tap-major [CK,CD], the engine's conv[j*CD + c]
ent = t["model.layers.0.linear_attn.ssm_conv1d.weight"]
check(ent["dtype"] == "BF16" and ent["shape"][0] == CD * CK, "conv1d is 1-D bf16 [CK*CD]")
lo, hi = ent["data_offsets"]
conv = Q.from_bf16(np.frombuffer(d[lo:hi], dtype=np.uint16))
src_conv = bf16r(q["conv1d"])             # [CD, 1, CK], as stored
wrong = sum(1 for j in range(CK) for c in range(0, CD, 7)
            if conv[j * CD + c] != src_conv[c, 0, j])
check(wrong == 0, f"conv entry j*CD+c holds conv[c,0,j] ({wrong} mismatches)")
check(conv[0] != conv[CD], "the transpose is not a flatten (tap 0 and tap 1 differ)")

# transform 3: alpha/beta rows zero-padded to 32 so they tile as q4_1
for suffix in ("ssm_alpha_proj", "ssm_beta_proj"):
    ent = t[f"model.layers.0.linear_attn.{suffix}.weight"]
    check(ent["dtype"] == "I8", f"{suffix} packs as tiles")
    check(ent["shape"][0] == NVH // Q.ROWS + 1,
          f"{suffix} is padded to 32 rows ({ent['shape'][0]} tiles)")
    lo, hi = ent["data_offsets"]
    back = Q.untile(np.frombuffer(d[lo:hi], dtype=np.uint8).reshape(-1, Q.TILE), 32, H)
    src = bf16r(q["alpha"] if suffix == "ssm_alpha_proj" else q["beta"])
    rel = float(np.sqrt(((back[:NVH] - src) ** 2).mean()) / np.sqrt((src ** 2).mean()))
    check(rel < 0.15, f"{suffix} decodes back to the source rows (rel rms {rel:.4f})")
    check(float(np.abs(back[NVH:]).max()) == 0.0 if NVH < 32 else True,
          f"{suffix} pad rows decode to zero")

v7 = run("verify", q["dir"], qout)
check(v7.returncode == 0, f"verify accepts the converted d3 pack (out: {v7.stdout[-300:]})")
check("MISSING" not in v7.stdout, "verify finds every renamed tensor")

# ---- refusals: an unmapped qwen3_5 tensor is an error, not a silent drop
bogus = qwen35_model(os.path.join(tmp, "hf_qwen35_bad"))
write_safetensors(os.path.join(bogus["dir"], "model.safetensors"),
                  {**bogus["weights"],
                   "language_model.layers.0.linear_attn.in_proj_mystery.weight":
                       rng.standard_normal((32, 256)).astype(np.float32)})
r8 = run("pack", bogus["dir"], os.path.join(tmp, "q4nx_bogus"))
check(r8.returncode != 0 and "in_proj_mystery" in (r8.stderr + r8.stdout),
      "an unmapped language_model tensor is refused by name")

@bong-water-water-bong bong-water-water-bong added the tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied label Nov 2, 2026

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at d540d8d (tprs-ready applied)

Converted the real pack myself (~/models/npu/d3-lite-src, 1.7 GB, 473 tensors) into a fresh output dir and
re-derived each row of your table; the three transforms are exact on the box, not just in the known-answer tests.

$ python3 tools/safetensors_to_q4nx.py pack ~/models/npu/d3-lite-src /var/tmp/d3-tprs --arch qwen3_5
wrote …/model.q4nx (820971656 bytes, 320 tensors)      skipped 153 tensor(s) (visual.*, the text path)
$ python3 tools/safetensors_to_q4nx.py verify … --arch qwen3_5
320/320 tensors ok       36 f32 rows max err 0       98 bf16 rows        186 q4_1 rows
worst q4_1 rel rms 0.0905  model.layers.19.self_attn.v_proj.weight        <- your number exactly

Independent of the tool's own transform (my own numpy against the source safetensors, reading the container's
raw entries, so verify's max err 0 is not circular):

ssm_a      18/18 GDN layers exactly -exp(A_log), bit for bit, every value < 0
ssm_conv1d 18/18 tap-major: [tap][channel] matches to 0.0 over 24,576 entries per layer
           (the untransposed [channel][tap] ordering differs by up to 1.78 — the wrong order is detectable)
  • tools/npu_plan.py /var/tmp/d3-tprs → 24 layers, gate/up fused, layout rm; the six full-attention layers
    (3, 7, 11, 15, 19, 23) carry qkv K=1024 N=5120
    and the GDN layers N=6144, i.e. the attn_output_gate
    doubling is in the plan, which is the bug you found in your own generator.
  • python3 tests/safetensors_to_q4nx_test.py → ok; python3 tests/npu_plan_generate_test.py tools/npu_plan.py →
    npu_plan_generate: ok; python3 tools/copyright.py --check → rc 0.
  • 820,971,656 B for 320 tensors and 36 F32 rows (ssm_a + ssm_dt.bias × 18 layers) — both as the body states.

Not verified by me, as the body says: the engine's load and its refusal naming
full_i8_QKV_K1024_N5120.elf, and the six-design table. That needs the NPU lane, the owner's :18097 serve holds the
device and I did not touch it. Worth one line when the kernel set lands: the refusal asserts ELF existence even under
NPU_INFER_HOST_GEMM=1, so #796's rung 1 is gated on the same artifact as rung 2 — that is a finding, and it reads
correctly as one in the body rather than as a missing feature.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 2ff8154

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 4ab97b0

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 141176f

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at 141176f2f (head after #817 merged; tprs-ready already on)

141176f merges main 8273eb3 (#817). Third head, same content, re-checked at it:

  • own diff is still the five files (tools/safetensors_to_q4nx.py +175/−14, tools/npu_plan.py +7/−1,
    tests/safetensors_to_q4nx_test.py +155, tests/npu_plan_generate_test.py +13/−3, docs/npu.md +24), and all five
    are byte-identical to the head I reviewed (d540d8d);
  • re-ran the real conversion at this head: pack → 820971656 bytes, 320 tensors (153 visual skipped), verify →
    320/320 tensors ok, worst q4_1 rel rms 0.0905 on model.layers.19.self_attn.v_proj.weight, plan → 24 layers
    with the six full-attention layers at qkv N=5120;
  • CI on this head: build, CodeQL, all four Analyze jobs and pr_agent success (283 s), hw_gate skipped;
    mergeable_state=clean.

(CodeQL reads neutral for a couple of minutes while its four Analyze jobs are still running, then flips to
success — worth knowing before anyone reads a neutral as a skip. It is success on this head.)

Unchanged from my first verdict: the engine-side load and the missing-ELF refusal are not verified by me (that is the
NPU lane, and the six-design table is the detail the kernel set will confirm).

@bong-water-water-bong
bong-water-water-bong merged commit eb3ca76 into main Nov 2, 2026
8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the npu/d3-lite-converter branch November 2, 2026 15:28
bong-water-water-bong added a commit that referenced this pull request Nov 2, 2026
…824)

#819 taught tools/npu_plan.py that a qwen3_5 model with attn_output_gate emits
q|gate, so a full-attention layer's fused QKV is (2*nh + 2*nkv) * hd rows.  It
fixed the generator and left the four committed reference plans alone, so three
of them (both 27B models and the pb16i twins) still asked for
K5120 N8192 on their 16 full-attention layers: q + k + v with no gate.

The container decides it: bonsai2-27b-NPU/model.q4nx layer 3 holds
q_proj [7680,5120] and k/v [640,5120], and the int8 packing factor is 1.6
(mlp.gate_proj [10880,5120] -> 17408, o_proj [3840,5120] -> 6144,
linear_attn.qkv_proj [6400,5120] -> 10240, all 1.6), so q|gate is 12288 and the
fused QKV is 12288 + 1024 + 1024 = 14336.

Regenerated with the merged tool; the only change is that one number on each of
the 16 attn layers (16 lines per file).  Every field the forward reads today
(kernels.tag, decode.sealed_elf, fusion.gate_up, moe.batched_expert_gu,
decode.dirs) is byte-identical, which is also why this was inert: the runtime
takes the layer count from layers[] and derives design K/N from the model's
dimensions, so no launch read the stale numbers.  It matters to anything that
starts trusting per-layer geometry (P4's NpuTarget, a future per-layer kernel
selection) -- a plan that names a kernel the container cannot hold is the exact
failure P1 exists to remove.

Co-authored-by: bong-water-water-bong <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 2, 2026
…s still answers (#796) (#833)

The forward asserted the geometry->artifact mapping in host-GEMM mode too, so
NPU_INFER_HOST_GEMM=1 refused to load any model whose kernel set had not been
built yet:

  forward init failed: plan .../plan.json: this model's plan needs the QKV
  kernel "full_i8_QKV_K1024_N5120.elf" in ... (missing)

That made engine #796's rung 1 ("loads and answers with no device") gated on
the same six AIE designs as the device rung.  Host GEMMs are plain float
matmuls over the decoded weights: no ELF is opened on this path, so none is
required.  The artifact is still named when it is on disk; when it is not, the
role logs the geometry and the missing name instead of failing.  The device
path keeps every check it had (file_exists + init_elf), and the ELF set itself
is what tests/verify_design_elfs + tests/verify_full_elfs.sh check.

Measured on the real vllm-sr/d3-lite pack converted by #819 (320 tensors,
782 MB, host 1024, 24 layers, 18 GDN layers), NPU_INFER_HOST_GEMM=1, one
npu-hold ticket, no device opened:

  [forward] QKV M=128 K=1024 N=5120  (host-GEMM, no ELF: full_i8_QKV_K1024_N5120.elf)
  ... six designs, all "no ELF"
  ready in 2 s; /v1/systemone answers choice, noul and score; probabilities sum
  to 1.000000; a malformed sibling still 422s the whole request; 0 amdxdna errors

This does not claim accuracy: the numbers are the engine's own host-GEMM answer
over the converted weights, and parity against the pack's d3_runtime.py is not
measured here.

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 3/5 tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant