Repository navigation
[Model] Add LFM3 support - #3599
Merged
Merged
Conversation
LFM2 and LFM2.5 interleave gated short-convolution blocks with GQA attention layers. The conv state lives in RNNState and the attention layers use the paged KV cache, so the model compiles as a hybrid like Qwen3.5. The config reads both the LFM2 and LFM2.5 spellings of the layout, FFN width, tied embeddings and RoPE settings, and applies HF's FFN auto-adjustment. It rejects conv_bias, non-default RoPE types and layouts without a conv layer. max_batch_size is capped at 1 because the conv state cannot be carried through a packed multi-sequence prefill.
Update TVM to include the Windows DLL-export fix in mlc-ai/relax#351. This resolves the missing `VLogContext::str()` symbol when linking `tvm_runtime_extra`. Verified native TVM and MLC builds, the affected TVM tests, and the SmolLM3/LFM2 CPU tests. The TVM FFI revision is unchanged.
# Conflicts: # 3rdparty/tvm
This was referenced Nov 15, 2026
JCNTH
marked this pull request as ready for review
November 15, 2026 17:35
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.
Add LFM3 gated attention, partial RoPE, convolution layers and Hugging Face weight mapping. Use float32 projection accumulation and bounded sliding-window prefill.
Subgroup builds require apache/tvm-tirx#250. Libraries: mlc-ai/binary-mlc-llm-libs#169. WebLLM records: mlc-ai/web-llm#895. Optional q8 quantization is separate in #3610.