Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor some common autotune-related utils into a new file #152652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

masnesral
Copy link
Contributor

@masnesral masnesral commented May 2, 2025

Stack from ghstack (oldest at bottom):

Summary: I'll need some of the benchmark-related functions surfaced in a common utils file so I can use them for remote autotuning. This PR is almost a straight move of a few nested functions from inside AlgorithmSelectorCache, plus the datatypes they depend on, except:

  • All hell breaks loose with mypy on select_algorithm.py with this refactor, so I disabled it. Initial investigations looks like there are potentially a ton of type problems in this file, so I'll tackle fixing types in a follow-up diff.
  • Introduced a new interface "Benchmarkable" as the base type that gets benchmarked. This is looking forward to the remote autotuning implementation where the types that we'll send across the wire must be serializable. So we won't be using the exact same types we pass to these utilities now, e.g., ExternKernelCaller.
  • Rather than checking types explicitly, I introduced an is_extern() method to the Benchmarkable interface.

Test Plan: Existing unit tests

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

Summary: I'll need some of the benchmark-related functions surfaced in a common utils file so I can use them for remote autotuning. This PR is almost a straight move of a few nested functions from inside AlgorithmSelectorCache, plus the datatypes they depend on, except:
* All hell breaks loose with mypy on select_algorithm.py with this refactor, so I disabled it. Initial investigations looks like there are potentially a ton of type problems in this file, so I'll tackle fixing types in a follow-up diff.
* Introduced a new interface "Benchmarkable" as the base type that gets benchmarked. This is looking forward to the remote autotuning implementation where the types that we'll send across the wire must be serializable. So we won't be using the exact same types we pass to these utilities now, e.g., ExternKernelCaller.
* Rather than checking types explicitly, I introduced an is_extern() method to the Benchmarkable interface.

Test Plan: Existing unit tests

[ghstack-poisoned]
Copy link

pytorch-bot bot commented May 2, 2025

🔗 Helpful Links

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

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

❌ 29 New Failures, 2 Pending, 2 Unrelated Failures

As of commit 283deba with merge base dfcfad2 (image):

NEW FAILURES - The following jobs have failed:

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

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

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

masnesral added a commit that referenced this pull request May 2, 2025
Summary: I'll need some of the benchmark-related functions surfaced in a common utils file so I can use them for remote autotuning. This PR is almost a straight move of a few nested functions from inside AlgorithmSelectorCache, plus the datatypes they depend on, except:
* All hell breaks loose with mypy on select_algorithm.py with this refactor, so I disabled it. Initial investigations looks like there are potentially a ton of type problems in this file, so I'll tackle fixing types in a follow-up diff.
* Introduced a new interface "Benchmarkable" as the base type that gets benchmarked. This is looking forward to the remote autotuning implementation where the types that we'll send across the wire must be serializable. So we won't be using the exact same types we pass to these utilities now, e.g., ExternKernelCaller.
* Rather than checking types explicitly, I introduced an is_extern() method to the Benchmarkable interface.

Test Plan: Existing unit tests

ghstack-source-id: 5e531c9
Pull Request resolved: #152652
Summary: I'll need some of the benchmark-related functions surfaced in a common utils file so I can use them for remote autotuning. This PR is almost a straight move of a few nested functions from inside AlgorithmSelectorCache, plus the datatypes they depend on, except:
* All hell breaks loose with mypy on select_algorithm.py with this refactor, so I disabled it. Initial investigations looks like there are potentially a ton of type problems in this file, so I'll tackle fixing types in a follow-up diff.
* Introduced a new interface "Benchmarkable" as the base type that gets benchmarked. This is looking forward to the remote autotuning implementation where the types that we'll send across the wire must be serializable. So we won't be using the exact same types we pass to these utilities now, e.g., ExternKernelCaller.
* Rather than checking types explicitly, I introduced an is_extern() method to the Benchmarkable interface.

Test Plan: Existing unit tests

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

[ghstack-poisoned]
masnesral added a commit that referenced this pull request May 7, 2025
Summary: I'll need some of the benchmark-related functions surfaced in a common utils file so I can use them for remote autotuning. This PR is almost a straight move of a few nested functions from inside AlgorithmSelectorCache, plus the datatypes they depend on, except:
* All hell breaks loose with mypy on select_algorithm.py with this refactor, so I disabled it. Initial investigations looks like there are potentially a ton of type problems in this file, so I'll tackle fixing types in a follow-up diff.
* Introduced a new interface "Benchmarkable" as the base type that gets benchmarked. This is looking forward to the remote autotuning implementation where the types that we'll send across the wire must be serializable. So we won't be using the exact same types we pass to these utilities now, e.g., ExternKernelCaller.
* Rather than checking types explicitly, I introduced an is_extern() method to the Benchmarkable interface.

Test Plan: Existing unit tests

ghstack-source-id: 521ae07
Pull Request resolved: #152652
@masnesral masnesral added the topic: not user facing topic category label May 7, 2025
@masnesral masnesral closed this May 7, 2025
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