model: add Cohere2-MoE North Mini Code support#1945
Conversation
| inpL = ggml_get_rows(ctx0, inpL, inp_out_ids); | ||
| } | ||
|
|
||
| attn_out->op_params[3] = 1; |
There was a problem hiding this comment.
Move this within the if (model.layers[il].ffn_gate_inp == nullptr) branch.
Alternatively, remove COHERE2_MOE from the list of architectures supporting split mode graph and I will fix it after merging the PR.
Setting op_params[3] to 1 results in the AllReduce operation not being performed when using split mode graph (and you have added COHERE2_MOE to the list of architectures supporting split mode graph). This works for the dense layers because each partial result of attn_out is added to the corresponding partial result for the FFN network before running AllReduce. But there is no corresponding implementation in the MoE FFN, so what happens then is that we only add the partial attn_out result for the GPU that runs the AllReduce op.
There was a problem hiding this comment.
Thanks! I moved attn_out->op_params[3] = 1 into the dense FFN branch so the MoE layers don't suppress the attention all-reduce in split-mode graph.
I’m really enjoying the chance to work on ik_llama! New models keep adding surprise opportunities to learn.
Commit: 51ea994d9 Fix Cohere2-MoE graph split reduce handling
Date: 2026-06-10
Summary
This adds initial support for CohereLabs North-Mini-Code-1.0 GGUFs using the
cohere2_moearchitecture. It has been validated on Q8_0, Q6_K, and Q4_K_MGGUFs generated from the official North-Mini-Code-1.0 weights. Other
Cohere2-MoE-derived GGUFs may work if they preserve the same metadata and tensor
layout, but are not separately validated here. This compatibility PR includes:
cohere2_moearchitecture registration and model metadata loadingpattern
tokenizer.ggml.pre = cohere2_moeCohereLabs/North-Mini-Code-1.0weightschat_template.jinjaembedding during conversionThis PR does not include DFlash, MTP, speculation, performance tuning, custom
quantization work, broad chat/server UX changes, or benchmark-quality claims.
Architecture Notes
North-Mini-Code-1.0 is a Cohere2-MoE model released 9 June 2026, not a pure alias of existing Cohere2 or Command-R support.
The correctness-sensitive parts are:
Cohere2MoeForCausalLMand GGUF architecturecohere2_moeCohere2/Command-R attention tensors
sliding-window layers
use positional embeddings
runtime path, so the converter does not apply the Llama Q/K permutation
The converter emits the required Cohere2-MoE GGUF metadata and stacks routed
expert tensors into GGUF expert tensors. The runtime then dispatches to a
dedicated Cohere2-MoE tensor loader and graph builder instead of changing the
existing Cohere2 or Command-R paths.
Validation
Official CohereLabs source revision:
Reviewer/community convenience GGUFs generated from official CohereLabs weights:
Files:
These GGUFs require an
ik_llama.cppbuild with this Cohere2-MoE /North-Mini-Code support, or another runtime with equivalent
cohere2_moearchitecture handling. They are not expected to load or decode correctly with
current
ikawrakow/mainwithout this PR.Validation highlights:
current
llama-quantizetokenizer.chat_templatechat_template.jinjallama-serverconfiguration and each produced saved code files in that harness
environment, but the Pi harness results are not used here as quality evidence
py_compilegit diff --checkpasses locallyRepresentative local server shape used for the fresh artifacts:
Notes / Caveats
Q8_0, Q6_K, and Q4_K_M are provided as reviewer-facing compatibility
artifacts.
No BF16 GGUF is published as a user artifact.
No performance claims are made.
No benchmark-quality or agentic-coding quality claims are made.
The validation claim is limited to conversion, loadability, metadata/template
correctness, and basic local response/code-generation smoke tests.
The implementation is intentionally scoped to Cohere2-MoE / North-Mini-Code
compatibility rather than speculative decoding, DFlash, MTP, server UX, or
broad runtime behavior changes.
I have read the contributing guidelines
Self-reported review complexity: