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

feat: Separate QK/VO head dim dispatch for sm90 AOT #778

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

abcdabcd987
Copy link
Member

#765 introduces hacks to support DeepSeek head dims, but AOT is broken. This PR adds dispatch on the pair of QK and VO head dim.

It fixes the problem of missing symbols.

$ python -c "from flashinfer import _kernels_sm90"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: python3.10/site-packages/flashinfer/_kernels_sm90.cpython-310-x86_64-linux-gnu.so: undefined symbol: ...

$ c++filt _ZN10flashinfer34SinglePrefillWithKVCacheDispatchedILj192ELj192ELNS_8MaskModeE1ELb1ENS_13LogitsSoftCapENS_19SinglePrefillParamsIN7cutlass6half_tES5_S5_iEEEE9cudaErrorRT4_P11CUstream_st

cudaError flashinfer::SinglePrefillWithKVCacheDispatched<192u, 192u, (flashinfer::MaskMode)1, true, flashinfer::LogitsSoftCap, flashinfer::SinglePrefillParams<cutlass::half_t, cutlass::half_t, cutlass::half_t, int> >(flashinfer::SinglePrefillParams<cutlass::half_t, cutlass::half_t, cutlass::half_t, int>&, CUstream_st*)

@abcdabcd987 abcdabcd987 requested a review from yzh119 February 3, 2025 23:40
@@ -29,8 +29,8 @@

head_dims = os.environ.get("FLASHINFER_HEAD_DIMS", "64,128,256").split(",")
head_dims = list(map(int, head_dims))
SM90_ALLOWED_HEAD_DIMS = {64, 128, 256}
head_dims_sm90 = [d for d in head_dims if d in SM90_ALLOWED_HEAD_DIMS]
SM90_ALLOWED_HEAD_DIMS = {(64, 64), (128, 128), (256, 256), (192, 128)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

(192, 128) is not compatible with page attention kernels, can we separate head_dim for page attention and ragged attention kernels?

@yzh119 yzh119 merged commit 1ebbde3 into flashinfer-ai:main Feb 4, 2025
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.

2 participants