Commit 167ed28
authored
Cache NvidiaTool.from_path (#7569)
We're currently updating the internal Triton version at Meta, and one of
the things that process has flushed out is that there has been some
regression in compile time since 3.2. One of the main culprits is
`NvidiaTool.from_path`; we call it all the time under the hood, and each
time it spawns a subprocess just to check the version. The benchmark I'm
using is a torch.compiled'd model with ~300 kernels, and this change
saves about 10% off of the overall compile time.
I don't have strong feelings on how defensive to be here. I picked a
middle-of-the road level where I guard `PATH`, but don't go crazy
guarding against every conceivable level of magic. (I think the existing
knobs unit tests are pretty representative of what one might expect of
"reasonable" behavior, but let me know if you'd like me to tweak the
level of defensiveness.)1 parent d5de496 commit 167ed28
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
0 commit comments