Skip to content

llama : fix qs.n_attention_wv for DeepSeek-V2 - #9156

Merged
ggerganov merged 1 commit into
masterfrom
compilade/fix-deepseek-n_wv
Aug 27, 2024
Merged

ggerganov merged 1 commit into
masterfrom
compilade/fix-deepseek-n_wv

Conversation

@compilade

Copy link
Copy Markdown
Collaborator

Should fix #9155

This previously (before #8526) did not trigger the assertion because a value of 0 was accepted for recurrent models, but DeepSeek-V2(-Lite) is not a recurrent model.

Counting either attn_kv_a_mqa.weight or attn_kv_b.weight should fix this, but I went with the shorter of the two to fit vertically with the other conditions in the if which counts those tensors.

@mann1x can you confirm whether or not this fixes the problem?


@compilade compilade added bugfix fixes an issue or bug Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix labels Aug 24, 2024
@mann1x

mann1x commented Aug 25, 2024

Copy link
Copy Markdown

@compilade
Sorry, must have seen the notification while I was already sleeping yesterday... was unread but I have no recollection of it.

Tested it and works, was able to quantize and run the model on ollama.

@mann1x

mann1x commented Aug 27, 2024

Copy link
Copy Markdown

@ggerganov
Can you check the tests which are failing?
Seems there's a problem with the CI pipeline, not the PR.

@ggerganov
ggerganov merged commit 78eb487 into master Aug 27, 2024
@ggerganov
ggerganov deleted the compilade/fix-deepseek-n_wv branch August 27, 2024 10:09
dsx1986 pushed a commit to dsx1986/llama.cpp that referenced this pull request Oct 29, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
Nexesenex pushed a commit to Nexesenex/croco.cpp that referenced this pull request Feb 25, 2025
Nexesenex pushed a commit to Nexesenex/croco.cpp that referenced this pull request Feb 25, 2025
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes an issue or bug Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: GGML_ASSERT((qs.n_attention_wv == n_attn_layer) && "n_attention_wv is unexpected") failed with deepseek2

3 participants