Skip to content

Commit

Permalink
HOTFIX: Fix regression (cpu fix) (#1038)
Browse files Browse the repository at this point in the history
* add "_cpu" tag correctly (regression)

* add lib suffix ".dylib" for Darwin

Co-authored-by: Aarni Koskela <[email protected]>

---------

Co-authored-by: Aarni Koskela <[email protected]>
  • Loading branch information
wkpark and akx authored Feb 6, 2024
1 parent ee13b62 commit 6e0f84d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ elseif(BUILD_MPS)
VERBATIM)
add_custom_target(metallib DEPENDS "bitsandbytes/bitsandbytes.metallib")
else()
set(LIBSUFFIX "cpu")
string(APPEND BNB_OUTPUT_NAME "_cpu")
set(GPU_SOURCES)
endif()

Expand Down
5 changes: 2 additions & 3 deletions bitsandbytes/cuda_setup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@

from .env_vars import get_potentially_lib_path_containing_env_vars

if platform.system() == 'Windows': # Windows
DYNAMIC_LIBRARY_SUFFIX = { "Darwin": ".dylib", "Windows": ".dll", "Linux": ".so"}.get(platform.system(), ".so")
if platform.system() == "Windows": # Windows
CUDA_RUNTIME_LIBS = ["nvcuda.dll"]
DYNAMIC_LIBRARY_SUFFIX = ".dll"
else: # Linux or other
# these are the most common libs names
# libcudart.so is missing by default for a conda install with PyTorch 2.0 and instead
# we have libcudart.so.11.0 which causes a lot of errors before
# not sure if libcudart.so.12.0 exists in pytorch installs, but it does not hurt
CUDA_RUNTIME_LIBS = ["libcudart.so", "libcudart.so.11.0", "libcudart.so.12.0", "libcudart.so.12.1", "libcudart.so.12.2"]
DYNAMIC_LIBRARY_SUFFIX = ".so"


class CUDASetup:
Expand Down

0 comments on commit 6e0f84d

Please sign in to comment.