Skip to content

Conversation

@adityaghai07
Copy link
Contributor

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.

@danielhanchen
Copy link
Contributor

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!

@Captain-T2004
Copy link
Contributor

@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.

@danielhanchen danielhanchen merged commit 0887650 into unslothai:main Feb 28, 2025
@danielhanchen
Copy link
Contributor

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

@danielhanchen
Copy link
Contributor

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

@shimmyshimmer
Copy link
Collaborator

Made a discussion here: #1849

@Eros483
Copy link

Eros483 commented Jun 18, 2025

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

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.

5 participants