Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/123932
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (3 Unrelated Failures)As of commit bd1a898 with merge base failed to retrieve merge base, please contact dev infra: FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
jansel
left a comment
There was a problem hiding this comment.
Is this ready for review? Tests are failing and it is still marked draft.
No, that's also why I marked it as draft. Sorry, I thought reviewers would not be notified until it's leaving draft state. The test failures are due to slight incompatibilities of one of the previous PRs of the stack with changes in the trunk that I need to weed out. |
Should be ready now.. |
|
|
||
| def get(self) -> Any: | ||
| def get( | ||
| self, result_timeout=1.0, graceful_timeout=3.0, terminate_timeout=1.0 |
There was a problem hiding this comment.
How is the timeout chosen? What about very large problem sizes?
There was a problem hiding this comment.
They are configured manually and passed through further below from these (new) inductor configuration settings: max_autotune_subproc_result_timeout_seconds, max_autotune_subproc_graceful_timeout_seconds, max_autotune_subproc_terminate_timeout_seconds.
Of these, the max_autotune_subproc_result_timeout_seconds is the most important one as that one specifies how long we allow Kernels to run before we try to stop them. I gave it a default value of 30 seconds. The others are just additional timeouts that specify how long after a graceful shutdown we proceed by sending a SIGTERM signal, and if even that is not sufficient, a SIGKILL.
Since we are talking about actual Kernel runtime, it's my experience that 30 seconds are more than enough for any GEMM that I can fit in real-world GPU memory to finish unless it's somehow broken.
But, that said, in order not to change default behavior and to be on the safe side, we could of course start with a much higher or even unlimited default threshold. What do you think?
As a followup task, we could also set these timeouts dynamically once we have established a baseline timing ( ATen op timing ) and expect Kernels to finish in roughly that timeframe or be killed. That would also lead to actual speedups as we can make the timeout much tighter on average.
There was a problem hiding this comment.
I made the default timeouts longer ( max_autotune_subproc_result_timeout_seconds = 60.0 ) and added a doc comment in case any code outside of TuningProcessPool starts to use it ( I did not find any usage beyond that ).
|
Trunk is in a pretty bad state currently, so if there are new tests failures, they are likely unrelated as it already passed all checks. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend. Test Plan: * CI * Added test in test_cutlass_backend.py Pull Request resolved: #121734 Approved by: https://github.com/eellison ghstack dependencies: #121497, #123930, #123932
This diff disables Cutlass backend EVT epilogue fusions. It does not yet contain the removal of most of the underlying implementation. Pull Request resolved: #124107 Approved by: https://github.com/jansel ghstack dependencies: #121497, #123930, #123932, #121734
…est setup (#124574) The diff #122661 introduces a new automatic cache refresh mechanism during all inductor-derived test cases. But this refresh mechanism seems not to work properly across process boundaries, specifically when using autotune_in_subproc, which many tests in test_cutlass_backend.py rely on. Solution: Set the env var INDUCTOR_TEST_DISABLE_FRESH_CACHE=1 early during test setup within test_cutlass_backend.py Test Plan: This is a change to unit tests only. Pull Request resolved: #124574 Approved by: https://github.com/aakhundov ghstack dependencies: #121497, #123930, #123932, #121734, #124107
…emm_choices (#124575) Clean up CUTLASSGemmTemplate.add_cutlass_gemm_choices, removing code that became unneccessary by removing EVT-based epilogue fusion. Test Plan: Already covered by test_cutlass_backend.py Pull Request resolved: #124575 Approved by: https://github.com/jansel ghstack dependencies: #121497, #123930, #123932, #121734, #124107, #124574
…els (pytorch#123932) If a Kernel does not return in a reasonable amount of time during autotuning, it can delay inductor compilation a lot. This change introduces soft / hard kill timeouts and a mechanism to kill Kernels being profiled in subprocesses if they take too long. Correspondingly, a few new config options are introduced within _inductor/config.py - all of them with inline docs. Test Plan: Existing tests within test_max_autotune.py and test_cutlass_backend.py ) cover the new codepaths. Pull Request resolved: pytorch#123932 Approved by: https://github.com/jansel ghstack dependencies: pytorch#121497, pytorch#123930
Add support for bmm ( batch matrix multiply ) op through the Cutlass backend. Test Plan: * CI * Added test in test_cutlass_backend.py Pull Request resolved: pytorch#121734 Approved by: https://github.com/eellison ghstack dependencies: pytorch#121497, pytorch#123930, pytorch#123932
This diff disables Cutlass backend EVT epilogue fusions. It does not yet contain the removal of most of the underlying implementation. Pull Request resolved: #124107 Approved by: https://github.com/jansel ghstack dependencies: #121497, #123930, #123932, #121734
…est setup (pytorch#124574) The diff pytorch#122661 introduces a new automatic cache refresh mechanism during all inductor-derived test cases. But this refresh mechanism seems not to work properly across process boundaries, specifically when using autotune_in_subproc, which many tests in test_cutlass_backend.py rely on. Solution: Set the env var INDUCTOR_TEST_DISABLE_FRESH_CACHE=1 early during test setup within test_cutlass_backend.py Test Plan: This is a change to unit tests only. Pull Request resolved: pytorch#124574 Approved by: https://github.com/aakhundov ghstack dependencies: pytorch#121497, pytorch#123930, pytorch#123932, pytorch#121734, pytorch#124107
…emm_choices (#124575) Clean up CUTLASSGemmTemplate.add_cutlass_gemm_choices, removing code that became unneccessary by removing EVT-based epilogue fusion. Test Plan: Already covered by test_cutlass_backend.py Pull Request resolved: #124575 Approved by: https://github.com/jansel ghstack dependencies: #121497, #123930, #123932, #121734, #124107, #124574
If a Kernel does not return in a reasonable amount of time during autotuning, it can delay inductor compilation a lot. This change introduces soft / hard kill timeouts and a mechanism to kill Kernels being profiled in subprocesses if they take too long. Correspondingly, a few new config options are introduced within _inductor/config.py - all of them with inline docs. Test Plan: Existing tests within test_max_autotune.py and test_cutlass_backend.py ) cover the new codepaths. ghstack-source-id: ec184ca Pull Request resolved: pytorch/pytorch#123932
Stack from ghstack (oldest at bottom):
If a Kernel does not return in a reasonable amount of time during autotuning, it can delay inductor compilation a lot. This change introduces soft / hard kill timeouts and a mechanism to kill Kernels being profiled in subprocesses if they take too long.
Correspondingly, a few new config options are introduced within _inductor/config.py - all of them with inline docs.
Test Plan:
Existing tests within test_max_autotune.py and test_cutlass_backend.py ) cover the new codepaths.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @muchulee8 @aakhundov @ColinPeppler @amjames @desertfire @chauhang