| 656 | } |
| 657 | |
| 658 | void llm_graph_result::reset() { |
| 659 | t_inp_tokens = nullptr; |
| 660 | t_inp_embd = nullptr; |
| 661 | t_logits = nullptr; |
| 662 | t_embd = nullptr; |
| 663 | t_embd_pooled = nullptr; |
| 664 | t_sampled.clear(); |
| 665 | t_sampled_probs.clear(); |
| 666 | t_sampled_logits.clear(); |
| 667 | t_candidates.clear(); |
| 668 | |
| 669 | params = {}; |
| 670 | |
| 671 | inputs.clear(); |
| 672 | |
| 673 | buf_compute_meta.resize(ggml_tensor_overhead()*max_nodes + ggml_graph_overhead_custom(max_nodes, false)); |
| 674 | |
| 675 | ggml_init_params params = { |
| 676 | /*.mem_size =*/ buf_compute_meta.size(), |
| 677 | /*.mem_buffer =*/ buf_compute_meta.data(), |
| 678 | /*.no_alloc =*/ true, |
| 679 | }; |
| 680 | |
| 681 | ctx_compute.reset(ggml_init(params)); |
| 682 | |
| 683 | gf = ggml_new_graph_custom(ctx_compute.get(), max_nodes, false); |
| 684 | } |
| 685 | |
| 686 | void llm_graph_result::set_inputs(const llama_ubatch * ubatch) { |
| 687 | for (auto & input : inputs) { |
nothing calls this directly
no test coverage detected