-
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.
- Loading branch information
1 parent
7593823
commit 4b8844d
Showing
1,720 changed files
with
167,941 additions
and
34,323 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -67,4 +67,4 @@ def main(): | |
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
main() |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Troubleshooting | ||
|
||
This is a document explaining how to deal with various issues on github-actions self-hosted CI. The entries may include actual solutions or pointers to Issues that cover those. | ||
|
||
## GitHub Actions (self-hosted CI) | ||
|
||
* Deepspeed | ||
|
||
- if jit build hangs, clear out `rm -rf ~/.cache/torch_extensions/` reference: https://github.com/huggingface/transformers/pull/12723 |
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,80 @@ | ||
name: Add model like runner | ||
|
||
on: | ||
push: | ||
branches: | ||
- none # put main here when this is fixed | ||
#pull_request: | ||
# paths: | ||
# - "src/**" | ||
# - "tests/**" | ||
# - ".github/**" | ||
# types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
run_tests_templates_like: | ||
name: "Add new model like template tests" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt -y update && sudo apt install -y libsndfile1-dev | ||
- name: Load cached virtual environment | ||
uses: actions/cache@v4 | ||
id: cache | ||
with: | ||
path: ~/venv/ | ||
key: v4-tests_model_like-${{ hashFiles('setup.py') }} | ||
|
||
- name: Create virtual environment on cache miss | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
python -m venv ~/venv && . ~/venv/bin/activate | ||
pip install --upgrade pip!=21.3 | ||
pip install -e .[dev] | ||
- name: Check transformers location | ||
# make `transformers` available as package (required since we use `-e` flag) and check it's indeed from the repo. | ||
run: | | ||
. ~/venv/bin/activate | ||
python setup.py develop | ||
transformers_install=$(pip list -e | grep transformers) | ||
transformers_install_array=($transformers_install) | ||
transformers_loc=${transformers_install_array[-1]} | ||
transformers_repo_loc=$(pwd .) | ||
if [ "$transformers_loc" != "$transformers_repo_loc" ]; then | ||
echo "transformers is from $transformers_loc but it shoud be from $transformers_repo_loc/src." | ||
echo "A fix is required. Stop testing." | ||
exit 1 | ||
fi | ||
- name: Create model files | ||
run: | | ||
. ~/venv/bin/activate | ||
transformers-cli add-new-model-like --config_file tests/fixtures/add_distilbert_like_config.json --path_to_repo . | ||
make style | ||
make fix-copies | ||
- name: Run all PyTorch modeling test | ||
run: | | ||
. ~/venv/bin/activate | ||
python -m pytest -n 2 --dist=loadfile -s --make-reports=tests_new_models tests/bert_new/test_modeling_bert_new.py | ||
- name: Run style changes | ||
run: | | ||
. ~/venv/bin/activate | ||
make style && make quality && make repo-consistency | ||
- name: Failure short reports | ||
if: ${{ always() }} | ||
run: cat reports/tests_new_models/failures_short.txt | ||
|
||
- name: Test suite reports artifacts | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: run_all_tests_new_models_test_reports | ||
path: reports/tests_new_models |
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 @@ | ||
name: Self-hosted runner (benchmark) | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [ opened, labeled, reopened, synchronize ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
HF_HOME: /mnt/cache | ||
|
||
jobs: | ||
benchmark: | ||
name: Benchmark | ||
runs-on: | ||
group: aws-g5-4xlarge-cache | ||
if: | | ||
(github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-benchmark') )|| | ||
(github.event_name == 'push' && github.ref == 'refs/heads/main') | ||
container: | ||
image: huggingface/transformers-pytorch-gpu | ||
options: --gpus all --privileged --ipc host | ||
steps: | ||
- name: Get repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Install libpq-dev & psql | ||
run: | | ||
apt update | ||
apt install -y libpq-dev postgresql-client | ||
- name: Install benchmark script dependencies | ||
run: python3 -m pip install -r benchmark/requirements.txt | ||
|
||
- name: Reinstall transformers in edit mode (remove the one installed during docker image build) | ||
working-directory: /transformers | ||
run: python3 -m pip uninstall -y transformers && python3 -m pip install -e ".[torch]" | ||
|
||
- name: Run database init script | ||
run: | | ||
psql -f benchmark/init_db.sql | ||
env: | ||
PGDATABASE: metrics | ||
PGHOST: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGHOST }} | ||
PGUSER: transformers_benchmarks | ||
PGPASSWORD: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGPASSWORD }} | ||
|
||
- name: Run benchmark | ||
run: | | ||
git config --global --add safe.directory /__w/transformers/transformers | ||
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then | ||
commit_id=$(echo "${{ github.event.pull_request.head.sha }}") | ||
elif [ "$GITHUB_EVENT_NAME" = "push" ]; then | ||
commit_id=$GITHUB_SHA | ||
fi | ||
commit_msg=$(git show -s --format=%s | cut -c1-70) | ||
python3 benchmark/llama.py "${{ github.head_ref || github.ref_name }}" "$commit_id" "$commit_msg" | ||
env: | ||
HF_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }} | ||
PGHOST: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGHOST }} | ||
PGUSER: transformers_benchmarks | ||
PGPASSWORD: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGPASSWORD }} |
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,77 @@ | ||
name: Build pr ci-docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- push-ci-image # for now let's only build on this branch | ||
repository_dispatch: | ||
workflow_call: | ||
inputs: | ||
image_postfix: | ||
required: true | ||
type: string | ||
schedule: | ||
- cron: "6 0 * * *" | ||
|
||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
if: ${{ contains(github.event.head_commit.message, '[build-ci-image]') || contains(github.event.head_commit.message, '[push-ci-image]') && '!cancelled()' || github.event_name == 'schedule' }} | ||
|
||
strategy: | ||
matrix: | ||
file: ["quality", "consistency", "custom-tokenizers", "torch-light", "tf-light", "exotic-models", "torch-tf-light", "torch-jax-light", "jax-light", "examples-torch", "examples-tf"] | ||
continue-on-error: true | ||
|
||
steps: | ||
- | ||
name: Set tag | ||
run: | | ||
if ${{contains(github.event.head_commit.message, '[build-ci-image]')}}; then | ||
echo "TAG=huggingface/transformers-${{ matrix.file }}:dev" >> "$GITHUB_ENV" | ||
echo "setting it to DEV!" | ||
else | ||
echo "TAG=huggingface/transformers-${{ matrix.file }}" >> "$GITHUB_ENV" | ||
fi | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Check out code | ||
uses: actions/checkout@v4 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- | ||
name: Build ${{ matrix.file }}.dockerfile | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./docker | ||
build-args: | | ||
REF=${{ github.sha }} | ||
file: "./docker/${{ matrix.file }}.dockerfile" | ||
push: ${{ contains(github.event.head_commit.message, 'ci-image]') || github.event_name == 'schedule' }} | ||
tags: ${{ env.TAG }} | ||
|
||
notify: | ||
runs-on: ubuntu-22.04 | ||
if: ${{ contains(github.event.head_commit.message, '[build-ci-image]') || contains(github.event.head_commit.message, '[push-ci-image]') && '!cancelled()' || github.event_name == 'schedule' }} | ||
steps: | ||
- name: Post to Slack | ||
if: ${{ contains(github.event.head_commit.message, '[push-ci-image]') && github.event_name != 'schedule' }} | ||
uses: huggingface/hf-workflows/.github/actions/post-slack@main | ||
with: | ||
slack_channel: "#transformers-ci-circleci-images" | ||
title: 🤗 New docker images for CircleCI are pushed. | ||
status: ${{ job.status }} | ||
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} |
Oops, something went wrong.