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

Method build_graph

smallthinker/src/llama-model.cpp:13780–14061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13778}
13779
13780llm_graph_result_ptr llama_model::build_graph(
13781 const llm_graph_params & params,
13782 ggml_cgraph * gf,
13783 llm_graph_type type) const {
13784 std::unique_ptr<llm_graph_context> llm;
13785
13786 switch (arch) {
13787 case LLM_ARCH_LLAMA:
13788 {
13789 llm = std::make_unique<llm_build_llama>(*this, params, gf);
13790 } break;
13791 case LLM_ARCH_LLAMA4:
13792 {
13793 llm = std::make_unique<llm_build_llama_iswa>(*this, params, gf);
13794 } break;
13795 case LLM_ARCH_DECI:
13796 {
13797 llm = std::make_unique<llm_build_deci>(*this, params, gf);
13798 } break;
13799 case LLM_ARCH_BAICHUAN:
13800 {
13801 llm = std::make_unique<llm_build_baichuan>(*this, params, gf);
13802 } break;
13803 case LLM_ARCH_FALCON:
13804 {
13805 llm = std::make_unique<llm_build_falcon>(*this, params, gf);
13806 } break;
13807 case LLM_ARCH_GROK:
13808 {
13809 llm = std::make_unique<llm_build_grok>(*this, params, gf);
13810 } break;
13811 case LLM_ARCH_STARCODER:
13812 {
13813 llm = std::make_unique<llm_build_starcoder>(*this, params, gf);
13814 } break;
13815 case LLM_ARCH_REFACT:
13816 {
13817 llm = std::make_unique<llm_build_refact>(*this, params, gf);
13818 } break;
13819 case LLM_ARCH_BERT:
13820 case LLM_ARCH_JINA_BERT_V2:
13821 case LLM_ARCH_NOMIC_BERT:
13822 case LLM_ARCH_NOMIC_BERT_MOE:
13823 {
13824 llm = std::make_unique<llm_build_bert>(*this, params, gf);
13825 } break;
13826 case LLM_ARCH_BLOOM:
13827 {
13828 llm = std::make_unique<llm_build_bloom>(*this, params, gf);
13829 } break;
13830 case LLM_ARCH_MPT:
13831 {
13832 llm = std::make_unique<llm_build_mpt>(*this, params, gf);
13833 } break;
13834 case LLM_ARCH_STABLELM:
13835 {
13836 llm = std::make_unique<llm_build_stablelm>(*this, params, gf);
13837 } break;

Callers 1

graph_buildMethod · 0.45

Calls 1

build_poolingMethod · 0.80

Tested by

no test coverage detected