Integration issue

#3
by DarkKitsune - opened

Hi, I tried following the instructions in INTEGRATION.md to integrate FUSE3 into a local fork of llama.cpp (based on b10235 specifically, a release from 5 days ago). I can make it as far as step 3, until I try to modify LLM_TENSOR_NAMES as instructed. However, the map in this version of llama.cpp is structured in a way that I cannot insert the provided code into it:

static const std::map<llm_tensor, const char *> LLM_TENSOR_NAMES = {
    { LLM_TENSOR_TOKEN_EMBD,                             "token_embd" },
    { LLM_TENSOR_OUTPUT_NORM,                            "output_norm" },
    { LLM_TENSOR_OUTPUT_NORM_LFM2,                       "token_embd_norm" }, // fix for wrong tensor name
    { LLM_TENSOR_OUTPUT,                                 "output" },
    { LLM_TENSOR_ROPE_FREQS,                             "rope_freqs" },
    { LLM_TENSOR_ATTN_NORM,                              "blk.%d.attn_norm" },
    { LLM_TENSOR_ATTN_Q,                                 "blk.%d.attn_q" },
...
    { LLM_TENSOR_DSPARK_CONF_PROJ,                       "conf_proj" },
};

But INTEGRATION.md says I need to insert this:

// In LLM_TENSOR_NAMES for FUSE3:
{
    LLM_ARCH_FUSE3,
    {
        { LLM_TENSOR_TOKEN_EMBD,      "token_embd.weight" },
        { LLM_TENSOR_OUTPUT_NORM_LFM2, "token_embd_norm.weight" },
        { LLM_TENSOR_OUTPUT,          "output.weight" },
        { LLM_TENSOR_ATTN_NORM,       "blk.{bid}.attn_norm.weight" },
        { LLM_TENSOR_ATTN_Q,          "blk.{bid}.attn_q.weight" },
        { LLM_TENSOR_ATTN_K,          "blk.{bid}.attn_k.weight" },
        { LLM_TENSOR_ATTN_V,          "blk.{bid}.attn_v.weight" },
        { LLM_TENSOR_ATTN_Q_NORM,     "blk.{bid}.attn_q_norm.weight" },
        { LLM_TENSOR_ATTN_K_NORM,     "blk.{bid}.attn_k_norm.weight" },
        { LLM_TENSOR_ATTN_OUT,        "blk.{bid}.attn_output.weight" },
        { LLM_TENSOR_FFN_NORM,        "blk.{bid}.ffn_norm.weight" },
        { LLM_TENSOR_FFN_GATE,        "blk.{bid}.ffn_gate.weight" },
        { LLM_TENSOR_FFN_DOWN,        "blk.{bid}.ffn_down.weight" },
        { LLM_TENSOR_FFN_UP,          "blk.{bid}.ffn_up.weight" },
        { LLM_TENSOR_SHORTCONV_CONV,    "blk.{bid}.shortconv_conv.weight" },
        { LLM_TENSOR_SHORTCONV_INPROJ,  "blk.{bid}.shortconv_inproj.weight" },
        { LLM_TENSOR_SHORTCONV_OUTPROJ, "blk.{bid}.shortconv_outproj.weight" },
    }
},

Do I need an older version of llama.cpp perhaps? Or am I simply misunderstanding?

this is becasue it uses a custom architecure, llama integration insnt easy, am working on it today to make it way simpler

Sign up or log in to comment