Skip to content

cuda : a request in a unified KV cache attends over the rows of all sequences on HIP #103

Closed

Description

@rafasmour

With a unified KV cache (--kv-unified) every request attends over all used cells of the shared pool, the cells of the other sequences are masked. With three long conversations at once the attention of each prompt batch reads three times the rows it needs.

Upstream PR 29510 added ggml_flash_attn_ext_rows: the kernel gets a list of the K/V rows of each sequence. In the CUDA backend only the NVIDIA MMA kernel takes the list, so on HIP the probe of llama-context fails ("Flash Attention over K/V rows not supported, set to disabled").

To check: the row list on RDNA3 (WMMA, tile and vec kernels), the gain with concurrent long requests and the cost for a single request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions