llama.cpp llama-arch.cpp architecture-class classification functions (recurrent / hybrid / diffusion / rs-rollback / sm-tensor)
Fields
sources/mdl2-llamacpp-arch-class-registryNotes
Read at master 2026-10-03; complements pap-arch-llamacpp-arch-registry (same file, earlier read focused on the LLM_ARCH enum only). The part that matters for the architecture x engine join is FIVE CLASSIFICATION FUNCTIONS at the end of the file, because they are llama.cpp's own statement of which architectures need a NON-DECODE, NON-GEMM code path. llm_arch_is_recurrent() returns true for exactly: MAMBA, MAMBA2, RWKV6, RWKV6QWEN2, RWKV7, ARWKV7 (6). llm_arch_is_hybrid() returns true for exactly 18 entries: JAMBA, FALCON_H1, PLAMO2, GRANITE_HYBRID, LFM2, LFM2MOE, NEMOTRON_H, NEMOTRON_H_MOE, QWEN3NEXT, KIMI_LINEAR, BAILINGMOE3, KIMI_K3, GLM5_NEXT, QWEN35, QWEN35MOE, QWEN4EXP, DEEPSEEK4, MINIMAX_01. llm_arch_is_diffusion() returns true for exactly 4: DREAM, LLADA, LLADA_MOE, RND1. llm_arch_supports_rs_rollback() (11): KIMI_K3, QWEN35, QWEN35MOE, QWEN4EXP, DEEPSEEK4, GLM5_NEXT, NEMOTRON_H, NEMOTRON_H_MOE, LFM2, LFM2MOE, BAILINGMOE3. llm_arch_supports_sm_tensor() returns FALSE (30 exclusions): GROK, MPT, PLAMO2, MINICPM3, GEMMA3N, MAMBA, MAMBA2, JAMBA, FALCON_H1, OLMO2, OLMOE, DEEPSEEK2, DEEPSEEK32, HY_V4, DOTS3NOTE, GLM_DSA, BITNET, T5, NEMOTRON_H, NEMOTRON_H_MOE, GRANITE_HYBRID, MINIMAX_01, MINIMAX_M2, MINIMAX_M3, MISTRAL4, KIMI_LINEAR, BAILINGMOE3, KIMI_K3, GLM5_NEXT, QWEN3TTS. Two joins fall straight out of this and neither is recorded anywhere else in the repo. (1) supports_sm_tensor=false is llama.cpp saying these architectures have NO matmul-heavy tensor-core path, which is the same conclusion flops/ssm-sequential-scan-tensor-core-mismatch reaches from the arithmetic - here it is the engine's own dispatch table agreeing, and it covers DEEPSEEK2/DEEPSEEK32 (MLA), MINIMAX_M2, GEMMA3N, OLMO2, GROK, T5 in addition to every SSM/hybrid entry. (2) The 18 hybrid entries include FALCON_H1, GRANITE_HYBRID, LFM2, NEMOTRON_H, QWEN3NEXT, KIMI_LINEAR, KIMI_K3, QWEN35 - i.e. llama.cpp needed one shared hybrid code path for exactly the model families that vLLM and SGLang each list as their own separate architecture rows, which is why hybrid support lands in one engine release and not another. Note also that LLADA, LLADA_MOE and DREAM are FIRST-CLASS entries in a mainstream CPU/GPU engine's registry: llama.cpp has a diffusion decode path, and 'hybrid' and 'diffusion' are separate booleans rather than one 'non-AR' class. 114 LLM_ARCH entries total in this revision. Also present as tensor classes: LLM_TENSOR_MASKED_EMBD_CENTROIDS and LLM_TENSOR_MASKED_EMBD_ORDERING, which are diffusion-LM-only tensors (masked-embedding centroids and ordering) and are the concrete evidence that a diffusion model needs a different cache/state structure, not just a different sampling loop.
Cross-references
This record references no other records.