This commit is contained in:
Dan Saunders
2025-08-29 22:37:09 -04:00
parent b453562c01
commit 9ec33f52e3
7 changed files with 42 additions and 72 deletions

View File

@@ -31,7 +31,11 @@ PRs are **greatly welcome**!
Please run below to setup env Please run below to setup env
```bash ```bash
pip3 install -r requirements-dev.txt -r requirements-tests.txt # Using uv (recommended)
uv pip install -e .[dev]
# OR using pip
pip3 install -e .[dev]
pre-commit install pre-commit install
# test # test

View File

@@ -47,7 +47,7 @@ jobs:
run: | run: |
uv pip install --system wheel packaging==23.2 uv pip install --system wheel packaging==23.2
uv pip install --system --no-build-isolation -e . uv pip install --system --no-build-isolation -e .
uv pip install --system -r requirements-dev.txt -r requirements-tests.txt uv pip install --system -e .[dev]
- name: Extract tag name - name: Extract tag name
id: tag id: tag

View File

@@ -66,7 +66,7 @@ jobs:
uv pip install --system --no-build-isolation -U -e . uv pip install --system --no-build-isolation -U -e .
python scripts/unsloth_install.py --uv | sh python scripts/unsloth_install.py --uv | sh
python scripts/cutcrossentropy_install.py --uv | sh python scripts/cutcrossentropy_install.py --uv | sh
uv pip install --system -r requirements-dev.txt -r requirements-tests.txt uv pip install --system -e .[dev]
- name: Make sure PyTorch version wasn't clobbered - name: Make sure PyTorch version wasn't clobbered
run: | run: |

View File

@@ -8,8 +8,8 @@ on:
paths: paths:
- '**.py' - '**.py'
- 'requirements.txt' - 'requirements.txt'
- 'pyproject.toml'
- '.github/workflows/*.yml' - '.github/workflows/*.yml'
- 'requirements-tests.txt'
- 'cicd/cicd.sh' - 'cicd/cicd.sh'
- 'cicd/Dockerfile.jinja' - 'cicd/Dockerfile.jinja'
pull_request: pull_request:
@@ -17,8 +17,8 @@ on:
paths: paths:
- '**.py' - '**.py'
- 'requirements.txt' - 'requirements.txt'
- 'pyproject.toml'
- '.github/workflows/*.yml' - '.github/workflows/*.yml'
- 'requirements-tests.txt'
- 'cicd/cicd.sh' - 'cicd/cicd.sh'
- 'cicd/Dockerfile.jinja' - 'cicd/Dockerfile.jinja'
workflow_dispatch: workflow_dispatch:
@@ -87,7 +87,7 @@ jobs:
uv pip install --system --no-build-isolation -U -e . uv pip install --system --no-build-isolation -U -e .
python scripts/unsloth_install.py --uv | sh python scripts/unsloth_install.py --uv | sh
python scripts/cutcrossentropy_install.py --uv | sh python scripts/cutcrossentropy_install.py --uv | sh
uv pip install --system -r requirements-dev.txt -r requirements-tests.txt uv pip install --system -e .[dev]
- name: Make sure PyTorch version wasn't clobbered - name: Make sure PyTorch version wasn't clobbered
run: | run: |
@@ -155,10 +155,11 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
uv pip show --system torch uv pip show --system torch
uv pip install --system wheel
uv pip install --system --no-build-isolation -e . uv pip install --system --no-build-isolation -e .
python scripts/unsloth_install.py --uv | sh python scripts/unsloth_install.py --uv | sh
python scripts/cutcrossentropy_install.py --uv | sh python scripts/cutcrossentropy_install.py --uv | sh
uv pip install --system -r requirements-dev.txt -r requirements-tests.txt uv pip install --system -e .[dev]
- name: Make sure PyTorch version wasn't clobbered - name: Make sure PyTorch version wasn't clobbered
run: | run: |
@@ -233,7 +234,7 @@ jobs:
pytorch: 2.7.1 pytorch: 2.7.1
num_gpus: 1 num_gpus: 1
axolotl_extras: axolotl_extras:
dockerfile: "Dockerfile-uv.jinja" dockerfile: "Dockerfile.jinja"
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@@ -1,52 +0,0 @@
FROM axolotlai/axolotl-base-uv:{{ BASE_TAG }}
ENV TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 9.0+PTX"
ENV AXOLOTL_EXTRAS="{{ AXOLOTL_EXTRAS }}"
ENV AXOLOTL_ARGS="{{ AXOLOTL_ARGS }}"
ENV CUDA="{{ CUDA }}"
ENV PYTORCH_VERSION="{{ PYTORCH_VERSION }}"
ENV GITHUB_REF="{{ GITHUB_REF }}"
ENV GITHUB_SHA="{{ GITHUB_SHA }}"
ENV NIGHTLY_BUILD="{{ NIGHTLY_BUILD }}"
ENV HF_HOME="{{ HF_HOME }}"
RUN apt-get update && \
apt-get install -y --allow-change-held-packages vim curl nano libnccl2 libnccl-dev ibverbs-providers ibverbs-utils infiniband-diags librdmacm-dev librdmacm1 rdmacm-utils slurm-wlm
WORKDIR /workspace
RUN git clone --depth=1 https://github.com/axolotl-ai-cloud/axolotl.git
WORKDIR /workspace/axolotl
RUN git fetch origin +$GITHUB_REF && \
git checkout FETCH_HEAD
# If AXOLOTL_EXTRAS is set, append it in brackets
RUN if [ "$NIGHTLY_BUILD" = "true" ] ; then \
sed -i 's#^transformers.*#transformers @ git+https://github.com/huggingface/transformers.git@main#' requirements.txt; \
sed -i 's#^peft.*#peft @ git+https://github.com/huggingface/peft.git@main#' requirements.txt; \
sed -i 's#^accelerate.*#accelerate @ git+https://github.com/huggingface/accelerate.git@main#' requirements.txt; \
sed -i 's#^trl.*#trl @ git+https://github.com/huggingface/trl.git@main#' requirements.txt; \
sed -i 's#^datasets.*#datasets @ git+https://github.com/huggingface/datasets.git@main#' requirements.txt; \
fi
RUN uv pip install packaging==23.2 setuptools==75.8.0
RUN if [ "$AXOLOTL_EXTRAS" != "" ] ; then \
uv pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray,$AXOLOTL_EXTRAS] $AXOLOTL_ARGS; \
else \
uv pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray] $AXOLOTL_ARGS; \
fi
RUN python scripts/unsloth_install.py --uv | sh
RUN python scripts/cutcrossentropy_install.py --uv | sh
# So we can test the Docker image
RUN uv pip install -r requirements-dev.txt -r requirements-tests.txt
# fix so that git fetch/pull from remote works
RUN git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && \
git config --get remote.origin.fetch
# helper for huggingface-login cli
RUN git config --global credential.helper store

