Repository navigation
LFM3: XNNPACK exports through an LFM3 definition ExecuTorch 1.5.1 lacks - #23
Merged
Merged
Conversation
…finition and its transformer cannot express one LiquidAI's LFM3-1.7B keeps LFM2's gated short convolutions and adds windowed attention layers, a second RoPE (theta 1e6 zero-tail partial on the global layers, 1e4 full on the windowed ones), a per-head sigmoid output gate, sandwich norms and a width-7 convolution. pipeline/lfm3_model.py builds it from ExecuTorch's own parts (RMSNorm, FeedForward, the KV cache and SDPA that export_llm swaps for its custom ops) and keeps the windowed layers' keys in a ring of window + prefill chunk slots. On the real checkpoint it matches the remote modeling_lfm3.py exactly on fp32 logits without a cache, and to 1.8e-4 with the custom ops, chunked prefill over the ring, 40 decode steps and a reset. - families/convert: the lfm3 family (XNNPACK only) and its tensor names - naming/eligibility: families exported ahead of the app's chat template (the app has none for LFM3 yet and refuses such files by name); the Kotlin port is unchanged - solve/hub: the fp32 teacher loads remote code for LFM3, downloaded at the pinned revision - transformers 5.22.1: LFM3's remote config does not load under 5.17.0 (KeyError: 'conv') Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…definition as finding 42 A finetune with LFM3's auto_map would otherwise have its own modeling code executed by the solve's fp32 teacher. remote_code_allowed admits a trusted publisher whose every auto_map entry is a module in the pinned snapshot (no repo--module references), and the teacher loads with local_files_only. PLAN's XNNPACK table and research finding 42 carry the measurements against modeling_lfm3.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… first token is not its decision
The gate reads one token. LFM3's template opens <think> in the generation prompt, so that
token was the first word of the reasoning ("The" or "We", fp32 at 0.52 to 0.73), and the
4-bit LFM3 files failed on quiet rows where they opened the reasoning with the other word
and called nothing. Qwen3's gates were blind the other way: <think> at 0.9999 on every row.
With enable_thinking=False the prompt ends in <think></think> and the next token is the
answer or <tool_call> (LFM3 fp32: <tool_call> at 1.000 on all 12 search rows). Templates
without the switch render as before; calibration is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing, not eleven full caches LFM3's five sliding-window layers keep window + prefill chunk slots (pipeline/lfm3_model.py) at any context, so the first reports put the 32k cache at 1.48 GB where it is 0.85. The per-token figure now counts the six full caches (24,576 B), the ring is its own report field (kv_cache_ring_bytes, 47 MB), and the card states both. Only LFM3 is sized this way: Gemma 3's configs name sliding layers too, and nothing here rings them. correct-reports fixes the published reports' figures in place, refusing any it cannot reproduce from the old sizing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
ResultsBuilt on an EC2 r7i.4xlarge (16 vCPU, 123 GiB) that published to Hugging Face itself and then stopped. All five windows are in experimentalmachines/LFM3-1.7B-ExecuTorch, and every file's sha256 on the Hub matches its export report.
The GPTQ solve covered 180 linears in 644 s. Two further commits on this branch came out of the run:
Tests: 330 passed. ruff is clean. 🤖 Generated with Claude Code |
…which superseded its full-cache caveat Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…let a named base checkpoint through on request Quiet rows now follow the rule the calling rows already had: a row fp32 itself splits says nothing about a regression (LFM3-1.7B on Pride and Prejudice at 0.27; LFM3-1.7B-Base on three of four at 0.09 to 0.39). verify marks a base checkpoint's gate as not measuring tool calling: LFM3-1.7B-Base puts a newline, not a call, first on every calling row. --allow-base on solve and export-xnnpack publishes a base checkpoint someone asked for by name; the watcher never passes it, so the chat-only default stands for everything it finds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion matches and exports but nothing ships until the apps move Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… finding 42 records LFM3-1.7B-Base The card told a reader of LFM3-1.7B-Base to render prompts with its chat template, which is the wrong advice for a model not trained on chat turns. It now opens by saying what a base checkpoint is; the published card was regenerated from its reports (Hub commit c2e3f94). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
LiquidAI released LFM3-1.7B on 2026-10-23. Neither transformers nor ExecuTorch 1.5.1, still the newest release, implements it, and 1.5.1's transformer can't express it:
ShortConvBlockis fixed at 3.What
pipeline/lfm3_model.py: the LFM3 model, built from ExecuTorch's own RMSNorm, FeedForward, KV cache and SDPA modules, whichexport_llmswaps for its custom ops. The windowed layers keep a ring of window + prefill-chunk slots onupdate_cache_with_indicesand a maskedcustom_sdpa. It is applied in every process that builds the model (export_with_codes --lfm3, the solve), the same way as the LFM2 state fix.families,convert: thelfm3family (XNNPACK only) and its tensor names.naming,eligibility: families exported ahead of the app's chat template (AHEAD_OF_APP). Neither app has an LFM3 template yet, so they refuse these files by name, and the model card says so. The Kotlin port itself is unchanged.solve,hub: the fp32 teacher runs remote code only from LiquidAI's own repos, only withauto_mapentries that point at local modules, and only withlocal_files_only.KeyError: 'conv').Evidence (finding 42)
On the real checkpoint (ac2586a3), fp32, compared with the checkpoint's own
modeling_lfm3.py:.ptethrough the C++ runtime (int8 embedding)The fp32 2k
.ptepassed the smoke test throughTextLLMRunner: it reasoned, then answered "Paris".Tests
327 passed. The new tests are in
tests/test_lfm3.py. ruff is clean.The GPTQ builds at 2k to 32k run on an EC2 box and publish to
experimentalmachines/LFM3-1.7B-ExecuTorch.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.