Skip to content

[aotinductor] Add check_upperbound to gate the upperbound input check - #196131

Closed
ColinPeppler wants to merge 1 commit into
pytorch:mainfrom
ColinPeppler:export-D118874911
Closed

ColinPeppler wants to merge 1 commit into
pytorch:mainfrom
ColinPeppler:export-D118874911

Conversation

@ColinPeppler

@ColinPeppler ColinPeppler commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Why?

AOTI_RUNTIME_CHECK_INPUTS=1 codegens input shape checks against the bounds baked in at lowering time. The lowerbound half is already gated by config.aot_inductor.check_lowerbound (D88203028). The upperbound half is unconditional.

How?

Add config.aot_inductor.check_upperbound, default True, and gate the dim value is too large codegen on it. No behavior change until a caller flips it.

Lowering wires it up in the diff on top.

Differential Revision: D118874911

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo

Summary:
## Why?
`AOTI_RUNTIME_CHECK_INPUTS=1` codegens input shape checks against the bounds baked in at lowering time. The lowerbound half is already gated by `config.aot_inductor.check_lowerbound` (D88203028). The upperbound half is unconditional.

## How?
Add `config.aot_inductor.check_upperbound`, default `True`, and gate the `dim value is too large` codegen on it. No behavior change until a caller flips it.

Lowering wires it up in the diff on top.

Test Plan:
```bash
$ buck2 test @//mode/opt //caffe2/test/inductor:test_aot_inductor -- TestCheckUpperboundConfig TestCheckLowerboundConfig
```

```text
Tests finished: Pass 3. Fail 0. Fatal 0. Skip 0. Build failure 0
```
https://www.internalfb.com/intern/testinfra/testrun/7318349770355153

Differential Revision: D118874911
@pytorch-bot

pytorch-bot Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (3 Unrelated Failures)

As of commit ff29cc3 with merge base 071dd4d (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

CRCR (non-blocking) - The following CRCR downstream CI jobs failed but are non-blocking:

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

@meta-codesync

meta-codesync Bot commented Sep 5, 2026

Copy link
Copy Markdown

@ColinPeppler has exported this pull request. If you are a Meta employee, you can view the originating Diff in D118874911.

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 8, 2026
@ColinPeppler

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants