Repository navigation
Add llama.cpp support for LFM2.5-ColBERT-350M and LFM2.5-Embedding-350M - #24782
Closed
vincentzed wants to merge 1 commit into
Closed
vincentzed wants to merge 1 commit into
vincentzed wants to merge 1 commit into
Conversation
Single-commit squash of vincentzed/lfm2.5-bidir-release (feature + bench strip + graph dedup + test exclusion + memory fixes + README docs): - LLM_ARCH_LFM2_BIDIR (lfm2-bidir): non-causal LFM2 encoder for LFM2.5-Embedding-350M (dense bi-encoder, CLS) and LFM2.5-ColBERT-350M (late-interaction, dense_2 128-d) - no-cache bidirectional attention + centered depthwise short-conv (ggml_conv_1d_dw_ph) with per-sequence span splitting. - Graph folded into llama_model_lfm2::graph<iswa, embed> per the llama-embed precedent (ggml-org#18220); no separate model class. - Encoder-only memory hygiene: arch joins the create_memory nullptr group (no KV cache - graph is no-cache attention only) and skips the unused lm_head/output tensor (no token_embd duplication). Peak footprint 1927 -> 422 MiB (llama-embedding defaults, M4 Max). - Conversion: Lfm2BidirectionalModel registration, CLS/MEAN/LAST pooling auto-detect, dense_2 projection + embedding_length_out for ColBERT. - tests: lfm2-bidir joins the embedding-arch exclusion in test-llama-archs (generation-mode harness; see LLAMA_EMBED FIXME). - docs: README models-section entry. Verified: per-token cosine 1.000000 vs HF (both models, Metal; CPU 0.999997), ColBERT MaxSim ranking identical, multilingual parity 1.0 in all 11 languages, quantization Q8_0 cosine >0.9999 both models, causal LFM2-350M token-identical pre/post refactor, test-llama-archs lfm2/lfm2moe OK, test-backend-ops IM2COL/SSM_CONV green, llama-server /v1/embeddings OK with memory == nullptr.
vincentzed
requested review from
CISC,
JohannesGaessler and
ggerganov
as code owners
June 18, 2026 22:06
Member
|
This seems to be duplicating work that has already been done to support LFM2 Colbert/Embedding, esp. with the 3D vs 2D shortconv... cc/ @tdakhran |
Contributor
|
Thanks for tagging @CISC , haven't seen this code before, will check internally. |
Author
|
It's been replaced by #24913 since the implementations and ggufs differ. For all future use please refer to that pr. |
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.
Overview
Additional information
Requirements
Yes AI was used, to do testing, as well as locating small improvements, such as avoiding duplicating some weights that are unused. Also some c++ work.