Skip to content

Short-circuit ops.masked for statically resolvable masks - #180340

Closed
eellison wants to merge 1 commit into
gh/eellison/996/basefrom
gh/eellison/996/head
Closed

eellison wants to merge 1 commit into
gh/eellison/996/basefrom
gh/eellison/996/head

Conversation

@eellison

@eellison eellison commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

When the mask's bounds are statically True or False, ops.masked now
short-circuits: returns body() directly for always-True, returns
constant(other) for always-False. Currently a no-op since mask bounds
don't resolve with full-range iteration, but this becomes the key
codegen hook once sub-range iteration infrastructure (create_sub_range
from the nested reduction work) is available.

Also adds qknorm_rope_fusion_followup.md documenting the design space
explored, benchmark results, and the path forward for sub-range codegen.

Authored with Claude.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Apr 14, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/180340

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot

pytorch-bot Bot commented Apr 14, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

eellison added a commit that referenced this pull request Apr 14, 2026
When the mask's bounds are statically True or False, ops.masked now
short-circuits: returns body() directly for always-True, returns
constant(other) for always-False. Currently a no-op since mask bounds
don't resolve with full-range iteration, but this becomes the key
codegen hook once sub-range iteration infrastructure (create_sub_range
from the nested reduction work) is available.

Also adds qknorm_rope_fusion_followup.md documenting the design space
explored, benchmark results, and the path forward for sub-range codegen.

Authored with Claude.


ghstack-source-id: a41cb09
Pull-Request: #180340
@eellison eellison closed this Apr 14, 2026
@github-actions
github-actions Bot deleted the gh/eellison/996/head branch May 15, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant