Skip to content

convert : fix duplicate key DeepSeek-R1 conversion error - #14103

Merged
CISC merged 2 commits into
masterfrom
cisc/fix-deepseek-duplicate-key
Jun 10, 2025
Merged

CISC merged 2 commits into
masterfrom
cisc/fix-deepseek-duplicate-key

Conversation

@CISC

@CISC CISC commented Jun 10, 2025

Copy link
Copy Markdown
Member

Since DeepSeekV3 support was merged into transformers AutoConfig started returning an incorrect head_dim value.

Fixes #14093

@github-actions github-actions Bot added the python python script changes label Jun 10, 2025
@ericcurtin
ericcurtin requested a review from Copilot June 10, 2025 12:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a guard to avoid writing duplicate key/value lengths when head_dim from AutoConfig is incorrect for DeepSeekV3.

  • Adds a conditional check comparing qk_rope_head_dim to head_dim before calling add_key_length and add_value_length
  • Documents the workaround with a comment pointing to the relevant Transformers config file
Comments suppressed due to low confidence (1)

convert_hf_to_gguf.py:558

  • Introduce a dedicated test for the DeepSeekV3 conversion path to cover this workaround and ensure future changes to head_dim handling don’t regress.
if (head_dim := self.hparams.get("head_dim")) is not None:

Comment thread convert_hf_to_gguf.py Outdated
Comment thread convert_hf_to_gguf.py
@CISC
CISC merged commit 55f6b9f into master Jun 10, 2025
@CISC
CISC deleted the cisc/fix-deepseek-duplicate-key branch June 10, 2025 21:29
@compilade compilade mentioned this pull request Jun 12, 2025
4 of 16 tasks
qnixsynapse pushed a commit to janhq/llama.cpp that referenced this pull request Jul 2, 2025
qnixsynapse pushed a commit to janhq/llama.cpp that referenced this pull request Jul 6, 2025
qnixsynapse pushed a commit to janhq/llama.cpp that referenced this pull request Jul 6, 2025
qnixsynapse pushed a commit to janhq/llama.cpp that referenced this pull request Jul 10, 2025
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 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
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: ValueError: Duplicated key name 'deepseek2.attention.key_length'

3 participants