[setup] remove torch dependency (#2333)

This commit is contained in:
Frank Lee
2023-01-05 13:53:28 +08:00
committed by GitHub
parent 89f26331e9
commit 8711310cda
2 changed files with 9 additions and 4 deletions

View File

@@ -3,14 +3,18 @@ import re
from pathlib import Path
from typing import List
import torch
def get_cuda_cc_flag() -> List:
"""get_cuda_cc_flag
cc flag for your GPU arch
"""
# only import torch when needed
# this is to avoid importing torch when building on a machine without torch pre-installed
# one case is to build wheel for pypi release
import torch
cc_flag = []
for arch in torch.cuda.get_arch_list():
res = re.search(r'sm_(\d+)', arch)