Skip to content

Fix attention QK linkage error - #24134

Merged
kunal-vaishnavi merged 4 commits into
mainfrom
kvaishnavi/attention-qk
Mar 24, 2025
Merged

Fix attention QK linkage error#24134
kunal-vaishnavi merged 4 commits into
mainfrom
kvaishnavi/attention-qk

Conversation

@kunal-vaishnavi

Copy link
Copy Markdown
Contributor

Description

This PR moves the CUDA memcpy for the QK output when type T is equal to type QK from attention_impl.cu into attention_qk.cu.

Motivation and Context

This PR fixes a linkage error when type T and type QK are the same in attention_qk.cu.

@yuslepukhin

Copy link
Copy Markdown
Contributor

Looks reasonable

@yuslepukhin

Copy link
Copy Markdown
Contributor

The linkage error is due to the fact that Multihead attention code attempts to indirectly instantiate CopyQK with <float, float> but that does not exists

Comment thread onnxruntime/contrib_ops/cuda/bert/attention_impl.cu
@kunal-vaishnavi
kunal-vaishnavi merged commit 2b3d7fb into main Mar 24, 2025
@kunal-vaishnavi
kunal-vaishnavi deleted the kvaishnavi/attention-qk branch March 24, 2025 02:43
zhaoxul-qti pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Apr 17, 2025
### Description
This PR moves the CUDA memcpy for the QK output when type `T` is equal
to type `QK` from `attention_impl.cu` into `attention_qk.cu`.

### Motivation and Context
This PR fixes a linkage error when type `T` and type `QK` are the same
in `attention_qk.cu`.
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.

3 participants