Add broadcast-compatible scale support for RmsNorm#332
Open
rsuderman wants to merge 1 commit intoiree-org:mainfrom
Open
Add broadcast-compatible scale support for RmsNorm#332rsuderman wants to merge 1 commit intoiree-org:mainfrom
rsuderman wants to merge 1 commit intoiree-org:mainfrom
Conversation
Allow RmsNorm scale tensors to have broadcast-compatible shapes
(e.g. {1,c,1,1} instead of {1,c,h,w}), letting torch.aten.rms_norm
handle the broadcasting internally. Also update getScalarConstantAsm
to emit the actual tensor shape instead of hardcoding tensor<1x...>.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Rob Suderman <rob.suderman@gmail.com>
sjain-stanford
requested changes
Apr 11, 2026
Member
sjain-stanford
left a comment
There was a problem hiding this comment.
In isolation this change is fine but I'm not sure this is a level of flexibility we should allow. Both PT and cudnn consistently use per element scale for RMS norm (i.e. of normalized shape - matching input shape modulo batch dims). Why would we want to differ / be more general than that? If this change was prompted by allowing hipdnn -> fusilli to bridge, then its a placebo and the real issue lies in hipdnn scale not matching normalized shapes.
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.
Allow RmsNorm scale tensors to have broadcast-compatible shapes (e.g. {1,c,1,1} instead of {1,c,h,w}), letting torch.aten.rms_norm handle the broadcasting internally. Also update getScalarConstantAsm to emit the actual tensor shape instead of hardcoding tensor<1x...>.