← Back to Pull requests

pin Triton RMSNorm/LayerNorm launch configs instead of autotuning #792

Open
unknown opened this pull request with 246 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 02, 2026 20:25 UTC
Author

Description

Fixes #790 (related PRs: #646, #615, #593).

Triton's autotuner picks a launch config per process by timing. For the
RMSNorm and LayerNorm kernels, num_warps (and the RMSNorm dgamma-reduce block
shape) sets the reduction order, so processes running identical
shapes can produce slightly different results.

Launch configs are now fixed by row width:

  • RMSNorm fwd num_warps: 1 (<= 1024), 4 (<= 8192), else 16

  • RMSNorm bwd num_warps: 1 (<= 1024), 4 (<= 2048), else 16

  • RMSNorm dgamma reduce: BLOCK_SIZE_M=128, BLOCK_SIZE_N=64, num_warps=8

  • LayerNorm fwd num_warps: 1 (<= 2048), 4 (<= 6144), else 8; num_stages=1
  • On gfx950 these are within ~1% geomean of the per-shape best. LayerNorm fwd
    is 1.2-2.4x faster at widths <= 2048, which the old config space missed.
    The autotune kwargs remain for API compatibility. The FP8 transpose stays
    autotuned because its output does not depend on the config.

    Also adds a test.

    cc @jbelofamd

    Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

  • Infra/Build change

  • Code refactoring
  • Changes

    Please list the changes introduced in this PR:

  • Change A

  • Change B
  • Checklist:

  • I have read and followed the contributing guidelines

  • The functionality is complete

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation

  • My changes generate no new warnings

  • I have added tests that prove my fix is effective or that my feature works

  • New and existing unit tests pass locally with my changes
  • Diff: 246 lines (+184 / -62) across 3 files Reviewer: Micky774 Review duration: 42323m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.62) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.62 · 246 lines diff across 3 files
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.330
    Sensitive Paths sensitive_paths
    0.062
    Real PR Conversation Timeline
    1 comments
    "Review active on #792"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.1% (MEDIUM) · Higher = larger blast radius
    62.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 33.1% · Safe to merge
    33.1%