Skip to content

Conversation

@coconutruben
Copy link
Contributor

@coconutruben coconutruben commented Aug 23, 2025

Stack from ghstack (oldest at bottom):

why

  • now everything is in place to just gather templates and run
    the V.choices.get_mm_configs once per op
  • enables any overrides inside V.choices.get_mm_configs to
    have a full view of the options for an op, not just for
    one template

what

  • replace multiple calls to V.choices.get_mm_configs with
    calls to gather the active templates, and then using those
    in a single call

testing

python3 -bb -m pytest test/inductor/test_max_autotune.py -v

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

Differential Revision: D81520571

\# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

\# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

- note: mm and addmm had an optimization where if there is no
  max-autotune, we use a FlexibleLayout. This optimization is now
  temporarily gone, and coming back in the next commit, as a generic
  optimization for everything that uses V.choices.get_mm_configs

\# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 23, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit b4f77b0 with merge base 468c1f9 (image):
💚 Looks good so far! There are no failures yet. 💚

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

This was referenced Aug 23, 2025
@coconutruben coconutruben added the topic: not user facing topic category label Aug 23, 2025
…configs"

\# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

\# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

- note: mm and addmm had an optimization where if there is no
  max-autotune, we use a FlexibleLayout. This optimization is now
  temporarily gone, and coming back in the next commit, as a generic
  optimization for everything that uses V.choices.get_mm_configs

\# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

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

[ghstack-poisoned]
…configs"

\# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

\# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

- note: mm and addmm had an optimization where if there is no
  max-autotune, we use a FlexibleLayout. This optimization is now
  temporarily gone, and coming back in the next commit, as a generic
  optimization for everything that uses V.choices.get_mm_configs

\# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

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

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Sep 12, 2025
…62293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: #162293
Approved by: https://github.com/eellison
ghstack dependencies: #161351, #161350
pytorchmergebot pushed a commit that referenced this pull request Sep 12, 2025
# why

enable caching/overriding/filtering based on src hash later

# what

- KernelTemplate has a src_hash that is None by default
- sha256 on TritonTemplate of the template src code
- None on ExternKernelChoice to have same API

# testing

n/a (not in use in this change)

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D81821149](https://our.internmc.facebook.com/intern/diff/D81821149)
Pull Request resolved: #161468
Approved by: https://github.com/eellison
ghstack dependencies: #161351, #161350, #162293
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
# why

enable caching/overriding/filtering based on src hash later

# what

- KernelTemplate has a src_hash that is None by default
- sha256 on TritonTemplate of the template src code
- None on ExternKernelChoice to have same API

# testing

n/a (not in use in this change)

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D81821149](https://our.internmc.facebook.com/intern/diff/D81821149)
Pull Request resolved: pytorch#161468
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350, pytorch#162293
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
# why

enable caching/overriding/filtering based on src hash later

# what

- KernelTemplate has a src_hash that is None by default
- sha256 on TritonTemplate of the template src code
- None on ExternKernelChoice to have same API

# testing

n/a (not in use in this change)

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D81821149](https://our.internmc.facebook.com/intern/diff/D81821149)
Pull Request resolved: pytorch#161468
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350, pytorch#162293
cleonard530 pushed a commit to cleonard530/pytorch that referenced this pull request Sep 22, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
cleonard530 pushed a commit to cleonard530/pytorch that referenced this pull request Sep 22, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
cleonard530 pushed a commit to cleonard530/pytorch that referenced this pull request Sep 22, 2025
cleonard530 pushed a commit to cleonard530/pytorch that referenced this pull request Sep 22, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
cleonard530 pushed a commit to cleonard530/pytorch that referenced this pull request Sep 22, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
cleonard530 pushed a commit to cleonard530/pytorch that referenced this pull request Sep 22, 2025
# why

enable caching/overriding/filtering based on src hash later

# what

- KernelTemplate has a src_hash that is None by default
- sha256 on TritonTemplate of the template src code
- None on ExternKernelChoice to have same API

# testing

n/a (not in use in this change)

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D81821149](https://our.internmc.facebook.com/intern/diff/D81821149)
Pull Request resolved: pytorch#161468
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350, pytorch#162293
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request Sep 26, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request Sep 26, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request Sep 26, 2025
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request Sep 26, 2025
…torch#161350)

# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call

# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

Differential Revision: [D81520571](https://our.internmc.facebook.com/intern/diff/D81520571)
Pull Request resolved: pytorch#161350
Approved by: https://github.com/eellison, https://github.com/jansel
ghstack dependencies: pytorch#161351
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request Sep 26, 2025
…torch#162293)

# why

- eventually we want all templates to go through this
- we're exposing this through diode as a sort of interface/API
- avoid later renaming

# what

- rename get_mm_configs to get_template_configs
- rename _finalize_mm_configs to _finalize_template_configs

# testing

- lintrunner
- ci

Differential Revision: [D81820641](https://our.internmc.facebook.com/intern/diff/D81820641)
Pull Request resolved: pytorch#162293
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request Sep 26, 2025
# why

enable caching/overriding/filtering based on src hash later

# what

- KernelTemplate has a src_hash that is None by default
- sha256 on TritonTemplate of the template src code
- None on ExternKernelChoice to have same API

# testing

n/a (not in use in this change)

Differential Revision: [](https://our.internmc.facebook.com/intern/diff/)

Differential Revision: [D81821149](https://our.internmc.facebook.com/intern/diff/D81821149)
Pull Request resolved: pytorch#161468
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#161351, pytorch#161350, pytorch#162293
@github-actions github-actions bot deleted the gh/coconutruben/51/head branch October 13, 2025 02:15
Khanaksahu pushed a commit to Khanaksahu/pytorch-fork that referenced this pull request Nov 17, 2025
\# why

- now everything is in place to just gather templates and run
  the V.choices.get_mm_configs once per op
- enables any overrides inside V.choices.get_mm_configs to
  have a full view of the options for an op, not just for
  one template

\# what

- replace multiple calls to V.choices.get_mm_configs with
  calls to gather the active templates, and then using those
  in a single call
- turn on TRITON for FlexibleLayout again. This is designed
  to work when running max-autotune but for some reason e.g.
  through overriding, we end up autotuning only over
  ATEN choices. In that case, we still want to use a FlexibleLayout
  instead of making it Fixed

\# testing

```
python3 -bb -m pytest test/inductor/test_max_autotune.py -v
```

ghstack-source-id: fe05a43
Pull Request resolved: pytorch/pytorch#161350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor Reverted topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants