Skip to content

Commit 1371d40

Browse files
Merge branch 'main' into main
2 parents 489ae4c + c2b2867 commit 1371d40

File tree

171 files changed

+17445
-7966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+17445
-7966
lines changed

.github/workflows/build_docker_images.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ jobs:
2222
group: aws-general-8-plus
2323
steps:
2424
- name: Set up Docker Buildx
25-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
25+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
2626
- name: Check out code
2727
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2828
with:
2929
persist-credentials: false
3030
- name: Login to DockerHub
31-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
31+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
3232
with:
3333
username: ${{ secrets.DOCKERHUB_USERNAME }}
3434
password: ${{ secrets.DOCKERHUB_PASSWORD }}
3535

3636
- name: Build and Push CPU
37-
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
37+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
3838
with:
3939
context: ./docker/peft-cpu
4040
push: true
@@ -55,19 +55,19 @@ jobs:
5555
group: aws-general-8-plus
5656
steps:
5757
- name: Set up Docker Buildx
58-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
58+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
5959
- name: Check out code
6060
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6161
with:
6262
persist-credentials: false
6363
- name: Login to DockerHub
64-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
64+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
6565
with:
6666
username: ${{ secrets.DOCKERHUB_USERNAME }}
6767
password: ${{ secrets.DOCKERHUB_PASSWORD }}
6868

6969
- name: Build and Push GPU
70-
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
70+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
7171
with:
7272
context: ./docker/peft-gpu
7373
push: true

.github/workflows/nightly.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ jobs:
108108
source activate peft
109109
make tests_core_multi_gpu
110110
111+
- name: Run training on multi GPU
112+
run: |
113+
source activate peft
114+
make tests_training
115+
111116
- name: Generate Report
112117
if: always()
113118
run: |

.github/workflows/test-docker-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
if: steps.changed-files.outputs.any_changed == 'true'
3030
id: set-matrix
3131
env:
32-
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
32+
CHANGED_FILES: "${{ steps.changed-files.outputs.all_changed_files }}"
3333
run: |
34-
echo "matrix=${ALL_CHANGED_FILES}" >> $GITHUB_OUTPUT
34+
echo "matrix=$(echo ${CHANGED_FILES} | sed -e 's/\\\"/\"/g')" >> $GITHUB_OUTPUT
3535
build_modified_files:
3636
needs: get_changed_files
3737
name: Build Docker images on modified files
@@ -53,13 +53,13 @@ jobs:
5353
sudo du -sh /usr/local/lib/
5454
sudo du -sh /usr/share/
5555
- name: Set up Docker Buildx
56-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
56+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
5757
- name: Check out code
5858
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5959
with:
6060
persist-credentials: false
6161
- name: Build Docker image
62-
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
62+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
6363
with:
6464
file: ${{ matrix.docker-file }}
6565
context: .

.github/workflows/tests-main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,50 @@ jobs:
1515
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1616
with:
1717
persist-credentials: false
18+
- name: Make space for cache + models
19+
# Ubuntu runner have less space free which is problematic since the model
20+
# cache + dependencies fill up the disk, leaving no space for execution.
21+
# So we remove some of the stuff we don't need (Java, .NET, etc.)
22+
#
23+
# Idea: https://dev.to/mathio/squeezing-disk-space-from-github-actions-runners-an-engineers-guide-3pjg
24+
if: matrix.os != 'windows-latest'
25+
run: |
26+
df -h
27+
28+
# Remove Java (JDKs)
29+
sudo rm -rf /usr/lib/jvm
30+
31+
# Remove .NET SDKs
32+
sudo rm -rf /usr/share/dotnet
33+
34+
# Remove Swift toolchain
35+
sudo rm -rf /usr/share/swift
36+
37+
# Remove Haskell (GHC)
38+
sudo rm -rf /usr/local/.ghcup
39+
40+
# Remove Julia
41+
sudo rm -rf /usr/local/julia*
42+
43+
# Remove Android SDKs
44+
sudo rm -rf /usr/local/lib/android
45+
46+
# Remove Chromium (optional if not using for browser tests)
47+
sudo rm -rf /usr/local/share/chromium
48+
49+
# Remove Microsoft/Edge and Google Chrome builds
50+
sudo rm -rf /opt/microsoft /opt/google
51+
52+
# Remove Azure CLI
53+
sudo rm -rf /opt/az
54+
55+
# Remove PowerShell
56+
sudo rm -rf /usr/local/share/powershell
57+
58+
# Remove CodeQL and other toolcaches
59+
sudo rm -rf /opt/hostedtoolcache
60+
61+
df -h
1862
- name: Set up Python 3.11
1963
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
2064
with:

