Skip to content

Commit de736fe

Browse files
generatedunixname499836121facebook-github-bot
generatedunixname499836121
authored andcommitted
has_triton: Use the device interface for detecting Triton availability (#139171)
Summary: This PR replaces the `has_triton()` global method which was previously used for this task. X-link: pytorch/pytorch#139171 Approved by: https://github.com/jansel, https://github.com/shink Reviewed By: huydhn Differential Revision: D74338720 fbshipit-source-id: 27106df937bbdea2da1f4911ffffcfae056f844d
1 parent 5838b07 commit de736fe

File tree

1 file changed

+5
-6
lines changed
  • userbenchmark/dynamo/dynamobench/_dynamo

1 file changed

+5
-6
lines changed

userbenchmark/dynamo/dynamobench/_dynamo/utils.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ def record_compilation_metrics(
15461546
"dynamo_config": _get_dynamo_config_for_logging(),
15471547
"inductor_config": _scrubbed_inductor_config_for_logging(),
15481548
"cuda_version": torch.version.cuda,
1549-
"triton_version": triton.__version__ if has_triton() else "",
1549+
"triton_version": triton.__version__ if has_triton_package() else "",
15501550
"remote_cache_version": remote_cache_version,
15511551
"inductor_fx_remote_cache_backend_type": inductor_fx_remote_cache_backend_type,
15521552
"python_version": sys.version,
@@ -3803,15 +3803,14 @@ def build_checkpoint_variable(**options):
38033803
)
38043804

38053805

3806-
def is_compile_supported(device_type):
3806+
def is_compile_supported(device_type: str) -> bool:
38073807
from .eval_frame import is_dynamo_supported
38083808

3809-
type = torch.device(device_type).type
38103809
compile_supported = is_dynamo_supported()
3811-
if type == "cpu":
3810+
if device_type == "cpu":
38123811
pass
3813-
elif type in ["cuda", "xpu"] and compile_supported:
3814-
compile_supported = has_triton()
3812+
elif device_type in ["cuda", "xpu"] and compile_supported:
3813+
compile_supported = has_triton(device_type)
38153814
else:
38163815
compile_supported = False
38173816
return compile_supported

0 commit comments

Comments
 (0)