MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / graph_init

Method graph_init

smallthinker/src/llama-context.cpp:1297–1307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1295}
1296
1297ggml_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
1309ggml_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);

Callers 1

updateMethod · 0.80

Calls 6

ggml_initFunction · 0.50
ggml_new_graph_customFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected