Skip to content

Commit d71863d

Browse files
generatedunixname499836121facebook-github-bot
generatedunixname499836121
authored andcommitted
Fix is_compile_supported() when device_type contains device index (#147837)
Summary: Fixes #147826 X-link: pytorch/pytorch#147837 Approved by: https://github.com/anijain2305 Reviewed By: yangw-dev Differential Revision: D72080412 fbshipit-source-id: ce80f0c151f1b96d58da03377a68a695037407bb
1 parent 49c3f18 commit d71863d

File tree

1 file changed

+3
-2
lines changed
  • userbenchmark/dynamo/dynamobench/_dynamo

1 file changed

+3
-2
lines changed

userbenchmark/dynamo/dynamobench/_dynamo/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3751,10 +3751,11 @@ def build_checkpoint_variable(**options):
37513751
def is_compile_supported(device_type):
37523752
from .eval_frame import is_dynamo_supported
37533753

3754+
type = torch.device(device_type).type
37543755
compile_supported = is_dynamo_supported()
3755-
if device_type == "cpu":
3756+
if type == "cpu":
37563757
pass
3757-
elif device_type in ["cuda", "xpu"] and compile_supported:
3758+
elif type in ["cuda", "xpu"] and compile_supported:
37583759
compile_supported = has_triton()
37593760
else:
37603761
compile_supported = False

0 commit comments

Comments
 (0)