Skip to content

[Pallas] Add eager autotune baselines for rms_norm on TPU - #3285

Draft
norx1991 wants to merge 1 commit into
mainfrom
yifeixu/pallas-rms-norm-autotune-baseline
Draft

[Pallas] Add eager autotune baselines for rms_norm on TPU#3285
norx1991 wants to merge 1 commit into
mainfrom
yifeixu/pallas-rms-norm-autotune-baseline

Conversation

@norx1991

@norx1991 norx1991 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

On TPU the rms_norm autotuner runs the default config to compute its correctness baseline, and that config OOMs scoped vmem at large reduction dims (e.g. H=32768), hard-failing autotuning with "Default config failed while computing baseline". This adds eager fp32 baselines for rms_norm_fwd/rms_norm_bwd, gated to TPU via _baseline_on_tpu (the inverse of examples/attention.py's _baseline_unless_tpu), so the autotuner can establish a baseline without running the OOMing default config.

On non-TPU backends _baseline_on_tpu returns None, so the existing default-config baseline is used unchanged (no-op).

Prerequisite for large-shape rms_norm on TPU: this removes the baseline crash, but the very largest shape (H=32768, ~66 KB over the 32 MB scoped-vmem ceiling) still needs the autotuner to find a fitting config rather than bailing — tracked separately.

On TPU the rms_norm kernels' autotune correctness-baseline runs the default
config, which OOMs scoped vmem at large reduction dims (e.g. H=32768) and
hard-fails autotuning with 'Default config failed while computing baseline'.
Provide eager fp32 baselines (gated to TPU via _baseline_on_tpu, the inverse of
attention.py's _baseline_unless_tpu) so the autotuner establishes a baseline
without running the OOMing default config. Mirrors examples/attention.py.

Prerequisite for large-shape support; the autotuner still needs to find a
vmem-fitting config at the largest shapes (tracked separately).
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant