0005-solar-pro.patch 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Michael Yang <mxyng@pm.me>
  3. Date: Mon, 16 Sep 2024 15:53:16 -0700
  4. Subject: [PATCH] solar-pro
  5. solar-pro introduces block skip connections where blocks are connected
  6. to other, non-sequential blocks with a scale multiple
  7. this change adds 4 new keys to store the skip connections and one new
  8. tensor to store the scalar. the scalar is implemented a 1-dimensional
  9. tensor with 2 elements dervied from the model's bskcn_tv configuration.
  10. in general, the values are (bskcn_tv, 1 - bskcn_tv)
  11. ---
  12. src/llama.cpp | 267 +++++++++++++++++++++++++++++++++++++++++++++++---
  13. 1 file changed, 253 insertions(+), 14 deletions(-)
  14. diff --git a/src/llama.cpp b/src/llama.cpp
  15. index 9e292c4f..26be6254 100644
  16. --- a/src/llama.cpp
  17. +++ b/src/llama.cpp
  18. @@ -196,6 +196,7 @@ enum llm_arch {
  19. LLM_ARCH_GRANITE,
  20. LLM_ARCH_GRANITE_MOE,
  21. LLM_ARCH_CHAMELEON,
  22. + LLM_ARCH_SOLAR,
  23. LLM_ARCH_UNKNOWN,
  24. };
  25. @@ -251,6 +252,7 @@ static const std::map<llm_arch, const char *> LLM_ARCH_NAMES = {
  26. { LLM_ARCH_GRANITE, "granite" },
  27. { LLM_ARCH_GRANITE_MOE, "granitemoe" },
  28. { LLM_ARCH_CHAMELEON, "chameleon" },
  29. + { LLM_ARCH_SOLAR, "solar" },
  30. { LLM_ARCH_UNKNOWN, "(unknown)" },
  31. };
  32. @@ -308,6 +310,7 @@ enum llm_kv {
  33. LLM_KV_ATTENTION_RELATIVE_BUCKETS_COUNT,
  34. LLM_KV_ATTENTION_SLIDING_WINDOW,
  35. LLM_KV_ATTENTION_SCALE,
  36. + LLM_KV_ATTENTION_BLOCK_SKIP_CONNECTION,
  37. LLM_KV_ROPE_DIMENSION_COUNT,
  38. LLM_KV_ROPE_DIMENSION_SECTIONS,
  39. @@ -411,20 +414,21 @@ static const std::map<llm_kv, const char *> LLM_KV_NAMES = {
  40. { LLM_KV_RESIDUAL_SCALE, "%s.residual_scale" },
  41. { LLM_KV_EMBEDDING_SCALE, "%s.embedding_scale" },
  42. - { LLM_KV_ATTENTION_HEAD_COUNT, "%s.attention.head_count" },
  43. - { LLM_KV_ATTENTION_HEAD_COUNT_KV, "%s.attention.head_count_kv" },
  44. - { LLM_KV_ATTENTION_MAX_ALIBI_BIAS, "%s.attention.max_alibi_bias" },
  45. - { LLM_KV_ATTENTION_CLAMP_KQV, "%s.attention.clamp_kqv" },
  46. - { LLM_KV_ATTENTION_KEY_LENGTH, "%s.attention.key_length" },
  47. - { LLM_KV_ATTENTION_VALUE_LENGTH, "%s.attention.value_length" },
  48. - { LLM_KV_ATTENTION_LAYERNORM_EPS, "%s.attention.layer_norm_epsilon" },
  49. - { LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, "%s.attention.layer_norm_rms_epsilon" },
  50. - { LLM_KV_ATTENTION_CAUSAL, "%s.attention.causal" },
  51. - { LLM_KV_ATTENTION_Q_LORA_RANK, "%s.attention.q_lora_rank" },
  52. - { LLM_KV_ATTENTION_KV_LORA_RANK, "%s.attention.kv_lora_rank" },
  53. - { LLM_KV_ATTENTION_RELATIVE_BUCKETS_COUNT, "%s.attention.relative_buckets_count" },
  54. - { LLM_KV_ATTENTION_SLIDING_WINDOW, "%s.attention.sliding_window" },
  55. - { LLM_KV_ATTENTION_SCALE, "%s.attention.scale" },
  56. + { LLM_KV_ATTENTION_HEAD_COUNT, "%s.attention.head_count" },
  57. + { LLM_KV_ATTENTION_HEAD_COUNT_KV, "%s.attention.head_count_kv" },
  58. + { LLM_KV_ATTENTION_MAX_ALIBI_BIAS, "%s.attention.max_alibi_bias" },
  59. + { LLM_KV_ATTENTION_CLAMP_KQV, "%s.attention.clamp_kqv" },
  60. + { LLM_KV_ATTENTION_KEY_LENGTH, "%s.attention.key_length" },
  61. + { LLM_KV_ATTENTION_VALUE_LENGTH, "%s.attention.value_length" },
  62. + { LLM_KV_ATTENTION_LAYERNORM_EPS, "%s.attention.layer_norm_epsilon" },
  63. + { LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, "%s.attention.layer_norm_rms_epsilon" },
  64. + { LLM_KV_ATTENTION_CAUSAL, "%s.attention.causal" },
  65. + { LLM_KV_ATTENTION_Q_LORA_RANK, "%s.attention.q_lora_rank" },
  66. + { LLM_KV_ATTENTION_KV_LORA_RANK, "%s.attention.kv_lora_rank" },
  67. + { LLM_KV_ATTENTION_RELATIVE_BUCKETS_COUNT, "%s.attention.relative_buckets_count" },
  68. + { LLM_KV_ATTENTION_SLIDING_WINDOW, "%s.attention.sliding_window" },
  69. + { LLM_KV_ATTENTION_SCALE, "%s.attention.scale" },
  70. + { LLM_KV_ATTENTION_BLOCK_SKIP_CONNECTION, "%s.attention.block_skip_connection.%d" },
  71. { LLM_KV_ROPE_DIMENSION_COUNT, "%s.rope.dimension_count" },
  72. { LLM_KV_ROPE_DIMENSION_SECTIONS, "%s.rope.dimension_sections" },
  73. @@ -607,6 +611,7 @@ enum llm_tensor {
  74. LLM_TENSOR_ENC_OUTPUT_NORM,
  75. LLM_TENSOR_CLS,
  76. LLM_TENSOR_CLS_OUT,
  77. + LLM_TENSOR_BSKCN_TV,
  78. };
  79. static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_NAMES = {
  80. @@ -1564,6 +1569,24 @@ static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_N
  81. { LLM_TENSOR_ATTN_K_NORM, "blk.%d.attn_k_norm" },
  82. },
  83. },
  84. + {
  85. + LLM_ARCH_SOLAR,
  86. + {
  87. + { LLM_TENSOR_TOKEN_EMBD, "token_embd" },
  88. + { LLM_TENSOR_OUTPUT_NORM, "output_norm" },
  89. + { LLM_TENSOR_OUTPUT, "output" },
  90. + { LLM_TENSOR_ATTN_NORM, "blk.%d.attn_norm" },
  91. + { LLM_TENSOR_ATTN_Q, "blk.%d.attn_q" },
  92. + { LLM_TENSOR_ATTN_K, "blk.%d.attn_k" },
  93. + { LLM_TENSOR_ATTN_V, "blk.%d.attn_v" },
  94. + { LLM_TENSOR_ATTN_OUT, "blk.%d.attn_output" },
  95. + { LLM_TENSOR_FFN_NORM, "blk.%d.ffn_norm" },
  96. + { LLM_TENSOR_FFN_GATE, "blk.%d.ffn_gate" },
  97. + { LLM_TENSOR_FFN_DOWN, "blk.%d.ffn_down" },
  98. + { LLM_TENSOR_FFN_UP, "blk.%d.ffn_up" },
  99. + { LLM_TENSOR_BSKCN_TV, "bskcn_tv" },
  100. + },
  101. + },
  102. {
  103. LLM_ARCH_UNKNOWN,
  104. {
  105. @@ -2425,6 +2448,7 @@ enum e_model {
  106. MODEL_15B,
  107. MODEL_16B,
  108. MODEL_20B,
  109. + MODEL_22B,
  110. MODEL_30B,
  111. MODEL_32B,
  112. MODEL_34B,
  113. @@ -2475,6 +2499,8 @@ struct llama_hparams {
  114. std::array<uint32_t, LLAMA_MAX_LAYERS> n_head_kv_arr;
  115. std::array<uint32_t, LLAMA_MAX_LAYERS> n_ff_arr;
  116. + std::array<std::array<uint32_t, LLAMA_MAX_LAYERS>, 4> n_bskcn_arr;
  117. +
  118. uint32_t n_layer_dense_lead = 0;
  119. uint32_t n_lora_q = 0;
  120. uint32_t n_lora_kv = 0;
  121. @@ -2546,6 +2572,7 @@ struct llama_hparams {
  122. if (this->n_head_arr != other.n_head_arr) return true;
  123. if (this->n_head_kv_arr != other.n_head_kv_arr) return true;
  124. if (this->n_ff_arr != other.n_ff_arr) return true;
  125. + if (this->n_bskcn_arr != other.n_bskcn_arr) return true;
  126. if (this->n_rel_attn_bkts != other.n_rel_attn_bkts) return true;
  127. if (this->n_layer_dense_lead != other.n_layer_dense_lead) return true;
  128. @@ -2658,6 +2685,14 @@ struct llama_hparams {
  129. return ssm_d_state * ssm_d_inner;
  130. }
  131. }
  132. +
  133. + bool n_bskcn(uint32_t n, uint32_t il = 0) const {
  134. + if (il < n_layer) {
  135. + return n_bskcn_arr[n][il] > 0;
  136. + }
  137. +
  138. + GGML_ABORT("fatal error");
  139. + }
  140. };
  141. static_assert(std::is_trivially_copyable<llama_hparams>::value, "llama_hparams must be trivially copyable");
  142. @@ -2844,6 +2879,8 @@ struct llama_layer {
  143. struct ggml_tensor * ffn_gate_scale;
  144. struct ggml_tensor * ffn_up_scale;
  145. struct ggml_tensor * ffn_down_scale;
  146. +
  147. + struct ggml_tensor * bskcn_tv;
  148. };
  149. // very similar to llama_batch,
  150. @@ -6247,6 +6284,21 @@ static void llm_load_hparams(
  151. default: model.type = e_model::MODEL_UNKNOWN;
  152. }
  153. } break;
  154. + case LLM_ARCH_SOLAR:
  155. + {
  156. + ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, hparams.f_norm_rms_eps);
  157. +
  158. + for (int i = 0; i < hparams.n_bskcn_arr.max_size(); ++i) {
  159. + auto & bskcn = hparams.n_bskcn_arr.at(i);
  160. + bskcn.fill(0);
  161. + ml.get_key_or_arr(::format(LLM_KV_NAMES.at(LLM_KV_ATTENTION_BLOCK_SKIP_CONNECTION), LLM_ARCH_NAMES.at(ml.llm_kv.arch), i), bskcn, hparams.n_layer, false);
  162. + }
  163. +
  164. + switch (hparams.n_layer) {
  165. + case 64: model.type = e_model::MODEL_22B; break;
  166. + default: model.type = e_model::MODEL_UNKNOWN;
  167. + }
  168. + }
  169. default: (void)0;
  170. }
  171. @@ -7239,6 +7291,7 @@ static const std::map<llm_tensor, llm_tensor_info> llm_tensor_info_mapping = {
  172. {LLM_TENSOR_FFN_UP_EXPS, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT_ID}},
  173. // this tensor is loaded for T5, but never used
  174. {LLM_TENSOR_DEC_CROSS_ATTN_REL_B, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_NONE}},
  175. + {LLM_TENSOR_BSKCN_TV, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL}}
  176. };
  177. // checks if the weight tensor can be used with the specified buffer type and device
  178. @@ -9253,6 +9306,35 @@ static bool llm_load_tensors(
  179. layer.ffn_norm = create_tensor(tn(LLM_TENSOR_FFN_NORM, "weight", i), {n_embd}, 0);
  180. + layer.ffn_gate = create_tensor(tn(LLM_TENSOR_FFN_GATE, "weight", i), {n_embd, n_ff}, 0);
  181. + layer.ffn_down = create_tensor(tn(LLM_TENSOR_FFN_DOWN, "weight", i), { n_ff, n_embd}, 0);
  182. + layer.ffn_up = create_tensor(tn(LLM_TENSOR_FFN_UP, "weight", i), {n_embd, n_ff}, 0);
  183. + }
  184. + } break;
  185. + case LLM_ARCH_SOLAR:
  186. + {
  187. + model.tok_embd = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, 0);
  188. +
  189. + // output
  190. + {
  191. + model.output_norm = create_tensor(tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd}, 0);
  192. + model.output = create_tensor(tn(LLM_TENSOR_OUTPUT, "weight"), {n_embd, n_vocab}, llama_model_loader::TENSOR_NOT_REQUIRED);
  193. + }
  194. +
  195. + for (int i = 0; i < n_layer; ++i) {
  196. + auto & layer = model.layers[i];
  197. +
  198. + layer.attn_norm = create_tensor(tn(LLM_TENSOR_ATTN_NORM, "weight", i), {n_embd}, 0);
  199. +
  200. + layer.wq = create_tensor(tn(LLM_TENSOR_ATTN_Q, "weight", i), {n_embd, n_embd_head_k * n_head}, 0);
  201. + layer.wk = create_tensor(tn(LLM_TENSOR_ATTN_K, "weight", i), {n_embd, n_embd_k_gqa}, 0);
  202. + layer.wv = create_tensor(tn(LLM_TENSOR_ATTN_V, "weight", i), {n_embd, n_embd_v_gqa}, 0);
  203. + layer.wo = create_tensor(tn(LLM_TENSOR_ATTN_OUT, "weight", i), {n_embd_head_k * n_head, n_embd}, 0);
  204. +
  205. + layer.ffn_norm = create_tensor(tn(LLM_TENSOR_FFN_NORM, "weight", i), {n_embd}, 0);
  206. +
  207. + layer.bskcn_tv = create_tensor(tn(LLM_TENSOR_BSKCN_TV, "weight", i), {2}, llama_model_loader::TENSOR_NOT_REQUIRED | (i != 0 ? llama_model_loader::TENSOR_DUPLICATED : 0));
  208. +
  209. layer.ffn_gate = create_tensor(tn(LLM_TENSOR_FFN_GATE, "weight", i), {n_embd, n_ff}, 0);
  210. layer.ffn_down = create_tensor(tn(LLM_TENSOR_FFN_DOWN, "weight", i), { n_ff, n_embd}, 0);
  211. layer.ffn_up = create_tensor(tn(LLM_TENSOR_FFN_UP, "weight", i), {n_embd, n_ff}, 0);
  212. @@ -16671,6 +16753,158 @@ struct llm_build_context {
  213. return gf;
  214. }
  215. +
  216. + ggml_cgraph * build_solar() {
  217. + struct ggml_cgraph * gf = ggml_new_graph_custom(ctx0, llama_model_max_nodes(model), false);
  218. +
  219. + // mutable variable, needed during the last layer of the computation to skip unused tokens
  220. + int32_t n_tokens = this->n_tokens;
  221. +
  222. + const int64_t n_embd_head = hparams.n_embd_head_v;
  223. + GGML_ASSERT(n_embd_head == hparams.n_embd_head_k);
  224. + GGML_ASSERT(n_embd_head == hparams.n_rot);
  225. +
  226. + struct ggml_tensor * cur;
  227. + struct ggml_tensor * inpL;
  228. +
  229. + inpL = llm_build_inp_embd(ctx0, lctx, hparams, ubatch, model.tok_embd, cb);
  230. +
  231. + // inp_pos - contains the positions
  232. + struct ggml_tensor * inp_pos = build_inp_pos();
  233. +
  234. + // KQ_mask (mask for 1 head, it will be broadcasted to all heads)
  235. + struct ggml_tensor * KQ_mask = build_inp_KQ_mask();
  236. +
  237. + struct ggml_tensor * bskcn_1;
  238. + struct ggml_tensor * bskcn_2;
  239. +
  240. + for (int il = 0; il < n_layer; ++il) {
  241. + struct ggml_tensor * inpSA = inpL;
  242. +
  243. + if (hparams.n_bskcn(0, il)) {
  244. + bskcn_1 = inpSA;
  245. + }
  246. +
  247. + if (hparams.n_bskcn(1, il)) {
  248. + bskcn_2 = inpSA;
  249. + }
  250. +
  251. + if (hparams.n_bskcn(2, il)) {
  252. + inpSA = ggml_add(
  253. + ctx0,
  254. + ggml_mul(ctx0, bskcn_1, ggml_view_1d(ctx0, model.layers[il].bskcn_tv, 1, 0)),
  255. + ggml_mul(ctx0, inpSA, ggml_view_1d(ctx0, model.layers[il].bskcn_tv, 1, ggml_element_size(model.layers[il].bskcn_tv))));
  256. + }
  257. +
  258. + if (hparams.n_bskcn(3, il)) {
  259. + inpSA = ggml_add(
  260. + ctx0,
  261. + ggml_mul(ctx0, bskcn_2, ggml_view_1d(ctx0, model.layers[il].bskcn_tv, 1, 0)),
  262. + ggml_mul(ctx0, inpSA, ggml_view_1d(ctx0, model.layers[il].bskcn_tv, 1, ggml_element_size(model.layers[il].bskcn_tv))));
  263. + }
  264. +
  265. + // norm
  266. + cur = llm_build_norm(ctx0, inpL, hparams,
  267. + model.layers[il].attn_norm, NULL,
  268. + LLM_NORM_RMS, cb, il);
  269. + cb(cur, "attn_norm", il);
  270. +
  271. + // self-attention
  272. + {
  273. + // rope freq factors for llama3; may return nullptr for llama2 and other models
  274. + struct ggml_tensor * rope_factors = build_rope_factors(il);
  275. +
  276. + // compute Q and K and RoPE them
  277. + struct ggml_tensor * Qcur = llm_build_lora_mm(lctx, ctx0, model.layers[il].wq, cur);
  278. + cb(Qcur, "Qcur", il);
  279. + if (model.layers[il].bq) {
  280. + Qcur = ggml_add(ctx0, Qcur, model.layers[il].bq);
  281. + cb(Qcur, "Qcur", il);
  282. + }
  283. +
  284. + struct ggml_tensor * Kcur = llm_build_lora_mm(lctx, ctx0, model.layers[il].wk, cur);
  285. + cb(Kcur, "Kcur", il);
  286. + if (model.layers[il].bk) {
  287. + Kcur = ggml_add(ctx0, Kcur, model.layers[il].bk);
  288. + cb(Kcur, "Kcur", il);
  289. + }
  290. +
  291. + struct ggml_tensor * Vcur = llm_build_lora_mm(lctx, ctx0, model.layers[il].wv, cur);
  292. + cb(Vcur, "Vcur", il);
  293. + if (model.layers[il].bv) {
  294. + Vcur = ggml_add(ctx0, Vcur, model.layers[il].bv);
  295. + cb(Vcur, "Vcur", il);
  296. + }
  297. +
  298. + Qcur = ggml_rope_ext(
  299. + ctx0, ggml_reshape_3d(ctx0, Qcur, n_embd_head, n_head, n_tokens), inp_pos, rope_factors,
  300. + n_rot, rope_type, n_ctx_orig, freq_base, freq_scale,
  301. + ext_factor, attn_factor, beta_fast, beta_slow
  302. + );
  303. + cb(Qcur, "Qcur", il);
  304. +
  305. + Kcur = ggml_rope_ext(
  306. + ctx0, ggml_reshape_3d(ctx0, Kcur, n_embd_head, n_head_kv, n_tokens), inp_pos, rope_factors,
  307. + n_rot, rope_type, n_ctx_orig, freq_base, freq_scale,
  308. + ext_factor, attn_factor, beta_fast, beta_slow
  309. + );
  310. + cb(Kcur, "Kcur", il);
  311. +
  312. + cur = llm_build_kv(ctx0, lctx, kv_self, gf,
  313. + model.layers[il].wo, model.layers[il].bo,
  314. + Kcur, Vcur, Qcur, KQ_mask, n_tokens, kv_head, n_kv, 1.0f/sqrtf(float(n_embd_head)), cb, il);
  315. + }
  316. +
  317. + if (il == n_layer - 1) {
  318. + // skip computing output for unused tokens
  319. + struct ggml_tensor * inp_out_ids = build_inp_out_ids();
  320. + n_tokens = n_outputs;
  321. + cur = ggml_get_rows(ctx0, cur, inp_out_ids);
  322. + inpSA = ggml_get_rows(ctx0, inpSA, inp_out_ids);
  323. + }
  324. +
  325. + struct ggml_tensor * ffn_inp = ggml_add(ctx0, cur, inpSA);
  326. + cb(ffn_inp, "ffn_inp", il);
  327. +
  328. + // feed-forward network
  329. + cur = llm_build_norm(ctx0, ffn_inp, hparams,
  330. + model.layers[il].ffn_norm, NULL,
  331. + LLM_NORM_RMS, cb, il);
  332. + cb(cur, "ffn_norm", il);
  333. +
  334. + cur = llm_build_ffn(ctx0, lctx, cur,
  335. + model.layers[il].ffn_up, model.layers[il].ffn_up_b, NULL,
  336. + model.layers[il].ffn_gate, model.layers[il].ffn_gate_b, NULL,
  337. + model.layers[il].ffn_down, model.layers[il].ffn_down_b, NULL,
  338. + NULL,
  339. + LLM_FFN_SILU, LLM_FFN_PAR, cb, il);
  340. + cb(cur, "ffn_out", il);
  341. +
  342. + cur = ggml_add(ctx0, cur, ffn_inp);
  343. + cb(cur, "ffn_out", il);
  344. +
  345. + cur = lctx.cvec.apply_to(ctx0, cur, il);
  346. + cb(cur, "l_out", il);
  347. +
  348. + // input for next layer
  349. + inpL = cur;
  350. + }
  351. +
  352. + cur = inpL;
  353. +
  354. + cur = llm_build_norm(ctx0, cur, hparams,
  355. + model.output_norm, NULL,
  356. + LLM_NORM_RMS, cb, -1);
  357. + cb(cur, "result_norm", -1);
  358. +
  359. + // lm_head
  360. + cur = llm_build_lora_mm(lctx, ctx0, model.output, cur);
  361. + cb(cur, "result_output", -1);
  362. +
  363. + ggml_build_forward_expand(gf, cur);
  364. +
  365. + return gf;
  366. + }
  367. };
  368. static struct ggml_cgraph * llama_build_graph_defrag(llama_context & lctx, const std::vector<uint32_t> & ids) {
  369. @@ -16942,6 +17176,10 @@ static struct ggml_cgraph * llama_build_graph(
  370. {
  371. result = llm.build_chameleon();
  372. } break;
  373. + case LLM_ARCH_SOLAR:
  374. + {
  375. + result = llm.build_solar();
  376. + } break;
  377. default:
  378. GGML_ABORT("fatal error");
  379. }
  380. @@ -20137,6 +20375,7 @@ enum llama_rope_type llama_rope_type(const struct llama_model * model) {
  381. case LLM_ARCH_GRANITE:
  382. case LLM_ARCH_GRANITE_MOE:
  383. case LLM_ARCH_CHAMELEON:
  384. + case LLM_ARCH_SOLAR:
  385. return LLAMA_ROPE_TYPE_NORM;
  386. // the pairs of head values are offset by n_rot/2