[Pallas] Add eager autotune baselines for rms_norm on TPU - #3285
Draft
norx1991 wants to merge 1 commit into
Draft
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 forrms_norm_fwd/rms_norm_bwd, gated to TPU via_baseline_on_tpu(the inverse ofexamples/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_tpureturnsNone, 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.