GithubHelp home page GithubHelp logo

vitri-ent / winbnb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitsandbytes-foundation/bitsandbytes

0.0 0.0 0.0 1.01 MB

8-bit CUDA functions for PyTorch on Windows

License: MIT License

Shell 1.23% C++ 8.35% Python 59.48% C 0.09% Cuda 29.84% Makefile 1.01%

winbnb's Introduction

winbnb

A non-hacky Windows distribution of bitsandbytes. Inspired by ShanGor/bitsandbytes-windows, updated for bitsandbytes 0.40.0-post4 with 4-bit inference, and less hacky specifically in the CUDA loading parts.

For most purposes, you should probably just use WSL 2, but this package is intended for usage in memory-constrained environments where WSL taking an extra few GB of RAM on top of whatever absurd amount CUDA itself allocates is undesirable.

Usage

Currently we only distribute prebuilt binaries for CUDA 11.8. If you have CUDA 11.8, great! Head over to Releases to pick up our prebuilt wheel.

Otherwise, head to Building below.

Building

You need your choice of CUDA Toolkit > 11 and Visual Studio Community/Build Tools 2022.

In PowerShell:

mkdir dependencies
cd dependencies
# use wget if you have that (choco install wget) or just download it manually
wget https://github.com/GerHobbelt/pthread-win32/archive/refs/tags/version-3.1.0-release.zip
expand-archive version-3.1.0-release.zip .
rm version-3.1.0-release.zip
mv pthread-win32-version-3.1.0-release pthread-win32

In x64 Native Tools Command Prompt for VS 2022 (aka hell):

# configure these accordingly
set WINBNB=E:\Dev\winbnb       # winbnb clone path
set PYTHON_HOME=C:\Python3.10
set CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin
set CUDA_VERSION=118           # e.g. 11.8 = 118, 12.0 = 120
set LIB=%LIB%;%CUDA_HOME%/lib/x64;%PYTHON_HOME%/lib;%WINBNB%/dependencies/pthread-win32

cd %WINBNB%\dependencies\pthread-win32
nmake VC-static
cd %WINBNB%
mkdir build
nvcc -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -Xcompiler /DYNAMICBASE --use_fast_math -Xptxas=-v -dc %WINBNB%/csrc/ops.cu %WINBNB%/csrc/kernels.cu -I %CUDA_HOME%/include -I %WINBNB%/csrc -I %PYTHON_HOME%/include -I %WINBNB%/include -I %WINBNB%/dependencies/pthread-win32 -L %CUDA_HOME%/lib/x64 -lcudart -lcublas -lcublasLt -lcusparse -lpthreadVC3 -L %PYTHON_HOME%/lib -L %WINBNB%/dependencies/pthread-win32 --output-directory %WINBNB%/build
nvcc -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -Xcompiler /DYNAMICBASE -dlink %WINBNB%/build/ops.obj %WINBNB%/build/kernels.obj -o %WINBNB%/build/link.obj
cl /EHsc /DBUILD_CUDA=1 /std:c++14 /LD /I %CUDA_HOME%/include /I %WINBNB%/csrc /I %PYTHON_HOME%/include /I %WINBNB%/include /I %WINBNB%/dependencies/pthread-win32 %WINBNB%/build/kernels.obj %WINBNB%/build/ops.obj %WINBNB%/build/link.obj ./csrc/common.cpp ./csrc/cpu_ops.cpp ./csrc/pythonInterface.cpp libpthreadVC3.lib cudart.lib cublas.lib cublasLt.lib cusparse.lib /link /out:./bitsandbytes/bitsandbytes_cuda%CUDA_VERSION%.dll

winbnb's People

Contributors

artidoro avatar blackhc avatar borzik avatar chessgecko avatar cyberes avatar dbaranchuk avatar decahedron1 avatar justheuristic avatar kashif avatar lostmsu avatar lucidrains avatar mbrukman avatar mryab avatar rapsealk avatar shademe avatar sirrob1997 avatar stas00 avatar svgsponer avatar timdettmers avatar titus-von-koeller avatar tomaarsen avatar tonylins avatar ubik2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.