Skip to content

Commit 07c5c4f

Browse files
committed
Fix mamba layer in plamo2
1 parent 14df6ce commit 07c5c4f

File tree

4 files changed

+299
-209
lines changed

4 files changed

+299
-209
lines changed

convert_hf_to_gguf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,8 +3577,6 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
35773577

35783578
new_name = self.map_tensor_name(name)
35793579

3580-
print(f"Plamo2Model: {name} -> {new_name}, shape={data_torch.shape}")
3581-
35823580
return [(new_name, data_torch)]
35833581

35843582

gguf-py/gguf/tensor_mapping.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class TensorNameMap:
6666
"output", # llama-pth bloom internlm2
6767
"word_embeddings_for_head", # persimmon
6868
"lm_head.linear", # phi2
69+
"lm_head", # plamo2
6970
"output_layer", # chatglm
7071
"head", # rwkv
7172
"head.out", # wavtokenizer

src/llama-context.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@ llm_graph_result_ptr llama_context::process_ubatch(const llama_ubatch & ubatch,
701701

702702
// LLAMA_LOG_INFO("graph build time: %.3f ms (%d nodes, %d leafs)\n", (ggml_time_us() - t_start_us)/1000.0, gf->n_nodes, gf->n_leafs);
703703

704+
// Dump computation graph for visualization
705+
ggml_graph_dump_dot(gf, NULL, "llama.dot");
706+
704707
if (!ggml_backend_sched_alloc_graph(sched.get(), gf)) {
705708
LLAMA_LOG_ERROR("%s: failed to allocate graph\n", __func__);
706709
ret = GGML_STATUS_ALLOC_FAILED;
@@ -1043,11 +1046,6 @@ int llama_context::decode(const llama_batch & batch_inp) {
10431046
}
10441047
}
10451048

1046-
// plot the computation graph in dot format (for debugging purposes)
1047-
//if (n_past%100 == 0) {
1048-
// ggml_graph_dump_dot(gf, NULL, "llama.dot");
1049-
//}
1050-
10511049
auto * t_logits = res->get_logits();
10521050
auto * t_embd = cparams.embeddings ? res->get_embd() : nullptr;
10531051

0 commit comments

Comments
 (0)