Skip to content

Commit 979932a

Browse files
authored
[no ci] Make torch an optional dependency (#102)
Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent 9f70085 commit 979932a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/scripts/upload_benchmark_results.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818

1919
import boto3
2020
import psutil
21-
import torch
21+
22+
try:
23+
import torch
24+
25+
torch_available = True
26+
except ImportError:
27+
torch_available = False
28+
2229
from git import Repo
2330

2431
logging.basicConfig(level=logging.INFO)
@@ -162,7 +169,7 @@ def get_benchmark_metadata(
162169

163170

164171
def get_runner_info(device_name: str, device_type: str) -> Dict[str, Any]:
165-
if torch.cuda.is_available():
172+
if torch_available and torch.cuda.is_available():
166173
if torch.version.hip:
167174
name = "rocm"
168175
elif torch.version.cuda:

0 commit comments

Comments
 (0)