Repository navigation
Closed
Description
I'm trying to follow the instructions for installing unsloth in a conda environment, the problem is that the conda gets stuck when running the install lines.
I've tried running it twice, both times it got stuck solving the environment and I stopped after 30 minutes.
$ conda install cudatoolkit xformers bitsandbytes pytorch pytorch-cuda=12.1 -c pytorch -c nvidia -c xformers -c conda-forge -y
Collecting package metadata (current_repodata.json): \ WARNING conda.models.version:get_matcher(546): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): - WARNING conda.models.version:get_matcher(546): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0.*, but conda is ignoring the .* and treating it as 1.8.0
WARNING conda.models.version:get_matcher(546): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0.*, but conda is ignoring the .* and treating it as 1.9.0
WARNING conda.models.version:get_matcher(546): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.6.0.*, but conda is ignoring the .* and treating it as 1.6.0
done
Solving environment: |
Additional system info:
$ nvidia-smi
Mon Jan 8 20:28:55 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03 Driver Version: 535.129.03 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA A10G Off | 00000000:00:1E.0 Off | 0 |
| 0% 28C P8 16W / 300W | 4MiB / 23028MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
Reacted by Daniel Han
Metadata
Metadata
Assignees
Labels
No labels
Activity
danielhanchen commentedon Jan 9, 2024
Do you have
mamba?Maybe try
mamba install cudatoolkit xformers bitsandbytes pytorch pytorch-cuda=12.1 -c pytorch -c nvidia -c xformers -c conda-forge -ydanielhanchen commentedon Jan 9, 2024
Mamba can help solve long solving issues
NasonZ commentedon Jan 9, 2024
No, I have a miniconda/anaconda which was installed via oobabooga.
danielhanchen commentedon Jan 10, 2024
@NasonZ hmmmm another approach is to install it one by one and ignoring pytorch
NasonZ commentedon Jan 10, 2024
TLDR:
These are the steps I took to get my unsloth conda env working
So I tried installing one by one which raised I few issues which I was able to work around.
Installing
cudatoolkitseparately led to issues when installing pytorch after,cudatoolkitis installed bypytorch-cudaso specifying it separately was redundant in my case.Installing
bitsandbytesviaconda install bitsandbytes -c conda-forge -yled to the same frozen solve issue outlined originally. Installing viaconda install conda-forge::bitsandbytesalso didn't work, bitsandbytes threw a load of errors when runningfrom unsloth import FastLanguageModel. Eventually got it running by installing the method mentioned in the bitsandbytes repo -pip install bitsandbytes.I verified that my enviornment was working by running the TinyLLama notebook.
danielhanchen commentedon Jan 10, 2024
Oh my! Thanks so so much for the detailed instructions - I'll be pinning this if you don't mind :) Glad it finnaly was able to work!!
[-]Conda install stuck[/-][+]Conda installation detailed instructions[/+]NasonZ commentedon Jan 10, 2024
No worries, happy to help other get onboard with what looks to be a really useful package :)
findalexli commentedon Feb 8, 2024
hi there, still getting the following error: Could not solve for environment specs
The following packages are incompatible
└─ xformers is installable with the potential options
├─ xformers [0.0.16|0.0.17|...|0.0.24] would require
│ └─ python >=3.10,<3.11.0a0 , which can be installed;
├─ xformers [0.0.16|0.0.17|...|0.0.24] would require
│ └─ python >=3.9,<3.10.0a0 , which can be installed;
└─ xformers [0.0.16|0.0.20|0.0.21] conflicts with any installable versions previously reported. When running
(unsloth) (base) ubuntu@ip-172-31-34-94:~$ mamba install cudatoolkit xformers bitsandbytes pytorch pytorch-cuda=12.1 -c pytorch -c nvidia -c xformers -c conda-forge -y, I checked that I have coda 12.1 installedGene-Weaver commentedon Mar 14, 2024
I ran into this error:
And used this combination of the approaches listed above to get things working:
conda create --name unsloth_env python=3.10conda activate unsloth_envmamba install xformers pytorch pytorch-cuda=12.1 -c pytorch -c nvidia -c xformers -c conda-forge -ypip install bitsandbytespip install "unsloth[conda] @ git+https://github.com/unslothai/unsloth.git"felipepenhorate commentedon Mar 15, 2024
Just a heads up to anyone that is trying to install the package on a miniconda env and getting error in the xformers installation because of conflicts, it turns out nowadays the conda is installing pytorch==2.2.1 that is not compatible with the xformers. You need to set the pytorch version to 2.2.0 in order to make the installation work properly.
This is what I used:
NasonZ commentedon Mar 15, 2024
@felipepenhorate Thanks for the quick fix, just encountered this issue with conda.
11 remaining items
ArrangingFear56 commentedon Jul 14, 2024
@WasamiKirua
Are you running windows? If so, you may need to run it in WSL 2 instead, that’s what eventually worked for me.
richardxoldman commentedon Jul 16, 2024
It works for me (Linux)
danielhanchen commentedon Jul 18, 2024
Apologies on Conda issues - I do know sometimes it can be painful - another option is to copy paste our Kaggle install instructions here: https://www.kaggle.com/danielhanchen/kaggle-gemma2-9b-unsloth-notebook which might work
SeaQuestdev commentedon Aug 17, 2024
On Windows this works only on WSL"?
ArrangingFear56 commentedon Aug 17, 2024
In my experience, yes. There would be unresolvable dependencies otherwise.
SeaQuestdev commentedon Aug 17, 2024
Thanks @ArrangingFear56 Will try later in WSL. Currently fine tuning in colab.
danielhanchen commentedon Aug 24, 2024
I did make the installation somewhat better in https://github.com/unslothai/unsloth?tab=readme-ov-file#-installation-instructions! Hope this makes things better!
OFouda1 commentedon Aug 28, 2024
@NasonZ Thanks Thanks Thanks
mohamednaji7 commentedon Dec 15, 2024
@NasonZ Thanks a lot; I downloaded it on RunPod
$ conda create --name <your_unsloth_env> python=3.10
$ conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
Bug fixes, Gemma 3 (unslothai#73)
Bug fixes, Gemma 3 (unslothai#73)
Bug fixes, Gemma 3 (unslothai#73)
Studio sd.cpp: pin the prebuilt resynced with upstream master-1056 (u…