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

Function build_rs_inp_impl

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

Source from the content-addressed store, hash-verified

2174}
2175
2176static std::unique_ptr<llm_graph_input_rs> build_rs_inp_impl(
2177 ggml_context * ctx0,
2178 const llama_ubatch & ubatch,
2179 const llama_memory_recurrent_context * mctx_cur) {
2180
2181 auto inp = std::make_unique<llm_graph_input_rs>(mctx_cur);
2182
2183 const int64_t n_rs = mctx_cur->get_n_rs();
2184 const int64_t n_seqs = ubatch.n_seqs;
2185
2186 inp->s_copy = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, n_rs);
2187 ggml_set_input(inp->s_copy);
2188
2189 inp->s_copy_main = ggml_view_1d(ctx0, inp->s_copy, n_seqs, 0);
2190 inp->s_copy_extra = ggml_view_1d(ctx0, inp->s_copy, n_rs - n_seqs, n_seqs * inp->s_copy->nb[0]);
2191
2192 inp->head = mctx_cur->get_head();
2193 inp->rs_z = mctx_cur->get_rs_z();
2194
2195 return inp;
2196}
2197
2198llm_graph_input_rs * llm_graph_context::build_rs_inp() const {
2199 const auto * mctx_cur = static_cast<const llama_memory_recurrent_context *>(mctx);

Callers 3

build_rs_inpMethod · 0.85
build_inp_mem_hybridMethod · 0.85

Calls 6

ggml_new_tensor_1dFunction · 0.85
ggml_set_inputFunction · 0.85
ggml_view_1dFunction · 0.85
get_n_rsMethod · 0.80
get_headMethod · 0.80
get_rs_zMethod · 0.80

Tested by

no test coverage detected