Skip to content

cuda : decode batches of 9 and more tokens leave the mat-vec kernel on RDNA3 #101

Closed

Description

@rafasmour

Decode batches above 8 tokens leave the mat-vec kernel and run in the mat-mul kernel (MMQ). On an RX 7900 XT a batch of 9 tokens of Ornith 1.5 9B Q4_K_M costs about 18 ms against 14.5 ms for 8 tokens, and the cost stays at 18 ms up to 16 tokens.

Such batches come from several slots that verify drafts in one step (3 slots x 5 rows = 15 tokens) and from drafts longer than 7 tokens.

Upstream PR 31533 added a few-row MMQ kernel for 2 to 24 columns. It is compiled for NVIDIA only. Its author has a version for RDNA3 with int8 WMMA (upstream commit 6ad15f4, tuned on gfx1151), which is in no PR yet.

To check: the port on gfx1100, and from which column count it wins there.

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