Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use head_dim in config if exists #2622

Merged
merged 1 commit into from
Jan 27, 2024
Merged

Use head_dim in config if exists #2622

merged 1 commit into from
Jan 27, 2024

Conversation

xiangxu-google
Copy link
Contributor

@xiangxu-google xiangxu-google commented Jan 27, 2024

The change is for some models which set head_dim explicitly instead of using hidden_size // num_attention_heads.

The wrong head_dim read leads to the wrong size kv_cache created, which makes the PagedAttention CUDA kernel writes the new KV to unexpected GPU memory. During our case, with the head_dim setting wrong, the PagedAttention kernel writes values into model weights, which causes huge confusion and higher debugging cost (because the model can run without any CUDA memory error raised, and the model weights are modified unexpectedly during forward).

@simon-mo simon-mo merged commit 220a476 into vllm-project:main Jan 27, 2024
17 checks passed
NikolaBorisov pushed a commit to deepinfra/vllm that referenced this pull request Jan 31, 2024
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
alexm-neuralmagic pushed a commit to neuralmagic/nm-vllm that referenced this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants