| 1167 | } |
| 1168 | |
| 1169 | ggml_tensor * llama_kv_cache::build_input_v_idxs(ggml_context * ctx, const llama_ubatch & ubatch) const { |
| 1170 | const uint32_t n_tokens = ubatch.n_tokens; |
| 1171 | |
| 1172 | ggml_tensor * v_idxs; |
| 1173 | |
| 1174 | if (!v_trans) { |
| 1175 | v_idxs = ggml_new_tensor_1d(ctx, GGML_TYPE_I64, n_tokens); |
| 1176 | } else { |
| 1177 | v_idxs = ggml_new_tensor_1d(ctx, GGML_TYPE_I64, n_tokens*hparams.n_embd_v_gqa_max()); |
| 1178 | } |
| 1179 | |
| 1180 | ggml_set_input(v_idxs); |
| 1181 | |
| 1182 | return v_idxs; |
| 1183 | } |
| 1184 | |
| 1185 | void llama_kv_cache::set_input_k_idxs(ggml_tensor * dst, const llama_ubatch * ubatch, const slot_info & sinfo) const { |
| 1186 | const uint32_t n_tokens = ubatch->n_tokens; |
no test coverage detected