Skip to content

Conversation

@coconutruben
Copy link
Contributor

@coconutruben coconutruben commented Sep 2, 2025

Stack from ghstack (oldest at bottom):

why

  • enable the system to register performance model ranking functions
  • those functions are then used to rank th choices before benchmarking
  • enable more modular, faster, more expansive autotuning

what

  • PerformanceModelChoices, expansion of inductor choices
  • mechanism
    • users can register functions (through decorators or registration
      function)
    • functions are hardware, template, op specific
    • when an input hits the performance model, if we have any functions
      registered for that template/op combo
      • we expand the config space for that template
      • we ask the function to rank all the choices
      • we forward filter down to topk
  • control
    • topk: -1 to say "same as default search space" or > 1 for specific
    • topk: 0 turns off any performance modeling
    • discard unranked: controls what to do with choices that have not
      been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

testing

python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py

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

Differential Revision: D81534564

\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 2, 2025

🔗 Helpful Links

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

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

❌ 33 New Failures

As of commit 15c0dda with merge base d25c35d (image):

NEW FAILURES - The following jobs have failed:

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

coconutruben added a commit that referenced this pull request Sep 2, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: 30557be
Pull Request resolved: #162017
@coconutruben
Copy link
Contributor Author

@coconutruben has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 2, 2025
# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
@coconutruben
Copy link
Contributor Author

@coconutruben has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 5, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: d1b6f9b
Pull Request resolved: #162017
@coconutruben
Copy link
Contributor Author

@coconutruben has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 9, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: a313b98
Pull Request resolved: #162017
# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 9, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: 1e45804
Pull Request resolved: #162017
@coconutruben
Copy link
Contributor Author

@coconutruben has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 9, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: 07f44dc
Pull Request resolved: #162017
# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 9, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: 1e2e67b
Pull Request resolved: #162017
# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 10, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: d99e756
Pull Request resolved: #162017
@coconutruben
Copy link
Contributor Author

@coconutruben has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 10, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: e70c6a5
Pull Request resolved: #162017
# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 11, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: c784cfc
Pull Request resolved: #162017
@coconutruben
Copy link
Contributor Author

@coconutruben has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 12, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: 11630fd
Pull Request resolved: #162017
# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 12, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: 79dc51d
Pull Request resolved: #162017
# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

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

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

[ghstack-poisoned]
coconutruben added a commit that referenced this pull request Sep 12, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: 3a9b498
Pull Request resolved: #162017
@github-actions github-actions bot deleted the gh/coconutruben/62/head branch October 19, 2025 02:19
Khanaksahu pushed a commit to Khanaksahu/pytorch-fork that referenced this pull request Nov 17, 2025
\# why

- enable the system to register performance model ranking functions
- those functions are then used to rank th choices before benchmarking
- enable more modular, faster, more expansive autotuning

\# what

- PerformanceModelChoices, expansion of inductor choices
- mechanism
  - users can register functions (through decorators or registration
    function)
  - functions are hardware, template, op specific
  - when an input hits the performance model, if we have any functions
    registered for that template/op combo
    - we expand the config space for that template
    - we ask the function to rank all the choices
    - we forward filter down to topk
- control
  - topk: -1 to say "same as default search space" or > 1 for specific
  - topk: 0 turns off any performance modeling
  - discard unranked: controls what to do with choices that have not
    been estimated (discard, or keep)

You can check out the testing code to see examples of toy functions and
their integration into the system

This choice handler is not turned on by default

Even if the choice handler is turned on, it will be a noop if no
functions are registered, or if topk = 0

\# testing

```
python -m pytest test/inductor/test_performance_model_interface_e2e.py
python -m pytest test/inductor/test_performance_model_interface.py
```

ghstack-source-id: ddc0529
Pull Request resolved: pytorch/pytorch#162017
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.

2 participants