| 1295 | } |
| 1296 | |
| 1297 | ggml_cgraph * llama_context::graph_init() { |
| 1298 | ggml_init_params params = { |
| 1299 | /*.mem_size =*/ buf_compute_meta.size(), |
| 1300 | /*.mem_buffer =*/ buf_compute_meta.data(), |
| 1301 | /*.no_alloc =*/ true, |
| 1302 | }; |
| 1303 | |
| 1304 | ctx_compute.reset(ggml_init(params)); |
| 1305 | |
| 1306 | return ggml_new_graph_custom(ctx_compute.get(), graph_max_nodes(), false); |
| 1307 | } |
| 1308 | |
| 1309 | ggml_cgraph * llama_context::graph_reserve(uint32_t n_tokens, uint32_t n_seqs, uint32_t n_outputs, const llama_memory_state_i * mstate) { |
| 1310 | LLAMA_LOG_DEBUG("%s: reserving a graph for ubatch with n_tokens = %4u, n_seqs = %2u, n_outputs = %4u\n", __func__, n_tokens, n_seqs, n_outputs); |