| 1472 | } |
| 1473 | |
| 1474 | ggml_tensor * llm_graph_context::build_inp_out_ids() const { |
| 1475 | // note: when all tokens are output, we could skip this optimization to spare the ggml_get_rows() calls, |
| 1476 | // but this would make the graph topology depend on the number of output tokens, which can interere with |
| 1477 | // features that require constant topology such as pipline parallelism |
| 1478 | // ref: https://github.com/ggml-org/llama.cpp/pull/14275#issuecomment-2987424471 |
| 1479 | //if (n_outputs < n_tokens) { |
| 1480 | // return nullptr; |
| 1481 | //} |
| 1482 | |
| 1483 | auto inp = std::make_unique<llm_graph_input_out_ids>(hparams, cparams, n_outputs); |
| 1484 | |
| 1485 | auto & cur = inp->out_ids; |
| 1486 | |
| 1487 | cur = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, n_outputs); |
| 1488 | ggml_set_input(cur); |
| 1489 | |
| 1490 | res->add_input(std::move(inp)); |
| 1491 | |
| 1492 | return cur; |
| 1493 | } |
| 1494 | |
| 1495 | ggml_tensor * llm_graph_context::build_inp_mean() const { |
| 1496 | auto inp = std::make_unique<llm_graph_input_mean>(cparams); |
nothing calls this directly
no test coverage detected