Skip to content

lfm3: admit official MLX text and VL checkpoints - #1513

Merged
ashhart merged 6 commits into
ashhart:mainfrom
BlivionIaG:feature/lfm3-admission
Nov 1, 2026
Merged

ashhart merged 6 commits into
ashhart:mainfrom
BlivionIaG:feature/lfm3-admission

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Change

Admit official LiquidAI LFM3-1.7B and LFM3-VL-2B MLX 4/6/8-bit metadata, without registering inference. Validate family geometry, quantization layouts and tensor headers. Add a host inspector and rejection tests through the normal build graph.

Refs #1491. This is the admission foundation requested in #1502; text inference in #1514 builds on this, with VL #1502 stacked above text. The original admission commit and authorship are preserved. CUDA follow-up #1508 already carries a cherry-pick of that admission.

Code pointers

Verification

Pinned base: b30d5b9d3. Zig 0.17.0, macOS 26.5.1, M4 Pro 48 GB: zig build test-lfm3-host tf-lfm3-check -Dcpu=apple_m1 passed 8/8 steps and 13/13 host tests; the admission Python suite passed 12/12. This slice performs no GPU inference and makes no runtime or performance qualification claim. The recipe links the weights' LFM Open License v1.0.

ATC overlaps from the full implementation include conflicts with concurrent work; this smaller admission slice is intended to establish shared ancestry. Integration must be reconciled before landing.

Admitted checkpoint revisions

This slice admits metadata and tensor headers only: no engine registration, model execution or inference.

  • LFM3-1.7B MLX 4-bit: d0ca73dcfa70ce18733754a492cdc1fb0123262d.
  • LFM3-1.7B MLX 6-bit: 26be898c36b545d625d84ac0761c6c3eb664aef3.
  • LFM3-1.7B MLX 8-bit: ee7667f3cfccb2a41725f91820531823fcabc6b7.
  • LFM3-VL-2B MLX 4-bit: c823fade98e35a3d6942ad4d38b1ea15f675cd12.
  • LFM3-VL-2B MLX 6-bit: 6d71bfae121abedc75f6d531fc7f6ceb4f5e3501.
  • LFM3-VL-2B MLX 8-bit: 83336d5be3874a2bdd3297bde77b2114dbd3a816.

Dependents: text Metal #1514 and CUDA #1508. The shared-name extraction suggested for XPU is under review; it is not included in this head yet.

@ashhart

ashhart commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Thanks for splitting the admission out. It reads well and the host tests cover it. Could you add a short PR description: what it admits (the six MLX exports and their revisions), what it deliberately doesn't do (no engine, no inference), and that #1514 and #1508 build on it? Then it can leave draft.

@jschmied

Copy link
Copy Markdown
Contributor

A suggestion for this PR, if it helps. The XPU backend for LFM3 (#1666) needs to load the text decoder by these names. weights.zig already has every one, self_attn.gate_proj included, but only inside schema().

Commit 865e50022 on jschmied/TensorFold:lfm3-names sits directly on this PR's head 3b140b7ff. It moves the table into families/lfm3/names.zig:

  • Namespace: bare model. or wrapped language_model.model.;
  • Module, with each module's path;
  • moduleName(), detect() and embedName().

weights.zig re-exports them, and schema() and validate() read the same table, so admission is unchanged. names.zig doesn't import the safetensors parser. That matters because a backend's core module already owns core/safetensors.zig, and Zig refuses a second module rooted at the same file. A new test in weights_test.zig checks every module name of both namespaces against the schema. test-lfm3-host passes.

Cherry-pick it if you agree. Otherwise the XPU PR will carry it on top of this one.

jschmied added a commit to jschmied/TensorFold that referenced this pull request Oct 31, 2026
's image tests from a build file of ours

C11 put test-lfm3-image-host and a sys import into zig/build/lfm3_host.zig, a file ashhart#1502 edits too.
That file is back to its version below C11, so ashhart#1502's own edit of it applies. zig/build/lfm3_xpu_host.zig
declares the step instead, and only while no lfm3_host.zig declares it; build/sys.zig's walk gives the
test root its sys import, so none is named here.
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Adopted jschmied's names.zig commit (authorship kept) and rebased the admission change onto it; test-lfm3-host passes on this head.

@ashhart

ashhart commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG and @jschmied. The description is what we needed, and the shared names table is a good call. It's gating to land now, with main's ling_host line kept beside yours in build.zig (the rebase had doubled your lfm3_host line; we kept the one after flashnext_batch_host, where your commit put it).

@ashhart
ashhart force-pushed the feature/lfm3-admission branch from a8ca7ea to 97d4b1c Compare November 1, 2026 04:57
ashhart added a commit to BlivionIaG/TensorFold that referenced this pull request Nov 1, 2026
@ashhart
ashhart marked this pull request as ready for review November 1, 2026 04:59
BlivionIaG and others added 6 commits November 1, 2026 08:20
Prepare text and VL 4/6/8-bit checkpoints with revision-pinned header inspection and native metadata validation. Inference remains unregistered pending operator and model qualification.

Refs ashhart#1491
…kends' loaders

names.zig names every module of the text decoder with its path; moduleName() builds a full tensor
name in either namespace (bare `model.` or wrapped `language_model.model.`), detect() picks the
namespace from the embedding a header holds. It has no dependency on the safetensors parser, so a
backend's loader can import it where core already owns that parser. weights.zig re-exports it, and
schema() and validate() read the same table, so a backend that loads by these names cannot drift
from the admission check. A test checks every module name of both namespaces against the schema.
@ashhart
ashhart force-pushed the feature/lfm3-admission branch from 97d4b1c to 93c2da3 Compare November 1, 2026 09:20
@ashhart
ashhart merged commit cfc9825 into ashhart:main Nov 1, 2026
9 checks passed
ashhart added a commit that referenced this pull request Nov 1, 2026
@ashhart

ashhart commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thank you @BlivionIaG. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

@ashhart

ashhart commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG and @jschmied! LFM3-1.7B and LFM3-VL-2B's official MLX checkpoints are admitted and checked in 1.2.1: https://github.com/ashhart/TensorFold/releases/tag/v1.2.1

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.

3 participants