Skip to content

cuda : rms_norm writes no q8_1 copy for rows that are no multiple of 512 #109

Closed

Description

@rafasmour

Gemma 4 31B has an embedding length of 5376, which is no multiple of 512 (MATRIX_ROW_PADDING). The rms_norm kernel writes the q8_1 copy of its result only for rows without padding, so on this model the copy is never made and two quantize_q8_1 launches per layer and token remain (inputs of the Q / K / V projections and of gate / up): 120 of the 241 quantize launches per token.

The mat-vec kernel reads ne10 / 32 blocks of each q8_1 row and never the padding, so the norm kernel can write the blocks of a padded row at the padded row stride and leave the padding alone.

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