Skip to content

[inductor] Fix FlexibleLayout stride reads in GEMM and template lowering - #200991

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

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

Conversation

@eellison

@eellison eellison commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

AI-generated description (unreviewed)

Fixes for provisional strides that were persisted:

  • CK, FlyDSL and NVGEMM bake input strides into their kernels. They now share
    ChoiceCaller.snapshot_input_layouts(): kwargs come from a snapshot of the
    input layouts, the selected choice freezes still-flexible inputs to exactly
    those strides, and choices whose inputs were frozen differently are dropped.
    Nothing is frozen when the choice loses.
  • TMADescriptor froze its tensor too late; CUTLASS render only froze X
    (typo); SubgraphTemplate read strides before freezing.
  • scaled_mm_v2_constraint trusted a flexible operand's provisional strides;
    it now freezes it in the required order (padding still allowed).
  • flex_gemm's TMA-loadability gate: flexible captures take the require path.

The rest are hint migrations (mm gates, TMA checks, autotune inputs and
metadata, decompose-K naming, custom-op input_gen_fns).

Test Plan (B200, strict on; remaining failures also fail on main):

python test/inductor/test_layout_freezing.py
python test/inductor/test_max_autotune.py
python test/inductor/test_select_algorithm.py
python test/inductor/test_rocm_layout_constraints.py
TORCHINDUCTOR_STRICT_FLEXIBLE_LAYOUT_STRIDES=1 python test/inductor/test_nv_universal_gemm.py

FlyDSL (test_flydsl_template, test_flydsl_grouped_scheduler,
test_flydsl_flex_attention) passes with strict on on an MI350X (gfx950).

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/200991

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

✅ No Failures

As of commit 18036ba 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 added ciflow/b200 ciflow/h100 ciflow/inductor ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/torchtitan Run TorchTitan integration tests module: inductor labels Oct 14, 2026
@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]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@eellison
eellison requested review from drisspg and mlazos 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

Labels

ciflow/b200 ciflow/h100 ciflow/inductor ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/torchtitan Run TorchTitan integration tests module: inductor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant