Conversation
pnunna93
suggested changes
Nov 8, 2024
pnunna93
reviewed
Jan 14, 2025
| 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.
These are only for cuda and rocm as of now, may be use BNB_BACKEND from cextension instead?
pnunna93
reviewed
Jan 14, 2025
| 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.
Leave env var as BNB_CUDA_VERSION and mention 'for cuda'
pnunna93
reviewed
Jan 14, 2025
| library_name += "_nocublaslt" | ||
| library_name = f"{library_name}{DYNAMIC_LIBRARY_SUFFIX}" | ||
|
|
||
| # Do I need to change it to BNB_GPU_VERSION here? IGNORE FOR NOW! |
pnunna93
reviewed
Jan 14, 2025
|
|
||
| # 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: |
pnunna93
reviewed
Jan 14, 2025
| 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.
Please make this comment generic for gpu backend
pnunna93
reviewed
Jan 14, 2025
| print_header("OTHER") | ||
| cuda_specs = get_cuda_specs() | ||
| gpu_specs = get_gpu_specs() | ||
| if HIP_ENVIRONMENT: |
There was a problem hiding this comment.
Refactor the code to print gpu specs directly
pnunna93
reviewed
Jan 14, 2025
| name2qmap = {} | ||
|
|
||
| if lib and lib.compiled_with_cuda: | ||
| if lib and lib.compiled_with_gpu: |
There was a problem hiding this comment.
Change this to BNB_BACKEND cuda and rocm
pnunna93
reviewed
Jan 14, 2025
| import re | ||
| import subprocess | ||
| from typing import List, Optional, Tuple | ||
| from typing import Optional, Tuple, Union |
There was a problem hiding this comment.
Can we remove Union if its not used anymore?
pnunna93
reviewed
Jan 14, 2025
| cuda_version_string="120", | ||
| def cuda120_spec() -> GPUSpecs: | ||
| return GPUSpecs( | ||
| backend_version_string="120", |
pnunna93
reviewed
Jan 14, 2025
| return CUDASpecs( | ||
| cuda_version_string="111", | ||
| def cuda111_noblas_spec() -> GPUSpecs: | ||
| return GPUSpecs( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the cuda specs with a more general gpu specs that supports both rocm and cuda