Skip to content

Model arch: Flint - #314

Open
danielhanchen wants to merge 2 commits into
base/upstream-0a1ef309cfrom
model-arch/flint
Open

danielhanchen wants to merge 2 commits into
base/upstream-0a1ef309cfrom
model-arch/flint

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What it adds

  • conversion/flint.py: HF to GGUF conversion for FlintForCausalLM, with F32 router weights and the standard flint pre-tokenizer hash (also registered in convert_hf_to_gguf_update.py).
  • src/models/flint.cpp: the model graph (MoE with router, BF16 expert matmuls kept on CUDA).
  • build_moe_ffn: Flint joins Mistral4 and Mellum on build_amax_src1_f16. The helper's target changes from 32768 to 1024, which leaves headroom for the F16 sums of 32 values in Q8 activation blocks. This also changes Mistral4 and Mellum: their expert down-projection inputs are now rescaled whenever the max absolute value exceeds 1024, instead of only above 32768.
  • KV cache shifting support, the vocab pre-type, the arch and tensor names in gguf-py, and test-llama-archs plus Metal fusion count entries.

Squash details

  • Source head: 403d072bf7a9b7598300fc688fbe0c3cc005dda0 (18 commits, including two merges of upstream master).
  • Applied on ggml-org/llama.cpp 0a1ef309c, the upstream commit the source branch last merged. The tree is identical to the source head except for that repository's own .github/workflows changes, which are not part of the PR.
  • 18 files, +319 / -7.

Testing

  • CPU build on the squashed commit: test-llama-archs passes all 140 tests (flint OK), and test-chat passes.

Pin set note

A second commit renumbers LLAMA_VOCAB_PRE_TYPE_FLINT from 62 to 63, because Inkling (ggml-org#25731) takes 62 and both are pinned together. The pre-type is resolved from the tokenizer.ggml.pre string at load time, so the number is not stored in GGUF files and existing Flint GGUFs are unaffected.

Adds the Flint architecture: GGUF conversion (conversion/flint.py, pre-tokenizer
hash), the llama.cpp model graph (src/models/flint.cpp), router and expert
handling, adaptive F16 activation scaling for the expert down projection, KV
cache shifting, tokenizer pre-type, and test-llama-archs / Metal fusion entries.

Squash of recursive-org/llama.cpp-flint-ext#1 at 403d072bf7a9b7598300fc688fbe0c3cc005dda0,
applied on ggml-org/llama.cpp 0a1ef30.

Co-authored-by: Alexey <alexey@recursive.com>
Co-authored-by: Tankred Saanum <62603648+tankred-saanum@users.noreply.github.com>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
@danielhanchen
danielhanchen requested a review from CISC as a code owner October 21, 2026 14:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T14:28:45.514565Z 1628f83 PR opened
🔒 Security Review ⚠️ Failed 2026-10-21T14:14:10.744473Z
We couldn’t complete this review. Comment @codex security review to try again.
1628f83 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

Inkling (ggml-org#25731) takes 62. The pre-type is resolved from the
tokenizer.ggml.pre string at load time, so the number is not stored in GGUFs.

This branch has not been deployed

No deployments
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