-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lzy17/gpu specs #51
base: rocm_enabled_multi_backend
Are you sure you want to change the base?
Lzy17/gpu specs #51
Conversation
@@ -24,7 +24,7 @@ | |||
|
|||
from .base import Backend | |||
|
|||
if lib and lib.compiled_with_cuda: | |||
if lib and lib.compiled_with_gpu: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are only for cuda and rocm as of now, may be use BNB_BACKEND from cextension instead?
Get the disk path to the CUDA BNB native library specified by the | ||
given CUDA specs, taking into account the `BNB_CUDA_VERSION` override environment variable. | ||
Get the disk path to the GPU BNB native library specified by the | ||
given GPU specs, taking into account the `BNB_GPU_VERSION` override environment variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave env var as BNB_CUDA_VERSION
and mention 'for cuda'
library_name = f"{library_name}{DYNAMIC_LIBRARY_SUFFIX}" | ||
|
||
# Do I need to change it to BNB_GPU_VERSION here? IGNORE FOR NOW! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this comment
library_name = f"{library_name}{DYNAMIC_LIBRARY_SUFFIX}" | ||
|
||
# Do I need to change it to BNB_GPU_VERSION here? IGNORE FOR NOW! | ||
override_value = os.environ.get("BNB_CUDA_VERSION") | ||
if override_value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add condition for cuda backend
@@ -85,7 +85,7 @@ def get_potentially_lib_path_containing_env_vars() -> Dict[str, str]: | |||
return {env_var: value for env_var, value in os.environ.items() if is_relevant_candidate_env_var(env_var, value)} | |||
|
|||
|
|||
def find_cudart_libraries() -> Iterator[Path]: | |||
def find_gpu_rt_libraries() -> Iterator[Path]: | |||
""" | |||
Searches for a cuda installations, in the following order of priority: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this comment generic for gpu backend
@@ -50,20 +50,20 @@ def main(): | |||
print_header("") | |||
|
|||
print_header("OTHER") | |||
cuda_specs = get_cuda_specs() | |||
gpu_specs = get_gpu_specs() | |||
if HIP_ENVIRONMENT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the code to print gpu specs directly
@@ -25,7 +25,7 @@ def prod(iterable): | |||
|
|||
name2qmap = {} | |||
|
|||
if lib and lib.compiled_with_cuda: | |||
if lib and lib.compiled_with_gpu: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to BNB_BACKEND cuda and rocm
@@ -2,27 +2,44 @@ | |||
import logging | |||
import re | |||
import subprocess | |||
from typing import List, Optional, Tuple | |||
from typing import Optional, Tuple, Union |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove Union if its not used anymore?
cuda_version_string="120", | ||
def cuda120_spec() -> GPUSpecs: | ||
return GPUSpecs( | ||
backend_version_string="120", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set gpu_backend here
return CUDASpecs( | ||
cuda_version_string="111", | ||
def cuda111_noblas_spec() -> GPUSpecs: | ||
return GPUSpecs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set gpu_backend
Replace the cuda specs with a more general gpu specs that supports both rocm and cuda