Unverified Commit 6e0f84d4 authored by Won-Kyu Park's avatar Won-Kyu Park Committed by GitHub
Browse files

HOTFIX: Fix regression (cpu fix) (#1038)



* add "_cpu" tag correctly (regression)

* add lib suffix ".dylib" for Darwin
Co-authored-by: default avatarAarni Koskela <akx@iki.fi>

---------
Co-authored-by: default avatarAarni Koskela <akx@iki.fi>
parent ee13b623
...@@ -136,7 +136,7 @@ elseif(BUILD_MPS) ...@@ -136,7 +136,7 @@ elseif(BUILD_MPS)
VERBATIM) VERBATIM)
add_custom_target(metallib DEPENDS "bitsandbytes/bitsandbytes.metallib") add_custom_target(metallib DEPENDS "bitsandbytes/bitsandbytes.metallib")
else() else()
set(LIBSUFFIX "cpu") string(APPEND BNB_OUTPUT_NAME "_cpu")
set(GPU_SOURCES) set(GPU_SOURCES)
endif() endif()
......
...@@ -28,16 +28,15 @@ import torch ...@@ -28,16 +28,15 @@ import torch
from .env_vars import get_potentially_lib_path_containing_env_vars 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"] CUDA_RUNTIME_LIBS = ["nvcuda.dll"]
DYNAMIC_LIBRARY_SUFFIX = ".dll"
else: # Linux or other else: # Linux or other
# these are the most common libs names # these are the most common libs names
# libcudart.so is missing by default for a conda install with PyTorch 2.0 and instead # 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 # 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 # 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"] 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: class CUDASetup:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment