Repository navigation
Conversation
* llama : scale moe down projection per expert token Replace the global amax rescaling for the MoE down projection with a per-expert-token factor computed by a POOL_1D max reduction along the intermediate dimension. Undo the scale on the output with the same exact power-of-two factor. Handle POOL_1D in the Meta split-state logic so a split along axis 0 becomes a replicated per-device partial result, enabling tensor parallelism. Assisted-by: pi:llama.cpp/ggml-org/DeepSeek-V4-Flash-Vision-Exp-GGUF (Mac Studio, M2 Ultra, 192GB) * cont : simplify comments Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * llama : refactor amax src1 scaling result Return the rescaled activation and the optional scale tensor through a small struct instead of an output pointer. Assisted-by: pi:llama.cpp/ggml-org/DeepSeek-V4-Flash-Vision-Exp-GGUF (Mac Studio, M2 Ultra, 192GB) * cont : add TODO + clean-up
* Add Flint model (FlintForCausalLM). Assisted by Codex * cleanup * one more --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
Owner
|
Merged newer upstream master into v0.4.9, so this is superseded. |
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.
Adds support for Flint (Recursive, 39.8B-A2.5B MoE,
FlintForCausalLM), branched fromv0.4.9.Why a port is needed
BeeLlama
v0.4.9is based on llama.cppfd55cb98f(2026-10-15). Flint landed upstream on 2026-10-21, so no branch of this repo can load a Flint GGUF today.The branch is exactly three upstream commits cherry-picked on top of
v0.4.9, with authorship preserved:5036a22llm_graph_amax_src1+ POOL_1D split state — required by the Flint graph1f00f16de8a9da\x00)Without ggml-org#30929 the server refuses to start:
chat template parsing error: lexer: unknown escape character \x.Conflict resolution
Only two real conflicts:
src/llama-graph.cpp— BeeLlama's MoE path passes its ownslotsargument tobuild_lora_mm_id. Kept it inside the upstream amax block, so the cache path is unchanged.tests/test-llama-archs.cpp— the upstream hunk also referencesMUSE_SPARKandKOLIBRI1, which do not exist in thev0.4.9base. Added onlyLLM_ARCH_FLINTto the existing list.Everything else applied cleanly, including
llama-kv-cache.cpp(K-shift only for layers with RoPE).llama_hparams::has_rope()still defaults totruefor models without arope_pattern, so behaviour for existing architectures is unchanged.Verified (Windows 11, CUDA 12.8, sm_120a, RTX 5060 Ti 16 GB)
Built with
GGML_CUDA_KVARN=ON,GGML_CUDA_FA_ALL_QUANTS=ON,-j 6(higher parallelism OOMsciccon 32 GB RAM).unsloth/flint-GGUFUD-Q3_K_XL(17.2 GiB, does not fit fully in 16 GB — experts partially on CPU):--n-cpu-moeKVarN observation: Flint loads and runs with
kvarn3/kvarn2(the cache does shrink — 0.6-0.7 GiB less than q8_0), but decode is consistently ~30% slower thanq8_0even after spending the freed VRAM on two more expert layers. Likely the attention sinks force the materialization route instead of direct-record decode, but that is not verified. q8_0 is the better lever on this model.Also verified:
finish_reason=tool_callswith correct arguments.lfm2moe) still loads and decodes at 260 t/s on the same build.--moe-cache-mibmade decode worse on this model (44-47 t/s at 128K/ncmoe 24 vs 54-58 without), so it is not used.Notes
v0.4.9rather thanmain:mainis 240 commits behind that branch, so a PR againstmainwould carry the whole v0.4.9 upstream merge.