Skip to content

cuda : the gate per attention head of LFM2 takes a product and a quantize launch #124

Closed

Description

@rafasmour

LFM2 / LFM3 gate the attention result with one value per head: attn * sigmoid(gate) with the shapes [head size, heads, tokens] and [1, heads, tokens], then the output projection reads the product. The sigmoid already runs in the kernel of the gate mat-vec, but the product is a k_bin_bcast launch and the input of the output projection a quantize_q8_1 launch: two launches per attention layer, 22 of 394 per token on LFM3 1.7B (rocprofv3 kernel trace on an RX 7900 XT).

The kernel that makes the product can write the q8_1 copy.

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