-
Notifications
You must be signed in to change notification settings - Fork 181
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
[Question] How to support custom stride of paged_kv for hopper prefill attention #702
Comments
Hi @jianfei-wangg , yes we can use non-contiguous paged_kv for sm90 prefill. The flashinfer/flashinfer/prefill.py Lines 1626 to 1635 in 1c8dc36
The reason we preprocess these offsets instead of computing offsets inside kernels is that we found that producer will be slow if we compute the offsets inside kernels:
So we want to avoid pointer arithmetic as much as possible and pre-compute the offsets. |
@yzh119 Thanks for in-time response, I can integrate hopper attention into out framework now. |
It depends on whether we are using the same indices for each layer, if so, we can move the logic to plan. |
Hello, I found that in 0.2.0.post1, the page_kv_t supports custom strides, which means we can use a page_layout of [max_num_pages, num_layer, 2, page_size, num_heads, head_dim]. this works fine with sm < 90 prefill kernels.
However, when I try the above configuration for sm90 prefill kernel, hopper params (flashinfer/attention/hopper/params.cuh) does not have variables like stride_page or custom_strides. So, how can I use non-continious paged_kv for sm90 prefill?
The text was updated successfully, but these errors were encountered: