Skip to content

cuda : the output scale of a layer is its own launch #112

Closed

Description

@rafasmour

Each Gemma 4 layer ends with (rms_norm(x) * w + residual) * layer_output_scale. The norm, the weight and the residual add run in one kernel already; the product with the single scale value is a separate k_bin_bcast launch: 60 launches per token on Gemma 4 31B (rocprofv3 kernel trace on an RX 7900 XT), about 2.4 us of kernel time each plus the launch.

The rms_norm kernel can apply the scale after the add.

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