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

Support RoPE position info in batch prefill/decode kernels #69

Merged
merged 1 commit into from
Feb 1, 2024

Commits on Feb 1, 2024

  1. Support RoPE position info in batch prefill/decode kernels

    This PR adds q/k position information to batch prefill/decode
    kernels. More specifically, the kernel now accepts two
    additional arrays:
    * `q_rope_position` with shape `(total_q_len,)`, denoting the
    in-sequence position of each position in the input q.
    * `k_rope_pos_offset` with shape `(num_sequence,)`, denoting
    the start position of each sequence in k.
    
    These two arrays helps on-the-fly calculate RoPE in multi-level
    cases.
    
    Tests `test_batch_prefill` and `test_batch_decode` can pass.
    Performance is not validated yet. Per discussion with Zihao,
    this change is not very likely to incur significant perf
    regression.
    MasterJH5574 committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    d89fe51 View commit details
    Browse the repository at this point in the history