bitsandbytes icon indicating copy to clipboard operation
bitsandbytes copied to clipboard

is it work on Win platform?

Open Nehc opened this issue 4 years ago • 17 comments

I am have OSError: [WinError 193] %1 is not a valid Win32 application in lib = ct.cdll.LoadLibrary(os.path.dirname(file) + '/libbitsandbytes.so') in functional.py. WAIDW?

Nehc avatar Oct 28 '21 19:10 Nehc

Currently, Windows is not supported. I do not have access to Windows 10 and I am unable to help with this. It would be great to get help on this from someone on a Windows system. Would you be willing to help get bnb to work on Windows?

TimDettmers avatar Nov 15 '21 15:11 TimDettmers

I've taken a quick look at this e.g. here and here - but have not done such ports before. My initial thoughts are:

  • currently bitsandbytes loads libbitsandbytes.so which won't work on windows
  • under windows, this would need to be a .dll and likely to be provided in both 32bit and 64bit
  • the makefile / build system needs some changes to work under windows. e.g. nvcc and cuda might be fine, but gpp probably needs to be switched to visual studio and there are a couple of linux shell commands, that would need replacing.

I'm hesitant to investigate windows build systems from really huge projects (pytorch, sklearn, ...) because their scope seems way different. Are you aware of a project with similar scope as bitsandbytes and a working windows build system to use as an example?

jorahn avatar Nov 24 '21 07:11 jorahn

I've spent a bit more time looking at how DeepSpeed solves building on Windows. They make use of BuildExtension, CppExtension and CudaExtension from torch.utils.cpp_extension and this build process is run through python setup.py bdist_wheel, no Makefile.
Here is the Pytorch guide. Looking also at the Cuda Kernels in /csrc/*.cu his seems like a fit, but no idea if this is the best option.

jorahn avatar Nov 25 '21 19:11 jorahn

Thanks @jorahn! What DeepSpeed is doing seems to be the canonical way to handle this. @TitusCornelius is currently working on a conda build and it might be useful to add this together with the conda build and fix at the same time Windows installation. @TitusCornelius any thoughts on how much work this would be?

TimDettmers avatar Dec 04 '21 20:12 TimDettmers

Any update on this?

BrainSlugs83 avatar Jul 02 '22 02:07 BrainSlugs83

Hi @jorahn, hi all,

Hi all, Sorry for the late reply, the first notification passed me by somehow.

Anyways, yes, I've spent some time on trying to automate the build, but so far it's just a repackaging of the pip package and that isn't even working due to two bugs in conda that I have yet to report.

Either way, I was planning to automate the Linux build as a parametrized Conda package (building everything from scratch), but Windows is not on my roadmap, unless I receive a contribution from one of you with a functioning Windows buildscript that I can then retool into the conda package install.

Let me know if you're interested in collaborating on this. I'll only start working on this again in three weeks though.

Kind regards,Titus

P.S. Thanks Jonathan, those seem like useful links for starting work on this, however, neither @TimDettmers nor I are planning to take the lead on the Windows build. Contributions, however, are highly appreciated and we'll try to support and get this implemented if we have your support.

P.P.S. Any future work will be done exclusively on https://github.com/TimDettmers/bitsandbytes however.

Titus-von-Koeller avatar Jul 07 '22 17:07 Titus-von-Koeller

I could try helping out in a week or so:

  • Either directly -- though I would need some guidance on what needs to be accomplished (and it would be kind of a "in my spare time" effort).

  • Or indirectly -- i.e. I could provide you with access to a Windows Machine (i.e. via VNC, RDP, or SSH -- pick your poison).

BrainSlugs83 avatar Jul 20 '22 21:07 BrainSlugs83

I can furnish you with a Pro 10 license if it would help.

noizu avatar Sep 01 '22 11:09 noizu

@noizu -- looks like the future repo is here: https://github.com/TimDettmers/bitsandbytes (according to his previous post).

BrainSlugs83 avatar Sep 01 '22 15:09 BrainSlugs83

Excuse me, does this repository support Windows now?

natureXD avatar Feb 16 '23 10:02 natureXD

Excuse me, does this repository support Windows now?

Still not..

nikich340 avatar Feb 21 '23 00:02 nikich340

Excuse me, does this repository support Windows now?

Still not..

Okay, thanks.

natureXD avatar Feb 23 '23 01:02 natureXD

Up. Windows support

whitepapercg avatar Mar 18 '23 15:03 whitepapercg

Okay, thanks very much. I'll try it later.

natureXD avatar Mar 20 '23 09:03 natureXD

I download the latest version which is 0.37.0, however, it does not support windows....

ohUMR avatar Mar 24 '23 07:03 ohUMR

I have made a bitsandbytes-windows lib so it could work on windows 10

https://github.com/TimDettmers/bitsandbytes/issues/175#issuecomment-1488003048

Simply install it via pip install git+https://github.com/Keith-Hon/bitsandbytes-windows.git

Keith-Hon avatar Mar 31 '23 11:03 Keith-Hon

Also this exists: https://github.com/DeXtmL/bitsandbytes-win-prebuilt

BrainSlugs83 avatar Apr 11 '23 03:04 BrainSlugs83