-
Notifications
You must be signed in to change notification settings - Fork 635
/
Copy pathunsloth.yaml
42 lines (36 loc) · 1.34 KB
/
unsloth.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Runs the unsloth example app via SkyPilot
#
# The example app starts by obtaining the LAION dataset,
# loads the Mistral model with 4-bit precision, performs model
# patching with fast LoRA weights, and finally initializes and
# trains the model using the SFTTrainer with specified
# hyperparameters and the LAION dataset.
#
# Usage:
# sky launch -c myclus unsloth.yaml
# sky down myclus
resources:
accelerators: T4:1
disk_size: 128
file_mounts:
# Creates a new bucket my-unsloth-checkpoints and mounts it at /outputs
/outputs:
name: my-unsloth-checkpoints # Ensure this name is unique
workdir: .
setup: |
set -ex
pip install --upgrade pip
cuda_version=$(nvcc --version | grep "release" | awk '{print $6}' | cut -c 2-)
if [[ "$cuda_version" == "12.1"* ]]; then
pip install --upgrade --force-reinstall --no-cache-dir torch==2.2.0 triton \
--index-url https://download.pytorch.org/whl/cu121
pip install ipython
pip install "unsloth[cu121-torch220] @ git+https://github.com/unslothai/unsloth.git"
else
pip install --upgrade --force-reinstall --no-cache-dir torch==2.2.0 triton \
--index-url https://download.pytorch.org/whl/cu118
pip install ipython
pip install "unsloth[cu118-torch220] @ git+https://github.com/unslothai/unsloth.git"
fi
run: |
python unsloth_example.py --output-dir /outputs