Skip to content

cuda : a gemm input is converted to F16 for every mat-mul that reads it #126

Closed

Description

@rafasmour

A prompt batch through the F16 gemm path converts the F32 input of every mat-mul to F16, also when the mat-muls of a layer read the same input: Q / K / V, gate / up, and the four projections of a delta net layer (attn_qkv, ssm_alpha, ssm_beta, attn_gate).

Kernel trace of Ornith 1.5 9B Q4_K_M at ubatch 512 on an RX 7900 XT (rocprofv3): 245 gemms per batch, 490 convert_unary_cont_vec4 launches (input and output of each), 18.2 us each, 8.9 ms of 160 ms kernel time. About 120 of the 245 input conversions repeat the conversion of the mat-mul before.

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