Repository navigation
Conversation
When using the Cutlass backend, the compilation of CUDA source files can totally dominate the runtime required for the benchmarking done as part of Autotuning. This change adds a multithreaded precompilation phase, which serves to pre-populate the compilation cache ( both in-memory, and a possible on-disk sccache ). Also it ensures that no unneccessary compilation and benchmarking steps are performed, which was peviously the case. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/119386
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b97e0ef with merge base 064610d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This is a recreated already accepted PR #119003 |
|
@pytorchbot merge |
|
This PR needs to be approved by an authorized maintainer before merge. |
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
| def precompile(self): | ||
| # Prepopulate CUDACodeCache | ||
| # may happen in separate Threadpool | ||
| log.debug("Precompiling %s", str(self)) |
There was a problem hiding this comment.
| log.debug("Precompiling %s", str(self)) | |
| log.debug("Precompiling %s", self) |
should call str o self I think?
| # may happen in separate Threadpool | ||
| log.debug("Precompiling %s", str(self)) | ||
| CUDACodeCache.load(self.source_code, "so") | ||
| log.debug("Done precompiling %s", str(self)) |
There was a problem hiding this comment.
| log.debug("Done precompiling %s", str(self)) | |
| log.debug("Done precompiling %s", self) |
| compile the graph and save it to the cache. | ||
| """ | ||
| from filelock import FileLock | ||
| from filelock import FileLock # type: ignore[import-not-found] |
There was a problem hiding this comment.
We just need to add types-filelock to our lintrunner install.
There was a problem hiding this comment.
thanks for the comments, I made some small corresponding changes..
Realized we used filelock in some places, but didn't have a mypy type stub for it. Noticed it in this PR: #119386 Pull Request resolved: #119390 Approved by: https://github.com/albanD, https://github.com/malfet
Realized we used filelock in some places, but didn't have a mypy type stub for it. Noticed it in this PR: #119386 Pull Request resolved: #119390 Approved by: https://github.com/albanD, https://github.com/malfet
When using the Cutlass backend, the compilation of CUDA source files can totally dominate the runtime required for the benchmarking done as part of Autotuning. This change adds a multithreaded precompilation phase, which serves to pre-populate the compilation cache ( both in-memory, and a possible on-disk sccache ). Also it ensures that no unneccessary compilation and benchmarking steps are performed, which was peviously the case. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
|
@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 |
| make_kernel_render: Callable[[CUDATemplateBuffer, Optional[List[IRNode]]], str], | ||
| bmreq: CUDABenchmarkRequest, | ||
| template: "CUDATemplate", | ||
| template: "CUDATemplate", # type: ignore[name-defined] |
There was a problem hiding this comment.
Huh, this type ignore shouldn't be necessary...
There was a problem hiding this comment.
I add these type ignores only on linter errors when I run lintrunner locally. I also have the impression that these are a bit inconsistent, e.g. sometimes I had linter warnings about code that was just fine the day before. Most likely reason is that until a short time ago we had a separate lintrunner configuration for inductor.
Realized we used filelock in some places, but didn't have a mypy type stub for it. Noticed it in this PR: #119386 Pull Request resolved: #119390 Approved by: https://github.com/albanD, https://github.com/malfet
When using the Cutlass backend, the compilation of CUDA source files can totally dominate the runtime required for the benchmarking done as part of Autotuning. This change adds a multithreaded precompilation phase, which serves to pre-populate the compilation cache ( both in-memory, and a possible on-disk sccache ). Also it ensures that no unneccessary compilation and benchmarking steps are performed, which was peviously the case. Pull Request resolved: #119386 Approved by: https://github.com/aakhundov
Stack from ghstack (oldest at bottom):
When using the Cutlass backend, the compilation
of CUDA source files can totally dominate the runtime required for the benchmarking done
as part of Autotuning.
This change adds a multithreaded precompilation phase, which serves to pre-populate the compilation cache ( both in-memory, and a
possible on-disk sccache ).
Also it ensures that no unneccessary compilation
and benchmarking steps are performed, which was peviously the case.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @muchulee8 @aakhundov @ColinPeppler