-
Notifications
You must be signed in to change notification settings - Fork 636
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
Missing Windows support #30
Comments
After some really tedious debugging and tackling various hidden problems, I managed to compile the whole module. The binaries are compiled against CUDAToolkit 11.6 and Visual Studio 2022.
That should do the trick. Hopefully this can help someone in the Windows territory; let's hope the official windows support come fast. |
Thank you. This might be the key. |
could you provide a makefile for this? |
Where do you put the pre-built file to activate adam? |
An easy way to always return |
You put them in |
Appreciate you doing this work, helped unblock me in a big way. I hope bitsandbytes supports Windows directly sooner rather than later, but this is a great stopgap. |
@PinPointPing Thanks a lot, it just worked like a charm |
Same issue for me, if someone can compile cuda 11.8 binaries for me i can test them :) btw under Windows, the environment variable is
|
after following some advice and making the edits in this thread, i got Adam to run on my CUDA 11.8 setup/ it does indeed work for me :)
|
would you mind sharing your cuda 11.8 binary |
using the libs cuda 11.6 from [(https://github.com/DeXtmL/bitsandbytes-win-prebuilt)] |
@TimDettmers any updates on this ? 😄 |
I just got this building with cmake. First thing I did was make a directory called dependencies , then download https://github.com/GerHobbelt/pthread-win32 and extract the whole thing there so it's /project_root/dependencies/pthread-win32-main/pthread.h (I lied, I didn't really do that first, did that last but I suggest anyone following this do it first to avoid the error) I did apply the patch above by @DeXtmL (Does not compile without it, missing vec_t error).
The first CMakeLists.txt is in the root, the second in csrc.
Then can open the .sln, right click bitsandbytes hit build and it goes to town. I imagine for linux the same cmake file would actually work just fine. Only thing I did special for windows was add the include path for the pthreads, adding an include path to a folder that doesn't exist probably won't hurt right? GL |
Quick final follow up, it built fine in Debug with the above, i actually don't know quite how. For release mode I did actually have to build the pthread library (just another mkdir build, cmake .., open solution, build all in release mode), then slightly modify the cmake file. (Probably could have just done cmake .. ; cmake --build . -j4 --config Release ; to build pthread) I don't know why it worked before in debug mode at all, because I had link_libraries wrong (don't have the -l in cmake in front), and for release mode had to fix that and include pthreadVC3.lib .. here's the final final from me CMakeLists.txt for the csrc folder root/csrc/CMakeLists.txt mkdir build, cd build, cmake .. , cmake --build ./ -j4 --config Release , .dll is put into build/csrc/Release/bitsandbyts.dll just for fun here's it running gpt-j-6b on a RTX3080 on windows 11 with cuda 113
|
You are a hero, thank you so much for posting this! |
Any chance you could hang some instructions somewhere to help others replicate the process? I'm trying to follow along but have run into some issues. A step-by-step would be awesome. |
From my not so great memory it's something like: To build the bitsandbytes project for Windows, you will need two programs: cmake and nvcc. You can a build environment such as Visual Studio and Miniconda. Open the command line interface (CLI) for your build environment. (Start menu/visual studio/ one of them consoles) Run the following commands: (Note -j4 means use 4 cores to build. If you don't have 4 cores, or you have a lot more, change that number.) (Assuming on C:\ drive, if on other drive, change letter on first and second line appropriately.
The resulting dll file will be in build/csrc/Release/bitsandbytes.dll.
END EDIT2 |
Is it possible to run bitsandbytes with 2060RTX 6GB on Windows 10? |
I don't see why it wouldn't run on a 2060, just be aware it doesn't eliminate vram requirements, just reduces them. Still wouldn't be able to run chatgpt for example with it's 800GB+ 32-bit precision vram requirement (if had access to that). Any model that takes <24gb of vram in 32bit, or <12gb of vram in 16bit mode, should be able to fit in 6gb at 8bit. |
Thanks for the answer. I think I get confused about bitsandbytes. I was thinking it only works on Linux and repository such as kohya-ss/sd-scripts or bmaltais/kohya_ss won't work on Windows, because of the lack of compatibility and that is the reason I am not able to run them. But this is not true, as I manage to make them work on my machine eventually. |
why we still cant use on windows this is 2023 |
@FurkanGozukara we can use it on Windows as many people do (me including https://github.com/stoperro/bitsandbytes_windows) with this community effort. It's just less convenient as support is not yet merged into official branch and you need to compile it yourself. Note that even Microsoft doesn't care about Windows support of their own AI tools (microsoft/DeepSpeed#2427), so having some support here when authors don't necessarily have Windows machine is heartening. |
I know that branch really good but really older commit I am making tutorials for regular people. It is not an option for them to "compile it yourself" I hope windows support gets added |
"compile it yourself" can be a blocker indeed, especially as this is lib for Python and compilation errors one may get will be from C++. I could find time to make a PR with whatever was done till now and polish it where necessary, though not sure if someone is doing it already. |
If anyone else is still searching for a Windows solution The README even includes a |
wow very nice |
Legend it worked for me I was one of those looking for hours xDD |
Bitsandbytes was not supported windows before, but my method can support windows.(yuhuang) 3 J:\StableDiffusion\sdwebui\py310\python.exe -m pip uninstall bitsandbytes-windows 4 J:\StableDiffusion\sdwebui\py310\python.exe -m pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64.whl Replace your SD venv directory file(python.exe Folder) here(J:\StableDiffusion\sdwebui\py310) |
Excellent! On Anaconda same thing applies - has to be root of the venv |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. |
Currently, the library uses precompiled Linux binaries. I am unsure how compatible these are with standard PyTorch installs on Windows. It might be that the binaries need to be compiled against mingw32/64 to create functional binaries for Windows.
The most helpful would be a case where a person is able to compile from source and use the library. This will require altering the
Makefile
file. If this works, we can add instructions on compiling for Windows as a first step before doing a full-scale Windows deployment of binaries on pip.Since I do not have a Windows machine, any help is wanted on this!
The text was updated successfully, but these errors were encountered: