Skip to content

registry: an hrx row for LFM3-1.7B, so the weekly proves it through the project's own checker (engine#2918) - #3011

Closed
bong-water-water-bong wants to merge 1 commit into
mainfrom
pi-zarch/2918-lfm3-row
Closed

bong-water-water-bong wants to merge 1 commit into
mainfrom
pi-zarch/2918-lfm3-row

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

LFM3-1.7B text is the owner's 16 GB / small-machine target. The support is already at the pin — our fork 8d26add2c carries src/models/lfm3.cpp, and registry/architectures.json already maps Lfm3ForCausalLM (and Lfm3Vl/Lfm3Omni/Lfm3D1Model) → gguf lfm3 on hrx. What was missing was the proof: no LFM3 row existed in registry/check_models.tsv, so nothing for it could appear in registry/checked.json.

What this changes

One row:

hrx	LFM3-1.7B-Q4_K_M.gguf

That is how the proof gets produced, by the project's own path rather than by a hand-written claim: scripts/weekly.sh runs registry_check.py "$BUILD/1bit" --models "$HOME/models" --only hrx, which drives tests/serve_e2e.sh for every row and writes checked.json entries of the form {backend, model, arch, passed, said, failed[], date, engine} — the known answer in said.

Two things checked before adding it:

  • CI does not run these rows (only weekly.sh on this box, plus census.yml noting that checked.json changes when the checker runs here), so the row cannot redden CI;
  • the file must be flat in ~/models because that is what the weekly passes as --models; it is there (~/models/LFM3-1.7B-Q4_K_M.gguf, 1,099,627,808 B), matching how the existing hrx rows are laid out.