.github/workflows/tests.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,50 @@ jobs:
4747
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4848
with:
4949
persist-credentials: false
50+
- name: Make space for cache + models
51+
# Ubuntu runner have less space free which is problematic since the model
52+
# cache + dependencies fill up the disk, leaving no space for execution.
53+
# So we remove some of the stuff we don't need (Java, .NET, etc.)
54+
#
55+
# Idea: https://dev.to/mathio/squeezing-disk-space-from-github-actions-runners-an-engineers-guide-3pjg
56+
if: matrix.os != 'windows-latest'
57+
run: |
58+
df -h
59+
60+
# Remove Java (JDKs)
61+
sudo rm -rf /usr/lib/jvm
62+
63+
# Remove .NET SDKs
64+
sudo rm -rf /usr/share/dotnet
65+
66+
# Remove Swift toolchain
67+
sudo rm -rf /usr/share/swift
68+
69+
# Remove Haskell (GHC)
70+
sudo rm -rf /usr/local/.ghcup
71+
72+
# Remove Julia
73+
sudo rm -rf /usr/local/julia*
74+
75+
# Remove Android SDKs
76+
sudo rm -rf /usr/local/lib/android
77+
78+
# Remove Chromium (optional if not using for browser tests)
79+
sudo rm -rf /usr/local/share/chromium
80+
81+
# Remove Microsoft/Edge and Google Chrome builds
82+
sudo rm -rf /opt/microsoft /opt/google
83+
84+
# Remove Azure CLI
85+
sudo rm -rf /opt/az
86+
87+
# Remove PowerShell
88+
sudo rm -rf /usr/local/share/powershell
89+
90+
# Remove CodeQL and other toolcaches
91+
sudo rm -rf /opt/hostedtoolcache
92+
93+
df -h
5094
- name: Model cache
5195
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
5296
with:
@@ -59,6 +103,7 @@ jobs:
59103
key: model-cache-${{ github.run_id }}
60104
restore-keys: model-cache-
61105
enableCrossOsArchive: true
106+
62107
- name: Dump cache content
63108
# TODO: remove this step after 2025-02-15
64109
if: matrix.os != 'windows-latest'
@@ -83,8 +128,13 @@ jobs:
83128
env:
84129
HF_TOKEN: ${{ secrets.HF_TOKEN }}
85130
TRANSFORMERS_IS_CI: 1
131+
CI: 1
86132
run: |
87133
make test
134+
# clean up all pytest temporary directories that are kept due to retention since space
135+
# is a scarce resource on the runners and tasks like model cache creation (further below)
136+
# fail if there's not enough space available.
137+
(rm -r "/tmp/pytest-of-$(id -u -n)" || true)
88138
- name: Dump cache content and diff
89139
# This is just debug info so that we can monitor if the model cache diverges substantially
90140
# over time and what the diverging model is.

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,10 @@ tests_regression:
6161

