unsloth icon indicating copy to clipboard operation
unsloth copied to clipboard

Direct windows support for unsloth

Open adityaghai07 opened this issue 1 year ago • 2 comments

This PR is a continuation of #1821

Direct Windows support for Unsloth

Feature Overview

These changes allow user to install unsloth on windows directly without any dependency issues using a simple command:

pip install "unsloth[windows] @ git+https://github.com/unslothai/unsloth.git"

Implementation Details

  • Updated pyproject.toml to allow installation of unsloth and all its dependencies directly without manual work.

Reasoning

  • First issue was to configure GPU by installing GPU drivers and CUDA drivers. This is a necessary prerequisite for PyTorch to utilize GPU acceleration.
  • As the PyTorch version depends on the versions of CUDA drivers used, we need to install PyTorch specific to the CUDA drivers installed previously. Mismatched versions often cause compatibility issues.
  • On Windows, we need Windows SDK and a compatible C/C++ compiler to run some dependencies, so using Microsoft Visual C++ (MSVC) we can easily install those required components for proper compilation.
  • Finally, we updated pyproject.toml to support direct installation of all dependencies and unsloth, ensuring the package can be installed with a single command without manual intervention.

Testing Details

  • Tested on 4 python versions: 3.9, 3.10, 3.11, 3.12.
  • Tested for 3 different CUDA versions - 11.8, 12.4, 12.6
  • Tested on 2 windows machines with different GPUs to test support across different drivers - GTX 1650, RTX 3050

Contributors

This feature was developed in collaboration with @Captain-T2004.

adityaghai07 avatar Feb 27 '25 09:02 adityaghai07

Ok this is good! One final request - would it be possible to add some screenshots for Windows C++ installations - I know sometimes people can get stuck! Once that's in, I can merge this - great work!

danielhanchen avatar Feb 27 '25 11:02 danielhanchen

@danielhanchen, We have made the suggested additions, please take a look. Also I had a suggestion, If possible please create a discussion channel specifically related to Windows support for Unsloth. This way people can post the issues they face and we can also add all the solutions we found to the problems we faced.

Captain-T2004 avatar Feb 27 '25 14:02 Captain-T2004

@adityaghai07 @Captain-T2004 Can you guys email us :) Email is on my Github profile!

danielhanchen avatar Feb 28 '25 04:02 danielhanchen

Oh I just noticed it's a bit off on small screens: image

danielhanchen avatar Feb 28 '25 04:02 danielhanchen

Made a discussion here: https://github.com/unslothai/unsloth/discussions/1849

shimmyshimmer avatar Feb 28 '25 04:02 shimmyshimmer

Does the direct pip command not support cuda 12.9? I am getting the unsloth notimplementederror, despite having followed all the steps as detailed image

Eros483 avatar Jun 18 '25 14:06 Eros483