| 1 |
# CI for specifically ensuring integrations work fine (`transformers` mainly) on GPUs |
| 2 |
# Useful tips: |
| 3 |
# - `working-directory` should be set to the root of the repo, which is cloned on the actual CI runner. |
| 4 |
# It follows the directory structure of `actions-runner/_work/{repo_name}/{repo_name}/{cloned_repo} on |
| 5 |
# prem, but in Actions setting `working-directory` looks just in the `{repo_name}` level. |
| 6 |
# - New integrations to test should have its own job, and follow a strategy method where we check both |
| 7 |
# the pypi and github versions. |
| 8 |
# - Workflow call lets this be called from `build_and_run_tests.yml` |
| 9 |
# - When using a docker container, it's recommended to set `--shm-size`, we use 16gb. |
| 10 |
name: Integration Tests (push to "main") |
| 11 |
|
| 12 |
on: |
| 13 |
workflow_call: |
| 14 |
workflow_dispatch: |
| 15 |
|
| 16 |
env: |
| 17 |
HF_HOME: ~/hf_cache |
| 18 |
|
| 19 |
defaults: |
| 20 |
run: |
| 21 |
shell: bash |
| 22 |
|
| 23 |
jobs: |
| 24 |
run-trainer-tests: |
| 25 |
container: |
| 26 |
image: huggingface/accelerate:gpu-deepspeed-nightly |
| 27 |
options: --gpus all --shm-size "16gb" |
| 28 |
runs-on: |
| 29 |
group: aws-g6-12xlarge-plus |
| 30 |
strategy: |
| 31 |
fail-fast: false |
| 32 |
matrix: |
| 33 |
cuda_visible_devices: [ |
| 34 |
"0", |
| 35 |
"0,1" |
| 36 |
] |
| 37 |
steps: |
| 38 |
- name: Install transformers |
| 39 |
run: | |
| 40 |
source activate accelerate; |
| 41 |
git clone https://github.com/huggingface/transformers --depth 1; |
| 42 |
cd transformers; |
| 43 |
pip install .[torch,deepspeed-testing]; |
| 44 |
cd ..; |
| 45 |
|
| 46 |
- name: Install accelerate |
| 47 |
run: | |
| 48 |
source activate accelerate; |
| 49 |
git clone https://github.com/huggingface/accelerate; |
| 50 |
cd accelerate; |
| 51 |
git checkout ${{ github.sha }} ; |
| 52 |
pip install -e .[testing]; |
| 53 |
pip uninstall wandb dvclive -y |
| 54 |
cd ..; |
| 55 |
|
| 56 |
- name: Show installed libraries |
| 57 |
run: | |
| 58 |
source activate accelerate; |
| 59 |
pip freeze |
| 60 |
|
| 61 |
- name: Run trainer tests |
| 62 |
working-directory: transformers/ |
| 63 |
env: |
| 64 |
CUDA_VISIBLE_DEVICES: ${{ matrix.cuda_visible_devices }} |
| 65 |
WANDB_DISABLED: true |
| 66 |
run: | |
| 67 |
source activate accelerate; |
| 68 |
pytest -sv tests/trainer |
| 69 |
|
| 70 |
run-skorch-tests: |
| 71 |
container: |
| 72 |
image: huggingface/accelerate:gpu-nightly |
| 73 |
options: --gpus all --shm-size "16gb" |
| 74 |
runs-on: |
| 75 |
group: aws-g6-12xlarge-plus |
| 76 |
strategy: |
| 77 |
fail-fast: false |
| 78 |
steps: |
| 79 |
- name: Install accelerate |
| 80 |
run: |
| 81 |
source activate accelerate; |
| 82 |
git clone https://github.com/huggingface/accelerate; |
| 83 |
cd accelerate; |
| 84 |
git checkout ${{ github.sha }}; |
| 85 |
pip install -e .[testing]; |
| 86 |
cd .. |
| 87 |
|
| 88 |
- name: Install skorch |
| 89 |
run: | |
| 90 |
source activate accelerate |
| 91 |
git clone https://github.com/skorch-dev/skorch; |
| 92 |
cd skorch; |
| 93 |
git config --global --add safe.directory '*' |
| 94 |
git checkout master && git pull |
| 95 |
pip install .[test] |
| 96 |
pip install flaky |
| 97 |
|
| 98 |
- name: Show installed libraries |
| 99 |
run: | |
| 100 |
source activate accelerate; |
| 101 |
pip freeze |
| 102 |
|
| 103 |
- name: Run skorch tests |
| 104 |
working-directory: skorch/ |
| 105 |
run: | |
| 106 |
source activate accelerate; |
| 107 |
pytest -sv -k TestAccelerate |