From 79a9d8501d447babd46b3715707c4241aedc0cec Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Sat, 22 Aug 2026 16:33:13 +0200 Subject: [PATCH] add comment --- tools/mtmd/clip-graph.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/mtmd/clip-graph.h b/tools/mtmd/clip-graph.h index c4f2148dd0..f69401a7cf 100644 --- a/tools/mtmd/clip-graph.h +++ b/tools/mtmd/clip-graph.h @@ -131,7 +131,15 @@ struct clip_graph { int il, ggml_tensor * sinks = nullptr) const; - // implementation of the 2D RoPE without adding a new op in ggml + // implementation of the 2D RoPE using two ggml_rope_ext calls + // + // unlike GGML_ROPE_TYPE_VISION which forces NEOX ordering, this rotates adjacent pairs (normal ordering) + // + // example: + // given a single head with size = 8 --> [00000000] + // dims [0, 4) rotate with pos_a, dims [4, 8) rotate with pos_b --> [aaaabbbb] + // interleave_freq = false --> both halves use the same inv_freq set (like GGML_ROPE_TYPE_VISION) + // interleave_freq = true --> first half uses even inv_freq, second half uses odd inv_freq (used by pixtral) ggml_tensor * build_rope_2d( ggml_context * ctx0, ggml_tensor * cur,