-
Notifications
You must be signed in to change notification settings - Fork 21.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dynamo] Add native support for Triton Kernels to Dynamo
This PR adds native support to Dynamo to detect Triton kernels and create an FX graph node out of them. AOT eager and inductor modes will be support in follow up PRs. ghstack-source-id: 75ac402a2d86d1670ff154448a29ea6401483627 Pull Request resolved: #109623
- Loading branch information
Showing
4 changed files
with
167 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import functools | ||
import torch | ||
|
||
@functools.lru_cache(None) | ||
def has_triton() -> bool: | ||
if not torch.cuda.is_available(): | ||
return False | ||
try: | ||
import triton | ||
|
||
return triton is not None and torch.cuda.get_device_capability() >= (7, 0) | ||
except ImportError: | ||
return False |