Skip to content

cuda: 5120-wide fused norm + Hadamard with PDL, and two-row PQ2_0 decode tiles on Hopper - #417

Merged
bri-prism merged 3 commits into
prismfrom
cuda/pq2-decode-tune
Oct 30, 2026
Merged

bri-prism merged 3 commits into
prismfrom
cuda/pq2-decode-tune

Conversation

@bri-prism

Copy link
Copy Markdown
Collaborator

Depends on #352 (stacked on its branch; the diff here is only the two commits below).

What

  • cuda: the fused RMS norm + Hadamard kernel also handles width 5120 (five 1024-element segments) and launches that
    width with programmatic dependent launch.
  • cuda: on Hopper, PQ2_0 one-column mat-vecs with at most 17408 rows use two rows per warp, so the smaller projections
    launch more CTAs; the vocabulary head keeps four rows per warp.

Why

  • After the upstream merge, 9B decode is 0.7% below current prism and 27B decode leaves time on the table: the
    5120-wide norm ran unfused, and the four-row tile left SMs idle on the smaller projections.

How

  • Same arithmetic order as before in both kernels, so outputs are bit-identical.
  • New test-backend-ops cases: the 5120-wide fused norm + transform at 1-33 tokens, and the two-row tile on both sides
    of the row cutoff with partial warps and CTAs.

Testing

Add 5120 (five 1024-element segments) to the widths the fused norm + Hadamard
kernel handles, and launch that width with programmatic dependent launch so it
overlaps the previous kernel's tail. Bit-identical to the unfused path.
Make the rows per warp of the PQ2_0 multi-column mat-vec a template parameter.
On Hopper, one-column launches with at most 17408 rows use two rows per warp, so
the smaller projections launch more CTAs; the vocabulary head keeps four-row
activation reuse. The per-row accumulation order is unchanged.
@bri-prism
bri-prism changed the base branch from merge/upstream-20261011 to prism October 30, 2026 18:03
@bri-prism
bri-prism merged commit e20db82 into prism Oct 30, 2026
5 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant