Skip to content
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

Update installation instructions #1047

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

rickardp
Copy link
Contributor

@rickardp rickardp commented Feb 6, 2024

Fixes: #1042

Copy link
Collaborator

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! I left one suggestion - wdyt?

docs/source/installation.mdx Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Feb 6, 2024

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@rickardp
Copy link
Contributor Author

rickardp commented Feb 6, 2024

I verified the instructions on macOS (obviously swapping cuda -> mps) and Linux (well, the cuda container under Docker desktop). Can someone please double check the WIndows instructions as I have no way of testing it currently?

Copy link
Collaborator

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again ! I left more open questions, what do you think?

cmake -B build -DBUILD_CUDA=ON -S .
cmake --build build --config Release
cmake -DCOMPUTE_BACKEND=cuda -S .
cmake --build . --config Release
python -m build --wheel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python -m build --wheel
pip install .

For consistency with above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it as it is since I can't verify this. Can someone with access to a windows VM double check these?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes good point - cc @wkpark 🙏

Copy link
Member

@matthewdouglas matthewdouglas Feb 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me with pip install ..

Alternatively with building the wheel, this also works:

python -m build --wheel
pip install dist/bitsandbytes-0.43.0.dev0-cp311-cp311-win_amd64.whl

docs/source/installation.mdx Outdated Show resolved Hide resolved
@younesbelkada
Copy link
Collaborator

Thanks @rickardp !
cc @wkpark do you think you can quickly test the commands on your windows machine? 🙏

Copy link
Collaborator

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! We can also merge this PR to at least unblock Linux users and we can always do a follow up PR to fix the windows instructions, what do you think @rickardp ?

@rickardp
Copy link
Contributor Author

rickardp commented Feb 6, 2024

I realize this section in this PR duplicates the information i the "compiing from source" document. Better close this and reference this one in PR #1048 instead?

@younesbelkada
Copy link
Collaborator

IMO it is fine to have both as we can see installation.mdx page as how to quickly install bnb either from source or pypi and the compilation page as a slightly more elaborated page with guidance on how to install cuda toolkit etc. I am in favor of keeping the compilation page to keep the installation page as minimal as possible

@younesbelkada
Copy link
Collaborator

IMO good to merge as @matthewdouglas tested it, what do you think @rickardp ?

@wkpark
Copy link
Contributor

wkpark commented Feb 6, 2024

Thanks @rickardp ! cc @wkpark do you think you can quickly test the commands on your windows machine? 🙏

(I used -B build instead to keep working dir clean. in this case, *.dll will be built at build/bitsandbytes/)

cmake -B build -DCOMPUTE_BACKEND=cuda  -S .
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045.
-- The CXX compiler identification is MSVC 19.34.31937.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building with backend cuda
-- NO_CUBLASLT := OFF
-- The CUDA compiler identification is NVIDIA 11.8.89
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include (found version "11.8.89")
-- CUDA Version: 118 (11.8.89)
-- CUDA Compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe
-- CUDA Capabilities Available: 35;37;50;52;53;60;61;62;70;72;75;80;86;87;89;90
-- CUDA Capabilities  Selected: 35;37;50;52;53;60;61;62;70;72;75;80;86;87;89;90
-- CUDA NVCC Flags: -D_WINDOWS -Xcompiler=" /EHsc" --use_fast_math -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90
-- Configuring done (19.2s)
-- Generating done (0.1s)
-- Build files have been written to: F:/webui/webui/stable-diffusion-webui/extensions/redetailer/bitsandbytes/build


(venv) F:\webui\webui\stable-diffusion-webui\extensions\redetailer\bitsandbytes>cmake --build build --config Release
...(snip)
 kernels.cu
  common.cpp
  cpu_ops.cpp
  pythonInterface.cpp
 ....

  (venv) F:\webui\webui\stable-diffusion-webui\extensions\redetailer\bitsandbytes\build>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.exe" -dlink -o bitsandbytes.dir\Release\libbitsandbytes_cuda118.device-link.obj -Xcompiler "/EHsc /W1 /nologo /O2 /Fdbitsandbytes.dir\Re
  lease\vc143.pdb   /MD " -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin/crt" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64\cudart.lib" "C:\Program Files\NVIDIA GPU Computing Toolkit\CU
  DA\v11.8\lib\x64\cublas.lib" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64\cusparse.lib" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64\cublasLt.lib" cudadevrt.lib cudart_static.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib
   oleaut32.lib uuid.lib comdlg32.lib advapi32.lib -forward-unknown-to-host-compiler -Wno-deprecated-gpu-targets -D_WINDOWS -Xcompiler=" /EHsc" --use_fast_math -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_5
  2,code=sm_52 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80
  ,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -Xcompiler="-O2 -Ob2" -DNDEBUG "--generate-code=arch=compute_52,code=[compute_52,sm_52]" -Xcompiler=-MD   --machine 64 bitsandbytes.d
  ir\Release\ops.obj bitsandbytes.dir\Release\kernels.obj
  cudart.lib
  cublas.lib
  cusparse.lib
  cublasLt.lib
  cudadevrt.lib
  cudart_static.lib
  kernel32.lib
  user32.lib
  gdi32.lib
  winspool.lib
  shell32.lib
  ole32.lib
  oleaut32.lib
  uuid.lib
  comdlg32.lib
  advapi32.lib
  ops.obj
  kernels.obj
  Auto build dll exports
     F:/webui/webui/stable-diffusion-webui/extensions/redetailer/bitsandbytes/build/Release/bitsandbytes_cuda118.lib .... F:/webui/webui/stable-diffusion-webui/extensions/redetailer/bitsandbytes/build/Release/bitsandbytes_cuda118.exp ..
  bitsandbytes.vcxproj -> F:\webui\webui\stable-diffusion-webui\extensions\redetailer\bitsandbytes\build\bitsandbytes\libbitsandbytes_cuda118.dll
  Building Custom Rule F:/webui/webui/stable-diffusion-webui/extensions/redetailer/bitsandbytes/CMakeLists.txt

@wkpark wkpark mentioned this pull request Feb 6, 2024
Copy link
Collaborator

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much everyone for testing ! 🎉

@younesbelkada younesbelkada merged commit 88ab630 into bitsandbytes-foundation:main Feb 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix "install from source" instructions
4 participants