6262
tests_torch_compile:
6363
python -m pytest tests/test_torch_compile.py $(if $(IS_GITHUB_CI),--report-log "compile_tests.log",)
64+
65+
tests_training:
66+
accelerate launch --config_file tests/training/deepspeed_config.yaml tests/training/training.py $(if $(IS_GITHUB_CI),--report-log "training_deepspeed.log",)
67+
accelerate launch --config_file tests/training/deepspeed_config.yaml tests/training/training.py --quant 4bit $(if $(IS_GITHUB_CI),--report-log "training_deepspeed_4bit.log",)
68+
accelerate launch --config_file tests/training/deepspeed_config.yaml tests/training/training.py --quant 8bit $(if $(IS_GITHUB_CI),--report-log "training_deepspeed_8bit.log",)
69+
accelerate launch --config_file tests/training/fsdp_config.yaml tests/training/training.py $(if $(IS_GITHUB_CI),--report-log "training_fsdp.log",)
70+
accelerate launch --config_file tests/training/fsdp_config.yaml tests/training/training.py --quant 4bit $(if $(IS_GITHUB_CI),--report-log "training_fsdp_4bit.log",)

docker/peft-gpu/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV PYTHON_VERSION=3.11
88
# Install apt libs - copied from https://github.com/huggingface/accelerate/blob/main/docker/accelerate-gpu/Dockerfile
99
# Install audio-related libraries
1010
RUN apt-get update && \
11-
apt-get install -y curl git wget software-properties-common git-lfs ffmpeg libsndfile1-dev && \
11+
apt-get install -y curl git wget git-lfs ffmpeg libsndfile1-dev && \
1212
apt-get clean && \
1313
rm -rf /var/lib/apt/lists*
1414

@@ -26,7 +26,7 @@ RUN chsh -s /bin/bash
2626
SHELL ["/bin/bash", "-c"]
2727

2828
# Stage 2
29-
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 AS build-image
29+
FROM nvidia/cuda:12.8.1-devel-ubuntu22.04 AS build-image
3030
COPY --from=compile-image /opt/conda /opt/conda
3131
ENV PATH /opt/conda/bin:$PATH
3232

@@ -39,12 +39,12 @@ RUN apt-get update && \
3939
RUN chsh -s /bin/bash
4040
SHELL ["/bin/bash", "-c"]
4141

42-
RUN conda run -n peft pip install --no-cache-dir bitsandbytes optimum auto-gptq
42+
RUN conda run -n peft pip install --no-cache-dir bitsandbytes optimum
43+
44+
# GPTQmodel doesn't find torch without build isolation
45+
RUN conda run -n peft pip install --no-build-isolation gptqmodel
4346

4447
RUN \
45-
# Add autoawq for quantization testing
46-
conda run -n peft pip install --no-cache-dir https://github.com/casper-hansen/AutoAWQ/releases/download/v0.2.7.post2/autoawq-0.2.7.post2-py3-none-any.whl && \
47-
conda run -n peft pip install --no-cache-dir https://github.com/casper-hansen/AutoAWQ_kernels/releases/download/v0.0.9/autoawq_kernels-0.0.9-cp311-cp311-linux_x86_64.whl && \
4848
# Add eetq for quantization testing; needs to run without build isolation since the setup
4949
# script directly imports torch from the environment which would fail with isolation.
5050
conda run -n peft pip install --no-build-isolation git+https://github.com/NetEase-FuXi/EETQ.git

docs/source/_toctree.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
title: P-tuning
109109
- local: package_reference/prefix_tuning
110110
title: Prefix tuning
111+
- local: package_reference/cartridges
112+
title: Cartridges
111113
- local: package_reference/prompt_tuning
112114
title: Prompt tuning
113115
- local: package_reference/layernorm_tuning
@@ -153,5 +155,7 @@
153155
title: Hotswapping adapters
154156
- local: package_reference/functional
155157
title: Functions for PEFT integration
158+
- local: package_reference/lora_conversion
159+
title: Converting non-LoRA adapters to LoRA
156160
title: Utilities
157161
title: API reference

0 commit comments

Comments
 (0)