fix: Get device's compute capability
This commit is contained in:
parent
f5110265ff
commit
2b4cc256f6
|
@ -279,9 +279,7 @@ def determine_cuda_runtime_lib_path() -> Union[Path, None]:
|
||||||
def get_cuda_version(cuda, cudart_path):
|
def get_cuda_version(cuda, cudart_path):
|
||||||
if cuda is None: return None
|
if cuda is None: return None
|
||||||
|
|
||||||
version = torch._C._cuda_getCompiledVersion()
|
major, minor = map(int, torch.version.cuda.split("."))
|
||||||
major = version//1000
|
|
||||||
minor = (version-(major*1000))//10
|
|
||||||
|
|
||||||
if major < 11:
|
if major < 11:
|
||||||
CUDASetup.get_instance().add_log_entry('CUDA SETUP: CUDA version lower than 11 are currently not supported for LLM.int8(). You will be only to use 8-bit optimizers and quantization routines!!')
|
CUDASetup.get_instance().add_log_entry('CUDA SETUP: CUDA version lower than 11 are currently not supported for LLM.int8(). You will be only to use 8-bit optimizers and quantization routines!!')
|
||||||
|
@ -302,7 +300,9 @@ def get_cuda_lib_handle():
|
||||||
|
|
||||||
def get_compute_capabilities(cuda):
|
def get_compute_capabilities(cuda):
|
||||||
ccs = []
|
ccs = []
|
||||||
ccs.append(torch.version.cuda)
|
for i in range(torch.cuda.device_count()):
|
||||||
|
cc_major, cc_minor = torch.cuda.get_device_capability(torch.cuda.device(i))
|
||||||
|
ccs.append(f"{cc_major}.{cc_minor}")
|
||||||
|
|
||||||
return ccs
|
return ccs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user