Skip to content

[inductor] Enable strict FlexibleLayout stride checking in tests and CI - #200996

Draft
eellison wants to merge 13 commits into
gh/eellison/1127/basefrom
gh/eellison/1127/head
Draft

eellison wants to merge 13 commits into
gh/eellison/1127/basefrom
gh/eellison/1127/head

Conversation

@eellison

@eellison eellison commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

AI-generated description (unreviewed)

Turns strict_flexible_layout_strides on for all inductor tests (replacing the
per-file opt-in list) and exports it in .ci/pytorch/test.sh for the rest.
Production stays off. The full CI matrix is green with it on.

Test Plan:

python test/inductor/test_layout_freezing.py

plus CI.

Authored with Claude Code.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit cde8135 with merge base 4a03eed (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot

pytorch-bot Bot commented Oct 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.

[ghstack-poisoned]
eellison added a commit that referenced this pull request Oct 15, 2026
## AI-generated description (draft, not yet reviewed by the author)

Last PR of the FlexibleLayout freeze-discipline stack. With every area
fixed, the per-file opt-in list in `torch/_inductor/test_case.py` is
replaced by turning `strict_flexible_layout_strides` on for all inductor
tests (unless `TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES` is set
explicitly), and CI exports the env var so tests that compile through other
`TestCase` classes are checked too. Production stays off.

New violations now fail at compile time in CI, at the line that read the
provisional stride, instead of becoming silent wrong results. For example,
the conv backward lowering added weeks before the check was first run
(fixed earlier in this stack) would have been caught in its own PR.

Validated: the full CI matrix (default, inductor, dynamo_wrapped,
benchmarks, ROCm, MPS, aarch64) was green with the check on everywhere at
#193860 e77db71; the only failure, torchtitan, was failing on main.

Test Plan:

Run on B200 against main e972a0a, with strict mode on for these files:

```
python test/inductor/test_layout_freezing.py   # 31 passed
python test/inductor/test_torchinductor.py     # 2717 passed, 3 failed (also fail on main)
```

plus full CI on this PR.

Authored with Claude Code.

ghstack-source-id: b69d4d4
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 2, 2026
## AI-generated description (draft, not yet reviewed by the author)

Last PR of the FlexibleLayout freeze-discipline stack. With every area
fixed, the per-file opt-in list in `torch/_inductor/test_case.py` is
replaced by turning `strict_flexible_layout_strides` on for all inductor
tests (unless `TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES` is set
explicitly), and CI exports the env var so tests that compile through other
`TestCase` classes are checked too. Production stays off.

New violations now fail at compile time in CI, at the line that read the
provisional stride, instead of becoming silent wrong results. For example,
the conv backward lowering added weeks before the check was first run
(fixed earlier in this stack) would have been caught in its own PR.

Validated: the full CI matrix (default, inductor, dynamo_wrapped,
benchmarks, ROCm, MPS, aarch64) was green with the check on everywhere at
#193860 e77db71; the only failure, torchtitan, was failing on main.

Test Plan:

Run on B200 against main a67a74d, with strict mode on for these files:

```
python test/inductor/test_layout_freezing.py   # 34 passed
python test/inductor/test_torchinductor.py     # 2790 passed, 3 failed (also fail on main)
```

plus full CI on this PR.

Authored with Claude Code.

ghstack-source-id: 8a776a5
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 2, 2026
## AI-generated description (draft, not yet reviewed by the author)

Last PR of the FlexibleLayout freeze-discipline stack. With every area
fixed, the per-file opt-in list in `torch/_inductor/test_case.py` is
replaced by turning `strict_flexible_layout_strides` on for all inductor
tests (unless `TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES` is set
explicitly), and CI exports the env var so tests that compile through other
`TestCase` classes are checked too. Production stays off.

New violations now fail at compile time in CI, at the line that read the
provisional stride, instead of becoming silent wrong results. For example,
the conv backward lowering added weeks before the check was first run
(fixed earlier in this stack) would have been caught in its own PR.

Validated: the full CI matrix (default, inductor, dynamo_wrapped,
benchmarks, ROCm, MPS, aarch64) was green with the check on everywhere at
#193860 e77db71; the only failure, torchtitan, was failing on main.

Test Plan:

Run on B200 against main a67a74d, with strict mode on for these files:

```
python test/inductor/test_layout_freezing.py   # 34 passed
python test/inductor/test_torchinductor.py     # 2790 passed, 3 failed (also fail on main)
```

plus full CI on this PR.

Authored with Claude Code.

ghstack-source-id: e976c8a
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 3, 2026
## AI-generated description (draft, not yet reviewed by the author)

Last PR of the FlexibleLayout freeze-discipline stack. With every area
fixed, the per-file opt-in list in `torch/_inductor/test_case.py` is
replaced by turning `strict_flexible_layout_strides` on for all inductor
tests (unless `TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES` is set
explicitly), and CI exports the env var so tests that compile through other
`TestCase` classes are checked too. Production stays off.

New violations now fail at compile time in CI, at the line that read the
provisional stride, instead of becoming silent wrong results. For example,
the conv backward lowering added weeks before the check was first run
(fixed earlier in this stack) would have been caught in its own PR.

Validated: the full CI matrix (default, inductor, dynamo_wrapped,
benchmarks, ROCm, MPS, aarch64) was green with the check on everywhere at
#193860 e77db71; the only failure, torchtitan, was failing on main.

Test Plan:

Run on B200 against main a67a74d, with strict mode on for these files:

```
python test/inductor/test_layout_freezing.py   # 34 passed
python test/inductor/test_torchinductor.py     # 2790 passed, 3 failed (also fail on main)
```

plus full CI on this PR.

Authored with Claude Code.

ghstack-source-id: f001aad
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 3, 2026
## AI-generated description (draft, not yet reviewed by the author)

Last PR of the FlexibleLayout freeze-discipline stack. With every area
fixed, the per-file opt-in list in `torch/_inductor/test_case.py` is
replaced by turning `strict_flexible_layout_strides` on for all inductor
tests (unless `TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES` is set
explicitly), and CI exports the env var so tests that compile through other
`TestCase` classes are checked too. Production stays off.

New violations now fail at compile time in CI, at the line that read the
provisional stride, instead of becoming silent wrong results. For example,
the conv backward lowering added weeks before the check was first run
(fixed earlier in this stack) would have been caught in its own PR.

Validated: the full CI matrix (default, inductor, dynamo_wrapped,
benchmarks, ROCm, MPS, aarch64) was green with the check on everywhere at
#193860 e77db71; the only failure, torchtitan, was failing on main.

Test Plan:

Run on B200 against main a67a74d, with strict mode on for these files:

```
python test/inductor/test_layout_freezing.py   # 34 passed
python test/inductor/test_torchinductor.py     # 2790 passed, 3 failed (also fail on main)
```

plus full CI on this PR.

Authored with Claude Code.

ghstack-source-id: 86647c5
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 3, 2026
## AI-generated description (draft, not yet reviewed by the author)

Last PR of the FlexibleLayout freeze-discipline stack. With every area
fixed, the per-file opt-in list in `torch/_inductor/test_case.py` is
replaced by turning `strict_flexible_layout_strides` on for all inductor
tests (unless `TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES` is set
explicitly), and CI exports the env var so tests that compile through other
`TestCase` classes are checked too. Production stays off.

New violations now fail at compile time in CI, at the line that read the
provisional stride, instead of becoming silent wrong results. For example,
the conv backward lowering added weeks before the check was first run
(fixed earlier in this stack) would have been caught in its own PR.

Validated: the full CI matrix (default, inductor, dynamo_wrapped,
benchmarks, ROCm, MPS, aarch64) was green with the check on everywhere at
#193860 e77db71; the only failure, torchtitan, was failing on main.

Test Plan:

Run on B200 against main a67a74d, with strict mode on for these files:

```
python test/inductor/test_layout_freezing.py   # 34 passed
python test/inductor/test_torchinductor.py     # 2790 passed, 3 failed (also fail on main)
```

plus full CI on this PR.

Authored with Claude Code.

ghstack-source-id: c742cd3
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 3, 2026
## AI-generated description (draft, not yet reviewed by the author)

Last PR of the FlexibleLayout freeze-discipline stack. With every area
fixed, the per-file opt-in list in `torch/_inductor/test_case.py` is
replaced by turning `strict_flexible_layout_strides` on for all inductor
tests (unless `TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES` is set
explicitly), and CI exports the env var so tests that compile through other
`TestCase` classes are checked too. Production stays off.

New violations now fail at compile time in CI, at the line that read the
provisional stride, instead of becoming silent wrong results. For example,
the conv backward lowering added weeks before the check was first run
(fixed earlier in this stack) would have been caught in its own PR.

Validated: the full CI matrix (default, inductor, dynamo_wrapped,
benchmarks, ROCm, MPS, aarch64) was green with the check on everywhere at
#193860 e77db71; the only failure, torchtitan, was failing on main.

Test Plan:

Run on B200 against main a67a74d, with strict mode on for these files:

```
python test/inductor/test_layout_freezing.py   # 34 passed
python test/inductor/test_torchinductor.py     # 2790 passed, 3 failed (also fail on main)
```

plus full CI on this PR.

Authored with Claude Code.

ghstack-source-id: 2464ec1
Pull-Request: #200996
eellison added a commit that referenced this pull request Nov 3, 2026
## AI-generated description (unreviewed)

Turns `strict_flexible_layout_strides` on for all inductor tests (replacing the
per-file opt-in list) and exports it in `.ci/pytorch/test.sh` for the rest.
Production stays off. The full CI matrix is green with it on.

Test Plan:

```
python test/inductor/test_layout_freezing.py
```

plus CI.

Authored with Claude Code.

ghstack-source-id: 2464ec1
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 24, 2026
Turns `strict_flexible_layout_strides` on for all inductor tests (replacing the
per-file opt-in list) and exports it in `.ci/pytorch/test.sh` for the rest.
Production stays off. The full CI matrix is green with it on.

Test Plan:

```
python test/inductor/test_layout_freezing.py
```

plus CI.

Authored with Claude Code.

ghstack-source-id: 8f3b7e2
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Nov 25, 2026
Turns `strict_flexible_layout_strides` on for all inductor tests (replacing the
per-file opt-in list) and exports it in `.ci/pytorch/test.sh` for the rest.
Production stays off. The full CI matrix is green with it on.

Test Plan:

```
python test/inductor/test_layout_freezing.py
```

plus CI.

Authored with Claude Code.

ghstack-source-id: ad71edc
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Dec 1, 2026
Turns `strict_flexible_layout_strides` on for all inductor tests (replacing the
per-file opt-in list) and exports it in `.ci/pytorch/test.sh` for the rest.
Production stays off. The full CI matrix is green with it on.

Test Plan:

```
python test/inductor/test_layout_freezing.py
```

plus CI.

Authored with Claude Code.

ghstack-source-id: 95ab5b6
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Dec 1, 2026
Turns `strict_flexible_layout_strides` on for all inductor tests (replacing the
per-file opt-in list) and exports it in `.ci/pytorch/test.sh` for the rest.
Production stays off. The full CI matrix is green with it on.

Test Plan:

```
python test/inductor/test_layout_freezing.py
```

plus CI.

Authored with Claude Code.

ghstack-source-id: dfcb3e9
Pull-Request: #200996
[ghstack-poisoned]
eellison added a commit that referenced this pull request Dec 2, 2026
Turns `strict_flexible_layout_strides` on for all inductor tests (replacing the
per-file opt-in list) and exports it in `.ci/pytorch/test.sh` for the rest.
Production stays off. The full CI matrix is green with it on.

Test Plan:

```
python test/inductor/test_layout_freezing.py
```

plus CI.

Authored with Claude Code.

ghstack-source-id: 4ef46b5
Pull-Request: #200996
@eellison
eellison requested a review from jansel December 2, 2026 10:02

This branch has not been deployed

No deployments
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.

1 participant