MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / build_inp_out_ids

Method build_inp_out_ids

subprojects/llama.cpp/src/llama-graph.cpp:1474–1493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1472}
1473
1474ggml_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
1495ggml_tensor * llm_graph_context::build_inp_mean() const {
1496 auto inp = std::make_unique<llm_graph_input_mean>(cparams);

Callers

nothing calls this directly

Calls 3

ggml_new_tensor_1dFunction · 0.85
ggml_set_inputFunction · 0.85
add_inputMethod · 0.80

Tested by

no test coverage detected