mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 03:31:05 +06:00
73 lines
1.8 KiB
YAML
73 lines
1.8 KiB
YAML
name: Self-hosted runner (scheduled)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- ci_*
|
|
repository_dispatch:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
|
|
jobs:
|
|
run_all_tests_torch_and_tf_gpu:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Loading cache.
|
|
uses: actions/cache@v2
|
|
id: cache
|
|
with:
|
|
path: .env
|
|
key: v0-slow_tests_tf_torch_gpu-${{ hashFiles('setup.py') }}
|
|
|
|
- name: Python version
|
|
run: |
|
|
which python
|
|
python --version
|
|
pip --version
|
|
- name: Current dir
|
|
run: pwd
|
|
- run: nvidia-smi
|
|
- name: Create new python env (on self-hosted runners we have to handle isolation ourselves)
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
python -m venv .env
|
|
source .env/bin/activate
|
|
which python
|
|
python --version
|
|
pip --version
|
|
- name: Install dependencies
|
|
run: |
|
|
source .env/bin/activate
|
|
pip install --upgrade pip
|
|
pip install torch!=1.6.0
|
|
pip install .[sklearn,testing,onnxruntime]
|
|
pip install git+https://github.com/huggingface/nlp
|
|
|
|
- name: Are GPUs recognized by our DL frameworks
|
|
run: |
|
|
source .env/bin/activate
|
|
python -c "import torch; print(torch.cuda.is_available())"
|
|
|
|
- name: Run all tests on GPU
|
|
env:
|
|
TF_FORCE_GPU_ALLOW_GROWTH: "true"
|
|
OMP_NUM_THREADS: 1
|
|
RUN_SLOW: yes
|
|
USE_CUDA: yes
|
|
run: |
|
|
source .env/bin/activate
|
|
python -m pytest -n 1 --dist=loadfile -s ./tests/
|
|
|
|
- name: Run examples tests on GPU
|
|
env:
|
|
TF_FORCE_GPU_ALLOW_GROWTH: "true"
|
|
OMP_NUM_THREADS: 1
|
|
RUN_SLOW: yes
|
|
USE_CUDA: yes
|
|
run: |
|
|
source .env/bin/activate
|
|
pip install -r examples/requirements.txt
|
|
python -m pytest -n 1 --dist=loadfile -s examples
|