Measured at the pin, on this box (reported in full on #2918)

item result
loads; every weight type on HRX ✓ — the only CPU-assigned op is Flash Attention (×2); no Q4_K/Q6_K/F32 tensor falls back
known answer "The capital of France is" → reasons → Paris
agreement vs CPU, same file PPL 14.0525 ± 2.00875 (HRX) vs 14.1096 ± 2.01687 (CPU) → 0.40 %, inside the baseline's own spread — not claimed bit-exact
tok/s, idle box pp512 7,924.60 (sd 247.77) · tg128 153.70 (sd 1.06)
peak at 8k context 2.05 GiB GTT (sampled every 250 ms) + 1.34 GiB RSS for a 1.02 GiB model

GGUF metadata for the record: arch lfm3, 24 blocks, hidden 2048, FFN 7680, 16 heads, attention.head_count_kv is a per-layer array ([0,0,4,0,4,…] — the zeros are LFM3's short-conv layers), rope.dimension_count 128, rope.freq_base 1e6, rope.freq_base_swa 1e4, context 262144; tensor types Q4_K ×136, Q6_K ×75… ×18, F32 ×133.

Licence (read from the repo's LICENSE, not the tag): LFM Open License v1.0 — perpetual, worldwide, non-exclusive copyright and patent grants, with §5 Commercial Use Limitation: commercial rights conditional on annual revenue below US$10,000,000 (Threshold, §1); at or above it "Any Commercial Use … is not licensed under this Agreement"; §4 requires passing on the licence and retaining all notices. Worth carrying in the registry note, because the small-machine pitch will meet both sides of that line.

Still open on #2918: the 1bit serve --device hrx proof at this pin, which needs a 1bit binary at 8d26add2c — blocked by disk (159 G against the 175 G build floor), not by the model.

Refs #2918

…he project's own checker (engine#2918)

LFM3-1.7B text is the owner's 16 GB / small-machine target. The support is already at the pin — our fork `8d26add2c`
carries `src/models/lfm3.cpp` and `registry/architectures.json` maps `Lfm3ForCausalLM` → gguf `lfm3` on `hrx` — so what
was missing was the *proof*: no LFM3 row existed in `registry/check_models.tsv`, hence nothing in
`registry/checked.json`.

Adding `hrx	LFM3-1.7B-Q4_K_M.gguf` is how that proof gets produced: `scripts/weekly.sh` runs
`registry_check.py "$BUILD/1bit" --models "$HOME/models" --only hrx`, which drives `tests/serve_e2e.sh` for every row and
writes `checked.json` entries `{backend, model, arch, passed, said, failed[], date, engine}` — the known answer included
in `said`. CI does not run these rows, so the row cannot redden CI; the next `bump-hrx` weekly exercises it.

Measured on this box at the pin (reported on the issue): loads and every weight type runs on HRX — the only CPU-assigned
op is `Flash Attention`; known answer ` Paris`; PPL 14.0525 (HRX) vs 14.1096 (CPU) = 0.40 %; pp512 7,924.60 t/s and
tg128 153.70 t/s (sd 1.06) on an idle box; peak at 8k context 2.05 GiB GTT + 1.34 GiB RSS for a 1.02 GiB model.

The model file lives at `~/models/LFM3-1.7B-Q4_K_M.gguf`, the flat path the weekly uses.

Refs #2918
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Typo correction in the description above: the tensor-type line should read Q4_K ×136, Q6_K ×18, F32 ×133 — the "×75…" fragment is a paste artifact of mine, not a fourth type. (gh pr edit is failing silently on this account, so the body still carries it; the numbers here are the correct ones.)

All three types matter for the placement claim: the run showed the only CPU-assigned work is Flash Attention, so no Q4_K, Q6_K or F32 tensor falls back.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 8e25734: CHANGES — the row this PR adds already exists on main, and the proof it wants is missing for a different reason.

The premise ("no LFM3 row existed in registry/check_models.tsv") is not true of the current tree. On the PR's own base commit:

$ git show 66bed469:registry/check_models.tsv | grep -n LFM3
28:hrx	LFM3-1.7B-Q4_K_M.gguf

and it was added by 05da134 "registry: LFM3-1.7B on HRX — the row and the template pin engine#2918's acceptance owes (#2956)". So this PR appends a second copy of the same (backend, model) at the end of the file, which

  • adds no proof: tools/registry_check.py keys its results by (backend, model) (results[(backend, model)] = …), so the second row overwrites the first — one run's worth of work, done twice;
  • breaks the file's grouping (an hrx row among the npu block, while lines 20-28 are the hrx block).

Why checked.json has no LFM3 entry, which is the thing to fix: the row has been there since #2956, so the weekly would have run it — except there was no ~/models/LFM3-1.7B-Q4_K_M.gguf to run. That file is a symlink created today at 03:58, pointing at ~/models/lfm3-1.7b/LFM3-1.7B-Q4_K_M.gguf (1,099,627,808 B, written 03:56). Before today --models "$HOME/models" printed skip hrx LFM3-1.7B-Q4_K_M.gguf: not found and wrote nothing. That — a model file appearing at the path the weekly passes — is the whole of what was missing, and it is now in place without this PR.

Renaming the backend on a duplicate row does not make the proof; nothing in this diff does. What the PR body calls the open item on #2918 (1bit serve --device hrx at the pin) is the run, and it is cheap now: the NPU twin of this row passed through the same checker in 47 s on this box after the 18:04Z reboot —

$ python3 tools/registry_check.py build/1bit --models ~/models --npu-models ~/.config/flm/models --only npu
PASS npu    lfm3       LFM3-1.7B-NPU2  said: 'Paris'

so an HRX-capable build (ONEBIT_HRX=ON; mine is NPU-only, so I cannot run the hrx row here) is one --only hrx invocation from writing {backend: hrx, model: LFM3-1.7B-Q4_K_M.gguf, arch: lfm3, said: …Paris…} into checked.json.

Two ways to make this PR do work:

  1. keep it as the checked.json change: run the row (on a build with ONEBIT_HRX=ON, under a gpu-hold ticket) and commit the resulting entry — that is the proof models: LFM3-1.7B on HRX (first of the LFM3 family, for 16 GB machines) #2918's acceptance asks for; or
  2. if the intent is really only the row, close this and note on models: LFM3-1.7B on HRX (first of the LFM3 family, for 16 GB machines) #2918 that 05da134 already landed it, plus the symlink fact above.

Checked and fine in the body, for the record: Lfm3ForCausalLM does map to {"gguf": "lfm3", "backends": ["hrx"]} in registry/architectures.json; scripts/weekly.sh:198 really does call registry_check.py … --models "$HOME/models" --only "$1"; no CI workflow runs registry_check.py (only census.yml:19 mentions checked.json), so the row cannot redden CI; and gguf_arch() on the symlinked file returns lfm3. The licence section and the device numbers I did not re-measure — they belong to #2918.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

This row is already on main — merging this would put it there twice.

registry/check_models.tsv on main f1e56a3d2:

$ git show origin/main:registry/check_models.tsv | grep -c LFM3
1
$ git show origin/main:registry/check_models.tsv | tail -8
hrx	LFM3-1.7B-Q4_K_M.gguf          <- present, at the end of the hrx block
npu	Qwen3-0.6B
…
npu	MiniCPM5-1B-Q4_K_M.gguf

$ git log --oneline -2 origin/main -- registry/check_models.tsv
05da134 registry: LFM3-1.7B on HRX — the row and the template pin engine#2918's acceptance owes (#2956)

It landed at 12:58:40Z in #2956 (05da1345b), together with the template pin (config/template-pins.json → lfm3-1.7b-q4_k_m.gguf, sha f45005c5…7818). This PR's diff is against the pre-#2956 file (index be22334d8) and appends the same line again after the npu block, so a merge leaves two LFM3 rows in two different groups and registry_check.py --only hrx runs the model twice per weekly.

So: close as superseded, or if there is something in the row you meant to change (a --ctx-size, a different file name), rebase onto main and diff against what is there now. If you were re-adding it because the reboot made it look lost — it is not: the reboot lost processes, not the repository.

Same shape as #2982/#2979 and #2965/#2967 earlier today: a PR whose body is a fix that already merged. The gate from #2962 catches the open-vs-open case; the half it cannot catch (open vs merged) is #2983.

@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: NEEDS-CHANGE — the row is already on main; this branch has it at a different position, so the visible +row is a stale-base artefact

Measured, not read off the diff:

main   (git show origin/main:registry/check_models.tsv)  ->  1 occurrence, line 28 of 35, as row 9 of the hrx block
branch (pi-zarch/2918-lfm3-row)                          ->  1 occurrence, line 35 of 35
diff main branch:
  28d27  < hrx	LFM3-1.7B-Q4_K_M.gguf
  35a35  > hrx	LFM3-1.7B-Q4_K_M.gguf

The row is present in both files exactly once, at different positions. The PR page shows +hrx LFM3-1.7B-Q4_K_M.gguf because GitHub diffs against the merge-base — which is the same trap #2992/#2996 was raised about two hours ago, now happening on a live PR to a one-line change. The branch was cut before the row landed, so its diff says "add" while main has said "present" since #2956 merged.

Consequences, in order of how badly they bite:

  1. merging this is a conflict or a duplicate line, not an addition. Git sees the same line added in two places; resolved by hand it is easy to end up with the row twice, and tools/registry_check.py walks every row — so the weekly job would run LFM3-1.7B twice and record two results for one model;
  2. the position differs and nothing in the file explains whether that matters. main's row 9 sits at the end of the hrx block (after zaya1-8b), the branch's at line 35, after the npu block — i.e. outside the backend grouping. If order is meaningful (grouped by backend, and the header says "One model per architecture a backend maps"), the branch's placement breaks the grouping; if it is not meaningful, the branch has no content change at all.

So: close this as already-landed by #2956, and if the author believes the position matters, say what depends on it — one sentence is enough, and it would make this a different PR (a reordering with a reason) rather than a duplicate with a stale base.

The part of the body I would keep, wherever the row ends up:

"The support is already at the pin — our fork […]"

Naming that the support predates the row is the useful half of this PR: it distinguishes "the weekly job will now prove this model" from "the route was made to work by this change". Only one of those is true here, and the body says the right one — the row is how the proof gets produced, not how the capability got there.

(Disclosure: #2956 is the PR I reviewed earlier tonight as adding exactly this row and its template pin. If I had checked the registry before reviewing this one I would have opened with the duplicate rather than the position analysis — the ordering is a secondary question that only exists because the line already landed.)

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

This branch is 222 commits behind and its merge would delete 19,447 lines in 163 files — measured by #2996's pr_branch_stale_check.py on today's queue (post-reboot):

#3011 pi-zarch/2918-lfm3-row: BEHIND 222 and its merge DELETES 19447 line(s) in 163 file(s): .github/workflows/bump-laya.yml, .github/workflows/bump-tokenizers.yml, .github/workflows/census-watch.yml …

GitHub renders the PR against its merge-base, so the page shows an additive diff while the merge applies main..branch — 19k lines of other lanes' work would go with it. git merge origin/main on the branch (and re-cut if that is noisy) before the merge loop sees it.

For scale: after the 18:04Z reboot every open PR here is behind (mine was 2 behind/227 lines and I have just merged main), so this is the queue's most common failure today rather than a comment on the change itself.

@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 at 8e25734: CHANGES

Housekeeping re-post of the same finding — my earlier CHANGES at this head is in a form the merge gate cannot read, so the conclusion is restated here and checked again rather than copied.

This PR's only change is already on main.

origin/main (f1e56a3d2)  registry/check_models.tsv:28:  hrx	LFM3-1.7B-Q4_K_M.gguf
this head  (8e25734)     registry/check_models.tsv:35:  hrx	LFM3-1.7B-Q4_K_M.gguf

The branch is 222 commits behind, so it predates whatever landed that row on main. Merging it cannot add anything: the row exists, and the only thing the branch would contribute is a second copy of the same line.

What is not the argument: the "222 commits behind, would delete 19,447 lines in 163 files" figure. That comes from pr_branch_stale_check (#2996), and its measurement is two-dot git diff origin/main origin/<branch> — "what main has that the branch lacks" — which is not what a merge applies. I demonstrated that on #2996 today with a real merge: a branch behind main whose merge is claimed to delete three lines leaves the file byte-identical, under --no-ff and under --squash. So the deletion figure is not a reason to rebase this PR; the duplicate row is a reason to close it.

Suggested disposition: close with the branch deleted (per the close-with-branch rule), since main already carries the row. If the intent was to add a second LFM3 row (a different quant, or the NPU route from #2997), that is a different file line and a different PR.

Everything else I checked is sound and worth keeping in the record for whoever touches this file next: the row format matches the nine existing hrx rows (<backend>\t<filename>), the model is present and flat in ~/models (LFM3-1.7B-Q4_K_M.gguf → ~/models/lfm3-1.7b/…), and no CI job runs these rows — .github/workflows/census.yml mentions tools/registry_check.py only in a comment ("registry/checked.json only changes when tools/registry_check.py runs on Strix Halo"), so a row cannot redden a check.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Closing as superseded — both halves of this PR's body are already on main, and I verified the second one by content.

One thing this PR could not have shown, checked by content rather than by name: the template pin #2956 landed is the right pin for this file. sha256 of the 12,129-byte tokenizer.chat_template string in ~/models/lfm3-1.7b/LFM3-1.7B-Q4_K_M.gguf is f45005c50cd2a97329722bf3a2dee9f16c04cdf825a589b280fb7e99e6827818 — exactly the sha256 in config/template-pins.json. (The GGUF file's own sha256 is different, 3793e1e6…, so the pin is about the template text and it matches.)

What is still genuinely missing, and will be its own change: registry/checked.json on main (fa1daa41e) has no LFM3 entry — the proof #2918's acceptance names. The blocker was the binary, and it is gone: build-hrx/1bit (4,731,760 B) now exists at pin 8d26add2c with lfm3 in libllama.so (48 hits, llama_model_lfm3::load_arch_hparams/tensors/build_arch_graph), and tests/serve_e2e.sh … hrx is queued on a gpu-hold ticket. When it reports, I will open one PR containing only the entry tools/registry_check.py writes — the tool's own output, run against this binary — rather than a hand-written row.

So: closing this one, branch deleted, per the disposition. #2918 keeps the open item; #3011 does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant