forked from huggingface/peft
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into main
- Loading branch information
Showing
20 changed files
with
511 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ jobs: | |
tags: huggingface/peft-cpu | ||
|
||
- name: Post to a Slack channel | ||
if: always() | ||
id: slack | ||
#uses: slackapi/[email protected] | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 | ||
|
@@ -102,6 +103,7 @@ jobs: | |
tags: huggingface/peft-gpu | ||
|
||
- name: Post to a Slack channel | ||
if: always() | ||
id: slack | ||
#uses: slackapi/[email protected] | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 | ||
|
@@ -159,6 +161,7 @@ jobs: | |
|
||
|
||
- name: Post to a Slack channel | ||
if: always() | ||
id: slack | ||
#uses: slackapi/[email protected] | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 | ||
|
@@ -216,6 +219,64 @@ jobs: | |
tags: huggingface/peft-gpu-bnb-latest | ||
|
||
- name: Post to a Slack channel | ||
if: always() | ||
id: slack | ||
#uses: slackapi/[email protected] | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 | ||
with: | ||
# Slack channel id, channel name, or user id to post message. | ||
# See also: https://api.slack.com/methods/chat.postMessage#channels | ||
channel-id: ${{ env.CI_SLACK_CHANNEL }} | ||
# For posting a rich message using Block Kit | ||
payload: | | ||
{ | ||
"text": "peft-gpu + bnb-source (latest) Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "peft-gpu + bnb-source (latest) Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} | ||
|
||
latest-cuda-bnb-source-multi: | ||
name: "Latest Peft GPU + bnb (multi-backend) source [accelerate / peft / transformers source]" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cleanup disk | ||
run: | | ||
sudo ls -l /usr/local/lib/ | ||
sudo ls -l /usr/share/ | ||
sudo du -sh /usr/local/lib/ | ||
sudo du -sh /usr/share/ | ||
sudo rm -rf /usr/local/lib/android | ||
sudo rm -rf /usr/share/dotnet | ||
sudo du -sh /usr/local/lib/ | ||
sudo du -sh /usr/share/ | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and Push GPU | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./docker/peft-gpu-bnb-multi-source | ||
push: true | ||
tags: huggingface/peft-gpu-bnb-multi-source | ||
|
||
- name: Post to a Slack channel | ||
if: always() | ||
id: slack | ||
#uses: slackapi/[email protected] | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# PEFT Docker images | ||
|
||
Here we store all PEFT Docker images used in our testing infrastructure. We use python 3.8 for now on all our images. | ||
|
||
- `peft-cpu`: PEFT compiled on CPU with all other HF libraries installed on main branch | ||
- `peft-gpu`: PEFT complied for NVIDIA GPUs wih all other HF libraries installed on main branch | ||
- `peft-gpu-bnb-source`: PEFT complied for NVIDIA GPUs with `bitsandbytes` and all other HF libraries installed from main branch | ||
- `peft-gpu-bnb-latest`: PEFT complied for NVIDIA GPUs with `bitsandbytes` complied from main and all other HF libraries installed from latest PyPi | ||
- `peft-gpu-bnb-multi-source`: PEFT complied for NVIDIA GPUs with `bitsandbytes` complied from `multi-backend` branch and all other HF libraries installed from main branch | ||
|
||
`peft-gpu-bnb-source` and `peft-gpu-bnb-multi-source` are essentially the same, with the only difference being `bitsandbytes` compiled on another branch. Make sure to propagate the changes you applied on one file to the other! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Builds GPU docker image of PyTorch | ||
# Uses multi-staged approach to reduce size | ||
# Stage 1 | ||
# Use base conda image to reduce time | ||
FROM continuumio/miniconda3:latest AS compile-image | ||
# Specify py version | ||
ENV PYTHON_VERSION=3.8 | ||
# Install apt libs - copied from https://github.com/huggingface/accelerate/blob/main/docker/accelerate-gpu/Dockerfile | ||
RUN apt-get update && \ | ||
apt-get install -y curl git wget software-properties-common git-lfs && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists* | ||
|
||
# Install audio-related libraries | ||
RUN apt-get update && \ | ||
apt install -y ffmpeg | ||
|
||
RUN apt install -y libsndfile1-dev | ||
RUN git lfs install | ||
|
||
# Create our conda env - copied from https://github.com/huggingface/accelerate/blob/main/docker/accelerate-gpu/Dockerfile | ||
RUN conda create --name peft python=${PYTHON_VERSION} ipython jupyter pip | ||
RUN python3 -m pip install --no-cache-dir --upgrade pip | ||
|
||
# Below is copied from https://github.com/huggingface/accelerate/blob/main/docker/accelerate-gpu/Dockerfile | ||
# We don't install pytorch here yet since CUDA isn't available | ||
# instead we use the direct torch wheel | ||
ENV PATH /opt/conda/envs/peft/bin:$PATH | ||
# Activate our bash shell | ||
RUN chsh -s /bin/bash | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Stage 2 | ||
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 AS build-image | ||
COPY --from=compile-image /opt/conda /opt/conda | ||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
RUN chsh -s /bin/bash | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Install apt libs | ||
RUN apt-get update && \ | ||
apt-get install -y curl git wget cmake && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists* | ||
|
||
# Activate the conda env and install transformers + accelerate from source | ||
# Also clone BNB and build it from source. | ||
RUN source activate peft && \ | ||
python3 -m pip install -U --no-cache-dir \ | ||
librosa \ | ||
"soundfile>=0.12.1" \ | ||
scipy \ | ||
git+https://github.com/huggingface/transformers \ | ||
git+https://github.com/huggingface/accelerate \ | ||
peft[test]@git+https://github.com/huggingface/peft \ | ||
optimum \ | ||
auto-gptq && \ | ||
git clone https://github.com/TimDettmers/bitsandbytes && cd bitsandbytes && git checkout multi-backend-refactor && \ | ||
cmake -B . -DCOMPUTE_BACKEND=cuda -S . && \ | ||
cmake --build . && \ | ||
pip install -e . && \ | ||
pip freeze | grep bitsandbytes | ||
|
||
RUN echo "source activate peft" >> ~/.profile | ||
|
||
# Activate the virtualenv | ||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.