File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import dataclasses
2- import logging
3- import re
2+ import logging
3+ import re
44import subprocess
55from functools import lru_cache
66from typing import Optional
@@ -78,25 +78,25 @@ def get_cuda_specs() -> Optional[CUDASpecs]:
7878 return None
7979
8080
81- def get_rocm_gpu_arch () -> str :
82- """Get ROCm GPU architecture."""
83- logger = logging .getLogger (__name__ )
84- try :
85- if torch .version .hip :
86- result = subprocess .run (["rocminfo" ], capture_output = True , text = True )
87- match = re .search (r"Name:\s+gfx([a-zA-Z\d]+)" , result .stdout )
88- if match :
89- return "gfx" + match .group (1 )
90- else :
91- return "unknown"
92- else :
93- return "unknown"
94- except Exception as e :
95- logger .error (f"Could not detect ROCm GPU architecture: { e } " )
96- if torch .cuda .is_available ():
97- logger .warning (
98- """
99- ROCm GPU architecture detection failed despite ROCm being available.
100- """ ,
101- )
102- return "unknown"
81+ def get_rocm_gpu_arch () -> str :
82+ """Get ROCm GPU architecture."""
83+ logger = logging .getLogger (__name__ )
84+ try :
85+ if torch .version .hip :
86+ result = subprocess .run (["rocminfo" ], capture_output = True , text = True )
87+ match = re .search (r"Name:\s+gfx([a-zA-Z\d]+)" , result .stdout )
88+ if match :
89+ return "gfx" + match .group (1 )
90+ else :
91+ return "unknown"
92+ else :
93+ return "unknown"
94+ except Exception as e :
95+ logger .error (f"Could not detect ROCm GPU architecture: { e } " )
96+ if torch .cuda .is_available ():
97+ logger .warning (
98+ """
99+ ROCm GPU architecture detection failed despite ROCm being available.
100+ """ ,
101+ )
102+ return "unknown"
You can’t perform that action at this time.
0 commit comments