View File

@@ -1,6 +1,6 @@
FROM axolotlai/axolotl-base:{{ BASE_TAG }} FROM axolotlai/axolotl-base-uv:{{ BASE_TAG }}
ENV TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX" ENV TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 9.0+PTX"
ENV AXOLOTL_EXTRAS="{{ AXOLOTL_EXTRAS }}" ENV AXOLOTL_EXTRAS="{{ AXOLOTL_EXTRAS }}"
ENV AXOLOTL_ARGS="{{ AXOLOTL_ARGS }}" ENV AXOLOTL_ARGS="{{ AXOLOTL_ARGS }}"
ENV CUDA="{{ CUDA }}" ENV CUDA="{{ CUDA }}"
@@ -9,7 +9,6 @@ ENV GITHUB_REF="{{ GITHUB_REF }}"
ENV GITHUB_SHA="{{ GITHUB_SHA }}" ENV GITHUB_SHA="{{ GITHUB_SHA }}"
ENV NIGHTLY_BUILD="{{ NIGHTLY_BUILD }}" ENV NIGHTLY_BUILD="{{ NIGHTLY_BUILD }}"
ENV HF_HOME="{{ HF_HOME }}" ENV HF_HOME="{{ HF_HOME }}"
ENV AXOLOTL_DATASET_PROCESSES="8"
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --allow-change-held-packages vim curl nano libnccl2 libnccl-dev ibverbs-providers ibverbs-utils infiniband-diags librdmacm-dev librdmacm1 rdmacm-utils slurm-wlm apt-get install -y --allow-change-held-packages vim curl nano libnccl2 libnccl-dev ibverbs-providers ibverbs-utils infiniband-diags librdmacm-dev librdmacm1 rdmacm-utils slurm-wlm
@@ -32,18 +31,18 @@ RUN if [ "$NIGHTLY_BUILD" = "true" ] ; then \
sed -i 's#^datasets.*#datasets @ git+https://github.com/huggingface/datasets.git@main#' requirements.txt; \ sed -i 's#^datasets.*#datasets @ git+https://github.com/huggingface/datasets.git@main#' requirements.txt; \
fi fi
RUN pip install packaging==23.2 setuptools==75.8.0 RUN uv pip install packaging==23.2 setuptools==75.8.0
RUN if [ "$AXOLOTL_EXTRAS" != "" ] ; then \ RUN if [ "$AXOLOTL_EXTRAS" != "" ] ; then \
pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray,$AXOLOTL_EXTRAS] $AXOLOTL_ARGS; \ uv pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray,$AXOLOTL_EXTRAS] $AXOLOTL_ARGS; \
else \ else \
pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray] $AXOLOTL_ARGS; \ uv pip install --no-build-isolation -e .[deepspeed,flash-attn,ring-flash-attn,optimizers,ray] $AXOLOTL_ARGS; \
fi fi
RUN python scripts/unsloth_install.py | sh RUN python scripts/unsloth_install.py --uv | sh
RUN python scripts/cutcrossentropy_install.py | sh RUN python scripts/cutcrossentropy_install.py --uv | sh
# So we can test the Docker image # So we can test the Docker image
RUN pip install -r requirements-dev.txt -r requirements-tests.txt RUN uv pip install -e .[dev]
# fix so that git fetch/pull from remote works # fix so that git fetch/pull from remote works
RUN git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && \ RUN git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && \

View File

@@ -164,12 +164,30 @@ llmcompressor = [
# Development dependencies # Development dependencies
dev = [ dev = [
# Testing
"pytest", "pytest",
"pytest-cov", "pytest-cov",
"pytest-retry",
"pytest-sugar",
"pytest-xdist", "pytest-xdist",
"pre-commit", "codecov",
"ruff", "codecov-cli",
"tbparse",
# Code quality
"black",
"ruff",
"mypy", "mypy",
"pre-commit",
"types-requests",
# Documentation
"quartodoc",
"jupyter",
# Utilities
"blobfile",
"tiktoken",
] ]
[project.scripts] [project.scripts]