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

Method graph_max_nodes

subprojects/llama.cpp/src/llama-context.cpp:2015–2024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2013//
2014
2015uint32_t llama_context::graph_max_nodes(uint32_t n_tokens) const {
2016 if (model.arch == LLM_ARCH_QWEN3NEXT) {
2017 return std::max<uint32_t>(n_tokens * 40, 32u * model.n_tensors());
2018 }
2019 uint32_t res = std::max<uint32_t>(1024u, 8u*model.n_tensors());
2020 for (const auto & lora : model.loras) {
2021 res += lora->get_n_nodes();
2022 }
2023 return res;
2024}
2025
2026llm_graph_result * llama_context::get_gf_res_reserve() const {
2027 return static_cast<llm_graph_result *>(gf_res_reserve.get());

Callers 1

sched_reserveMethod · 0.95

Calls 2

n_tensorsMethod · 0.80
get_n_nodesMethod · 0.80

Tested by

no test coverage detected