mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 11:11:05 +06:00
[Testing] Add Flax Tests on GPU, Add Speech and Vision to Flax & TF tests (#13313)
* up * finish * Apply suggestions from code review * apply Lysandres suggestions * adapt circle ci as well * finish * Update setup.py
This commit is contained in:
parent
8b2de0e483
commit
062300ba7f
@ -80,7 +80,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,tf-cpu,torch,testing,sentencepiece,speech,vision]
|
- run: pip install .[sklearn,tf-cpu,torch,testing,sentencepiece,torch-speech,vision]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-{{ checksum "setup.py" }}
|
key: v0.4-{{ checksum "setup.py" }}
|
||||||
@ -116,7 +116,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,tf-cpu,torch,testing,sentencepiece,speech,vision]
|
- run: pip install .[sklearn,tf-cpu,torch,testing,sentencepiece,torch-speech,vision]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-{{ checksum "setup.py" }}
|
key: v0.4-{{ checksum "setup.py" }}
|
||||||
@ -147,7 +147,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,flax,torch,testing,sentencepiece,speech,vision]
|
- run: pip install .[sklearn,flax,torch,testing,sentencepiece,torch-speech,vision]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-{{ checksum "setup.py" }}
|
key: v0.4-{{ checksum "setup.py" }}
|
||||||
@ -183,7 +183,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,flax,torch,testing,sentencepiece,speech,vision]
|
- run: pip install .[sklearn,flax,torch,testing,sentencepiece,torch-speech,vision]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-{{ checksum "setup.py" }}
|
key: v0.4-{{ checksum "setup.py" }}
|
||||||
@ -213,7 +213,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,torch,testing,sentencepiece,speech,vision,timm]
|
- run: pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-torch-{{ checksum "setup.py" }}
|
key: v0.4-torch-{{ checksum "setup.py" }}
|
||||||
@ -248,7 +248,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,torch,testing,sentencepiece,speech,vision,timm]
|
- run: pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-torch-{{ checksum "setup.py" }}
|
key: v0.4-torch-{{ checksum "setup.py" }}
|
||||||
@ -277,7 +277,7 @@ jobs:
|
|||||||
- v0.4-tf-{{ checksum "setup.py" }}
|
- v0.4-tf-{{ checksum "setup.py" }}
|
||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece]
|
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech]
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-tf-{{ checksum "setup.py" }}
|
key: v0.4-tf-{{ checksum "setup.py" }}
|
||||||
paths:
|
paths:
|
||||||
@ -310,7 +310,7 @@ jobs:
|
|||||||
- v0.4-tf-{{ checksum "setup.py" }}
|
- v0.4-tf-{{ checksum "setup.py" }}
|
||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece]
|
- run: pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech]
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-tf-{{ checksum "setup.py" }}
|
key: v0.4-tf-{{ checksum "setup.py" }}
|
||||||
paths:
|
paths:
|
||||||
@ -338,7 +338,7 @@ jobs:
|
|||||||
- v0.4-flax-{{ checksum "setup.py" }}
|
- v0.4-flax-{{ checksum "setup.py" }}
|
||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: sudo pip install .[flax,testing,sentencepiece]
|
- run: sudo pip install .[flax,testing,sentencepiece,flax-speech,vision]
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-flax-{{ checksum "setup.py" }}
|
key: v0.4-flax-{{ checksum "setup.py" }}
|
||||||
paths:
|
paths:
|
||||||
@ -371,7 +371,7 @@ jobs:
|
|||||||
- v0.4-flax-{{ checksum "setup.py" }}
|
- v0.4-flax-{{ checksum "setup.py" }}
|
||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: sudo pip install .[flax,testing,sentencepiece]
|
- run: sudo pip install .[flax,testing,sentencepiece,vision,flax-speech]
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-flax-{{ checksum "setup.py" }}
|
key: v0.4-flax-{{ checksum "setup.py" }}
|
||||||
paths:
|
paths:
|
||||||
@ -401,7 +401,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,torch,testing,sentencepiece,speech,vision]
|
- run: pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-torch-{{ checksum "setup.py" }}
|
key: v0.4-torch-{{ checksum "setup.py" }}
|
||||||
@ -437,7 +437,7 @@ jobs:
|
|||||||
- v0.4-{{ checksum "setup.py" }}
|
- v0.4-{{ checksum "setup.py" }}
|
||||||
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
- run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
|
||||||
- run: pip install --upgrade pip
|
- run: pip install --upgrade pip
|
||||||
- run: pip install .[sklearn,torch,testing,sentencepiece,speech,vision]
|
- run: pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision]
|
||||||
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
- run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cpu.html
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v0.4-torch-{{ checksum "setup.py" }}
|
key: v0.4-torch-{{ checksum "setup.py" }}
|
||||||
|
118
.github/workflows/self-push.yml
vendored
118
.github/workflows/self-push.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
|||||||
apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
||||||
apt install -y libsndfile1-dev
|
apt install -y libsndfile1-dev
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install .[sklearn,testing,onnxruntime,sentencepiece,speech,vision,timm]
|
pip install .[sklearn,testing,onnxruntime,sentencepiece,torch-speech,vision,timm]
|
||||||
|
|
||||||
- name: Launcher docker
|
- name: Launcher docker
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -78,6 +78,61 @@ jobs:
|
|||||||
name: run_all_tests_torch_gpu_test_reports
|
name: run_all_tests_torch_gpu_test_reports
|
||||||
path: reports
|
path: reports
|
||||||
|
|
||||||
|
run_tests_flax_gpu:
|
||||||
|
runs-on: [self-hosted, docker-gpu, single-gpu]
|
||||||
|
container:
|
||||||
|
image: tensorflow/tensorflow:2.4.1-gpu
|
||||||
|
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
||||||
|
pip install --upgrade "jax[cuda111]" -f https://storage.googleapis.com/jax-releases/jax_releases.html
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install .[sklearn,testing,sentencepiece,flax,flax-speech,vision]
|
||||||
|
|
||||||
|
- name: Launcher docker
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: NVIDIA-SMI
|
||||||
|
run: |
|
||||||
|
nvidia-smi
|
||||||
|
|
||||||
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
|
run: |
|
||||||
|
python -c "from jax.lib import xla_bridge; print('GPU available:', xla_bridge.get_backend().platform)"
|
||||||
|
python -c "import jax; print('Number of GPUs available:', len(jax.local_devices()))"
|
||||||
|
|
||||||
|
# - name: Fetch the tests to run
|
||||||
|
# run: |
|
||||||
|
# python utils/tests_fetcher.py --diff_with_last_commit | tee test_preparation.txt
|
||||||
|
|
||||||
|
- name: Report fetched tests
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: test_fetched
|
||||||
|
path: test_preparation.txt
|
||||||
|
|
||||||
|
- name: Run all non-slow tests on GPU
|
||||||
|
run: |
|
||||||
|
python -m pytest -n 2 --dist=loadfile -v --make-reports=tests_flax_gpu
|
||||||
|
# if [ -f test_list.txt ]; then
|
||||||
|
# python -m pytest -n 2 --dist=loadfile -v --make-reports=tests_flax_gpu $(cat test_list.txt)
|
||||||
|
# fi
|
||||||
|
|
||||||
|
- name: Failure short reports
|
||||||
|
if: ${{ failure() }}
|
||||||
|
run: cat reports/tests_flax_gpu_failures_short.txt
|
||||||
|
|
||||||
|
- name: Test suite reports artifacts
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: run_all_tests_flax_gpu_test_reports
|
||||||
|
path: reports
|
||||||
|
|
||||||
# run_tests_tf_gpu:
|
# run_tests_tf_gpu:
|
||||||
# runs-on: [self-hosted, docker-gpu, single-gpu]
|
# runs-on: [self-hosted, docker-gpu, single-gpu]
|
||||||
# timeout-minutes: 120
|
# timeout-minutes: 120
|
||||||
@ -89,7 +144,7 @@ jobs:
|
|||||||
# run: |
|
# run: |
|
||||||
# apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
# apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
||||||
# pip install --upgrade pip
|
# pip install --upgrade pip
|
||||||
# pip install .[sklearn,testing,onnxruntime,sentencepiece]
|
# pip install .[sklearn,testing,onnxruntime,sentencepiece,tf-speech]
|
||||||
#
|
#
|
||||||
# - name: Launcher docker
|
# - name: Launcher docker
|
||||||
# uses: actions/checkout@v2
|
# uses: actions/checkout@v2
|
||||||
@ -147,7 +202,7 @@ jobs:
|
|||||||
apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
||||||
apt install -y libsndfile1-dev
|
apt install -y libsndfile1-dev
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install .[sklearn,testing,onnxruntime,sentencepiece,speech,vision,timm]
|
pip install .[sklearn,testing,onnxruntime,sentencepiece,torch-speech,vision,timm]
|
||||||
|
|
||||||
- name: Launcher docker
|
- name: Launcher docker
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -195,6 +250,61 @@ jobs:
|
|||||||
name: run_all_tests_torch_multi_gpu_test_reports
|
name: run_all_tests_torch_multi_gpu_test_reports
|
||||||
path: reports
|
path: reports
|
||||||
|
|
||||||
|
run_tests_flax_multi_gpu:
|
||||||
|
runs-on: [self-hosted, docker-gpu, multi-gpu]
|
||||||
|
container:
|
||||||
|
image: tensorflow/tensorflow:2.4.1-gpu
|
||||||
|
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
||||||
|
pip install --upgrade "jax[cuda111]" -f https://storage.googleapis.com/jax-releases/jax_releases.html
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install .[sklearn,testing,sentencepiece,flax,flax-speech,vision]
|
||||||
|
|
||||||
|
- name: Launcher docker
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: NVIDIA-SMI
|
||||||
|
run: |
|
||||||
|
nvidia-smi
|
||||||
|
|
||||||
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
|
run: |
|
||||||
|
python -c "from jax.lib import xla_bridge; print('GPU available:', xla_bridge.get_backend().platform)"
|
||||||
|
python -c "import jax; print('Number of GPUs available:', len(jax.local_devices()))"
|
||||||
|
|
||||||
|
# - name: Fetch the tests to run
|
||||||
|
# run: |
|
||||||
|
# python utils/tests_fetcher.py --diff_with_last_commit | tee test_preparation.txt
|
||||||
|
|
||||||
|
- name: Report fetched tests
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: test_fetched
|
||||||
|
path: test_preparation.txt
|
||||||
|
|
||||||
|
- name: Run all non-slow tests on GPU
|
||||||
|
run: |
|
||||||
|
python -m pytest -n 2 --dist=loadfile -v --make-reports=tests_flax_multi_gpu
|
||||||
|
# if [ -f test_list.txt ]; then
|
||||||
|
# python -m pytest -n 2 --dist=loadfile -v --make-reports=tests_flax_multi_gpu $(cat test_list.txt)
|
||||||
|
# fi
|
||||||
|
|
||||||
|
- name: Failure short reports
|
||||||
|
if: ${{ failure() }}
|
||||||
|
run: cat reports/tests_flax_multi_gpu_failures_short.txt
|
||||||
|
|
||||||
|
- name: Test suite reports artifacts
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: run_all_tests_flax_multi_gpu_test_reports
|
||||||
|
path: reports
|
||||||
|
|
||||||
# run_tests_tf_multi_gpu:
|
# run_tests_tf_multi_gpu:
|
||||||
# runs-on: [self-hosted, docker-gpu, multi-gpu]
|
# runs-on: [self-hosted, docker-gpu, multi-gpu]
|
||||||
# timeout-minutes: 120
|
# timeout-minutes: 120
|
||||||
@ -206,7 +316,7 @@ jobs:
|
|||||||
# run: |
|
# run: |
|
||||||
# apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
# apt -y update && apt install -y software-properties-common && apt -y update && add-apt-repository -y ppa:git-core/ppa && apt -y update && apt install -y git
|
||||||
# pip install --upgrade pip
|
# pip install --upgrade pip
|
||||||
# pip install .[sklearn,testing,onnxruntime,sentencepiece]
|
# pip install .[sklearn,testing,onnxruntime,sentencepiece,tf-speech]
|
||||||
#
|
#
|
||||||
# - name: Launcher docker
|
# - name: Launcher docker
|
||||||
# uses: actions/checkout@v2
|
# uses: actions/checkout@v2
|
||||||
|
86
.github/workflows/self-scheduled.yml
vendored
86
.github/workflows/self-scheduled.yml
vendored
@ -34,7 +34,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
apt -y update && apt install -y libsndfile1-dev git
|
apt -y update && apt install -y libsndfile1-dev git
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install .[integrations,sklearn,testing,onnxruntime,sentencepiece,speech,vision,timm]
|
pip install .[integrations,sklearn,testing,onnxruntime,sentencepiece,torch-speech,vision,timm]
|
||||||
|
|
||||||
- name: Are GPUs recognized by our DL frameworks
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
run: |
|
run: |
|
||||||
@ -85,6 +85,45 @@ jobs:
|
|||||||
name: run_all_tests_torch_gpu_test_reports
|
name: run_all_tests_torch_gpu_test_reports
|
||||||
path: reports
|
path: reports
|
||||||
|
|
||||||
|
run_all_tests_flax_gpu:
|
||||||
|
runs-on: [self-hosted, docker-gpu, single-gpu]
|
||||||
|
container:
|
||||||
|
image: tensorflow/tensorflow:2.4.1-gpu
|
||||||
|
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
|
||||||
|
steps:
|
||||||
|
- name: Launcher docker
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: NVIDIA-SMI
|
||||||
|
run: |
|
||||||
|
nvidia-smi
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install --upgrade "jax[cuda111]" -f https://storage.googleapis.com/jax-releases/jax_releases.html
|
||||||
|
pip install .[flax,integrations,sklearn,testing,sentencepiece,flax-speech,vision]
|
||||||
|
|
||||||
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
|
run: |
|
||||||
|
python -c "from jax.lib import xla_bridge; print('GPU available:', xla_bridge.get_backend().platform)"
|
||||||
|
python -c "import jax; print('Number of GPUs available:', len(jax.local_devices()))"
|
||||||
|
|
||||||
|
- name: Run all tests on GPU
|
||||||
|
run: |
|
||||||
|
python -m pytest -n 1 -v --dist=loadfile --make-reports=tests_flax_gpu tests
|
||||||
|
|
||||||
|
- name: Failure short reports
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: cat reports/tests_flax_gpu_failures_short.txt
|
||||||
|
|
||||||
|
- name: Test suite reports artifacts
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: run_all_tests_flax_gpu_test_reports
|
||||||
|
path: reports
|
||||||
|
|
||||||
run_all_tests_tf_gpu:
|
run_all_tests_tf_gpu:
|
||||||
runs-on: [self-hosted, docker-gpu, single-gpu]
|
runs-on: [self-hosted, docker-gpu, single-gpu]
|
||||||
container:
|
container:
|
||||||
@ -102,7 +141,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
apt -y update && apt install -y git
|
apt -y update && apt install -y git
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install .[sklearn,testing,onnx,sentencepiece]
|
pip install .[sklearn,testing,onnx,sentencepiece,tf-speech]
|
||||||
|
|
||||||
- name: Are GPUs recognized by our DL frameworks
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
run: |
|
run: |
|
||||||
@ -158,7 +197,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
apt -y update && apt install -y libsndfile1-dev git
|
apt -y update && apt install -y libsndfile1-dev git
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install .[integrations,sklearn,testing,onnxruntime,sentencepiece,speech,vision,timm]
|
pip install .[integrations,sklearn,testing,onnxruntime,sentencepiece,torch-speech,vision,timm]
|
||||||
|
|
||||||
- name: Are GPUs recognized by our DL frameworks
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
run: |
|
run: |
|
||||||
@ -213,7 +252,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
apt -y update && apt install -y git
|
apt -y update && apt install -y git
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install .[sklearn,testing,onnx,sentencepiece]
|
pip install .[sklearn,testing,onnx,sentencepiece,tf-speech]
|
||||||
|
|
||||||
- name: Are GPUs recognized by our DL frameworks
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
run: |
|
run: |
|
||||||
@ -251,6 +290,45 @@ jobs:
|
|||||||
name: run_all_tests_tf_multi_gpu_test_reports
|
name: run_all_tests_tf_multi_gpu_test_reports
|
||||||
path: reports
|
path: reports
|
||||||
|
|
||||||
|
run_all_tests_flax_multi_gpu:
|
||||||
|
runs-on: [self-hosted, docker-gpu, multi-gpu]
|
||||||
|
container:
|
||||||
|
image: tensorflow/tensorflow:2.4.1-gpu
|
||||||
|
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
|
||||||
|
steps:
|
||||||
|
- name: Launcher docker
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: NVIDIA-SMI
|
||||||
|
run: |
|
||||||
|
nvidia-smi
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install --upgrade "jax[cuda111]" -f https://storage.googleapis.com/jax-releases/jax_releases.html
|
||||||
|
pip install .[flax,integrations,sklearn,testing,sentencepiece,flax-speech,vision]
|
||||||
|
|
||||||
|
- name: Are GPUs recognized by our DL frameworks
|
||||||
|
run: |
|
||||||
|
python -c "from jax.lib import xla_bridge; print('GPU available:', xla_bridge.get_backend().platform)"
|
||||||
|
python -c "import jax; print('Number of GPUs available:', len(jax.local_devices()))"
|
||||||
|
|
||||||
|
- name: Run all tests on GPU
|
||||||
|
run: |
|
||||||
|
python -m pytest -n 1 -v --dist=loadfile --make-reports=tests_flax_gpu tests
|
||||||
|
|
||||||
|
- name: Failure short reports
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: cat reports/tests_flax_gpu_failures_short.txt
|
||||||
|
|
||||||
|
- name: Test suite reports artifacts
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: run_all_tests_flax_gpu_test_reports
|
||||||
|
path: reports
|
||||||
|
|
||||||
run_all_tests_torch_cuda_extensions_gpu:
|
run_all_tests_torch_cuda_extensions_gpu:
|
||||||
runs-on: [self-hosted, docker-gpu, single-gpu]
|
runs-on: [self-hosted, docker-gpu, single-gpu]
|
||||||
container:
|
container:
|
||||||
|
11
setup.py
11
setup.py
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2020 The HuggingFace Team. All rights reserved.
|
# Copyright 2021 The HuggingFace Team. All rights reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@ -64,7 +64,6 @@ from pathlib import Path
|
|||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
|
|
||||||
# Remove stale transformers.egg-info directory to avoid https://github.com/pypa/pip/issues/5466
|
# Remove stale transformers.egg-info directory to avoid https://github.com/pypa/pip/issues/5466
|
||||||
stale_egg_info = Path(__file__).parent / "transformers.egg-info"
|
stale_egg_info = Path(__file__).parent / "transformers.egg-info"
|
||||||
if stale_egg_info.exists():
|
if stale_egg_info.exists():
|
||||||
@ -253,7 +252,11 @@ extras["ray"] = deps_list("ray[tune]")
|
|||||||
extras["integrations"] = extras["optuna"] + extras["ray"]
|
extras["integrations"] = extras["optuna"] + extras["ray"]
|
||||||
|
|
||||||
extras["serving"] = deps_list("pydantic", "uvicorn", "fastapi", "starlette")
|
extras["serving"] = deps_list("pydantic", "uvicorn", "fastapi", "starlette")
|
||||||
extras["speech"] = deps_list("soundfile", "torchaudio")
|
extras["audio"] = deps_list("soundfile")
|
||||||
|
extras["speech"] = deps_list("torchaudio") + extras["audio"] # `pip install ".[speech]"` is deprecated and `pip install ".[torch-speech]"` should be used instead
|
||||||
|
extras["torch-speech"] = deps_list("torchaudio") + extras["audio"]
|
||||||
|
extras["tf-speech"] = extras["audio"]
|
||||||
|
extras["flax-speech"] = extras["audio"]
|
||||||
extras["vision"] = deps_list("Pillow")
|
extras["vision"] = deps_list("Pillow")
|
||||||
extras["timm"] = deps_list("timm")
|
extras["timm"] = deps_list("timm")
|
||||||
extras["codecarbon"] = deps_list("codecarbon")
|
extras["codecarbon"] = deps_list("codecarbon")
|
||||||
@ -275,7 +278,7 @@ extras["all"] = (
|
|||||||
+ extras["flax"]
|
+ extras["flax"]
|
||||||
+ extras["sentencepiece"]
|
+ extras["sentencepiece"]
|
||||||
+ extras["tokenizers"]
|
+ extras["tokenizers"]
|
||||||
+ extras["speech"]
|
+ extras["torch-speech"]
|
||||||
+ extras["vision"]
|
+ extras["vision"]
|
||||||
+ extras["integrations"]
|
+ extras["integrations"]
|
||||||
+ extras["timm"]
|
+ extras["timm"]
|
||||||
|
Loading…
Reference in New Issue
Block a user