2020-08-07 23:17:07 +08:00
version : 2.1
orbs :
gcp-gke : circleci/gcp-gke@1.0.4
go : circleci/go@1.3.0
# TPU REFERENCES
references :
checkout_ml_testing : &checkout_ml_testing
run :
name : Checkout ml-testing-accelerators
command : |
git clone https://github.com/GoogleCloudPlatform/ml-testing-accelerators.git
cd ml-testing-accelerators
git fetch origin 5e88ac24f631c27045e62f0e8d5dfcf34e425e25:stable
git checkout stable
build_push_docker : &build_push_docker
run :
name : Configure Docker
command : |
gcloud --quiet auth configure-docker
cd docker/transformers-pytorch-tpu
2020-08-11 14:48:49 +08:00
if [ -z "$CIRCLE_PR_NUMBER" ]; then docker build --tag "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" -f Dockerfile --build-arg "TEST_IMAGE=1" . ; else docker build --tag "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" -f Dockerfile --build-arg "TEST_IMAGE=1" --build-arg "GITHUB_REF=pull/$CIRCLE_PR_NUMBER/head" . ; fi
2020-08-07 23:17:07 +08:00
docker push "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID"
deploy_cluster : &deploy_cluster
run :
name : Deploy the job on the kubernetes cluster
command : |
go get github.com/google/go-jsonnet/cmd/jsonnet && \
export PATH=$PATH:$HOME/go/bin && \
kubectl create -f docker/transformers-pytorch-tpu/dataset.yaml || true && \
job_name=$(jsonnet -J ml-testing-accelerators/ docker/transformers-pytorch-tpu/bert-base-cased.jsonnet --ext-str image=$GCR_IMAGE_PATH --ext-str image-tag=$CIRCLE_WORKFLOW_JOB_ID | kubectl create -f -) && \
job_name=${job_name#job.batch/} && \
job_name=${job_name% created} && \
echo "Waiting on kubernetes job: $job_name" && \
i=0 && \
# 30 checks spaced 30s apart = 900s total.
max_checks=30 && \
status_code=2 && \
# Check on the job periodically. Set the status code depending on what
# happened to the job in Kubernetes. If we try max_checks times and
# still the job hasn't finished, give up and return the starting
# non-zero status code.
while [ $i -lt $max_checks ]; do ((i++)); if kubectl get jobs $job_name -o jsonpath='Failed:{.status.failed}' | grep "Failed:1"; then status_code=1 && break; elif kubectl get jobs $job_name -o jsonpath='Succeeded:{.status.succeeded}' | grep "Succeeded:1" ; then status_code=0 && break; else echo "Job not finished yet"; fi; sleep 30; done && \
echo "Done waiting. Job status code: $status_code" && \
2020-08-12 23:46:24 +08:00
pod_name=$(kubectl get po -l controller-uid=`kubectl get job $job_name -o "jsonpath={.metadata.labels.controller-uid}"` | awk 'match($0,!/NAME/) {print $1}') && \
echo "GKE pod name: $pod_name" && \
kubectl logs -f $pod_name --container=train
2020-08-07 23:17:07 +08:00
echo "Done with log retrieval attempt." && \
gcloud container images delete "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" --force-delete-tags && \
exit $status_code
delete_gke_jobs : &delete_gke_jobs
run :
name : Delete GKE Jobs
command : |
# Match jobs whose age matches patterns like '1h' or '1d', i.e. any job
# that has been around longer than 1hr. First print all columns for
# matches, then execute the delete.
kubectl get job | awk 'match($4,/[0-9]+[dh]/) {print $0}'
kubectl delete job $(kubectl get job | awk 'match($4,/[0-9]+[dh]/) {print $1}')
2018-12-21 05:33:39 +08:00
jobs :
2019-12-23 01:21:35 +08:00
run_tests_torch_and_tf :
2019-09-26 16:15:53 +08:00
working_directory : ~/transformers
2019-09-24 19:25:50 +08:00
docker :
2021-11-30 18:07:55 +08:00
- image : circleci/python:3.7
2019-12-21 03:56:59 +08:00
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
RUN_PT_TF_CROSS_TESTS : yes
TRANSFORMERS_IS_CI : yes
2019-09-24 19:25:50 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
2020-08-07 14:48:59 +08:00
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-torch_and_tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2021-03-11 00:12:04 +08:00
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
2020-08-07 14:48:59 +08:00
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : pip install .[sklearn,tf-cpu,torch,testing,sentencepiece,torch-speech,vision]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2021-11-30 18:07:55 +08:00
- run : pip install tensorflow_probability
2020-08-07 14:48:59 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_torch_and_tf $(cat test_list.txt) -m is_pt_tf_cross_test --durations=0 | tee tests_output.txt
fi
2020-06-27 01:59:31 +08:00
- store_artifacts :
2020-11-04 05:57:12 +08:00
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_torch_and_tf_all :
working_directory : ~/transformers
docker :
2021-12-02 17:09:17 +08:00
- image : circleci/python:3.7
2021-08-10 20:54:52 +08:00
environment :
OMP_NUM_THREADS : 1
RUN_PT_TF_CROSS_TESTS : yes
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch_and_tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : pip install .[sklearn,tf-cpu,torch,testing,sentencepiece,torch-speech,vision]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2021-11-30 18:07:55 +08:00
- run : pip install tensorflow_probability
2021-08-10 20:54:52 +08:00
- save_cache :
key : v0.4-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_torch_and_tf tests -m is_pt_tf_cross_test --durations=0 | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-11-04 05:57:12 +08:00
2021-03-16 13:05:37 +08:00
run_tests_torch_and_flax :
working_directory : ~/transformers
docker :
- image : circleci/python:3.6
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
RUN_PT_FLAX_CROSS_TESTS : yes
TRANSFORMERS_IS_CI : yes
2021-03-16 13:05:37 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch_and_flax-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : pip install .[sklearn,flax,torch,testing,sentencepiece,torch-speech,vision]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2021-03-16 13:05:37 +08:00
- save_cache :
key : v0.4-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_torch_and_flax $(cat test_list.txt) -m is_pt_flax_cross_test --durations=0 | tee tests_output.txt
fi
2021-03-16 13:05:37 +08:00
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_torch_and_flax_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.6
environment :
OMP_NUM_THREADS : 1
RUN_PT_FLAX_CROSS_TESTS : yes
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch_and_flax-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : pip install .[sklearn,flax,torch,testing,sentencepiece,torch-speech,vision]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2021-08-10 20:54:52 +08:00
- save_cache :
key : v0.4-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_torch_and_flax tests -m is_pt_flax_cross_test --durations=0 | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-03-16 13:05:37 +08:00
2019-12-23 01:21:35 +08:00
run_tests_torch :
2019-09-26 16:15:53 +08:00
working_directory : ~/transformers
2018-12-21 05:33:39 +08:00
docker :
2019-12-23 04:35:09 +08:00
- image : circleci/python:3.7
2019-12-21 03:56:59 +08:00
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
TRANSFORMERS_IS_CI : yes
2019-09-03 00:35:14 +08:00
resource_class : xlarge
2019-08-31 08:33:16 +08:00
parallelism : 1
2018-12-21 05:33:39 +08:00
steps :
- checkout
2020-08-07 14:48:59 +08:00
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-torch-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2021-03-11 00:12:04 +08:00
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
2020-08-07 14:48:59 +08:00
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2020-08-07 14:48:59 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-torch-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 3 --dist=loadfile -s --make-reports=tests_torch $(cat test_list.txt) | tee tests_output.txt
fi
2020-06-27 01:59:31 +08:00
- store_artifacts :
2020-10-27 21:25:07 +08:00
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_torch_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2021-08-10 20:54:52 +08:00
- save_cache :
key : v0.4-torch-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -n 3 --dist=loadfile -s --make-reports=tests_torch tests | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-10-29 01:59:43 +08:00
2019-12-23 01:21:35 +08:00
run_tests_tf :
2019-09-26 16:15:53 +08:00
working_directory : ~/transformers
2019-09-05 16:23:04 +08:00
docker :
2019-12-23 04:35:09 +08:00
- image : circleci/python:3.7
2019-12-21 03:56:59 +08:00
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
TRANSFORMERS_IS_CI : yes
2019-09-05 16:23:04 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
2020-08-07 14:48:59 +08:00
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
- run : pip install --upgrade pip
2021-11-24 22:22:20 +08:00
- run : pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech,vision]
2021-11-30 18:07:55 +08:00
- run : pip install tensorflow_probability
2020-08-07 14:48:59 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-tf-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_tf $(cat test_list.txt) | tee tests_output.txt
fi
2020-06-27 01:59:31 +08:00
- store_artifacts :
2020-11-04 05:57:12 +08:00
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_tf_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
2021-11-24 22:22:20 +08:00
- run : pip install .[sklearn,tf-cpu,testing,sentencepiece,tf-speech,vision]
2021-11-30 18:07:55 +08:00
- run : pip install tensorflow_probability
2021-08-10 20:54:52 +08:00
- save_cache :
key : v0.4-tf-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_tf tests | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-11-04 05:57:12 +08:00
2020-10-19 21:55:41 +08:00
run_tests_flax :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
TRANSFORMERS_IS_CI : yes
2020-10-19 21:55:41 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-flax-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2020-10-19 21:55:41 +08:00
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : sudo pip install .[flax,testing,sentencepiece,flax-speech,vision]
2020-10-19 21:55:41 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-flax-{{ checksum "setup.py" }}
2020-10-19 21:55:41 +08:00
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_flax $(cat test_list.txt) | tee tests_output.txt
fi
2020-10-19 21:55:41 +08:00
- store_artifacts :
2020-11-04 05:57:12 +08:00
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_flax_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-flax-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
2021-08-31 17:08:22 +08:00
- run : sudo pip install .[flax,testing,sentencepiece,vision,flax-speech]
2021-08-10 20:54:52 +08:00
- save_cache :
key : v0.4-flax-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_flax tests | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-11-04 05:57:12 +08:00
2020-10-23 21:58:19 +08:00
run_tests_pipelines_torch :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
RUN_PIPELINE_TESTS : yes
TRANSFORMERS_IS_CI : yes
2020-10-23 21:58:19 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-torch-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2021-03-11 00:12:04 +08:00
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
2020-10-23 21:58:19 +08:00
- run : pip install --upgrade pip
2021-10-29 21:35:05 +08:00
- run : pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2020-10-23 21:58:19 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-torch-{{ checksum "setup.py" }}
2020-10-23 21:58:19 +08:00
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_pipelines_torch -m is_pipeline_test $(cat test_list.txt) | tee tests_output.txt
fi
2020-10-23 21:58:19 +08:00
- store_artifacts :
2020-11-04 05:57:12 +08:00
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_pipelines_torch_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
RUN_PIPELINE_TESTS : yes
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
- run : pip install --upgrade pip
2021-10-29 21:35:05 +08:00
- run : pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm]
2021-10-30 01:43:43 +08:00
- run : pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
2021-08-10 20:54:52 +08:00
- save_cache :
key : v0.4-torch-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_pipelines_torch -m is_pipeline_test tests | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-11-04 05:57:12 +08:00
2020-10-23 21:58:19 +08:00
run_tests_pipelines_tf :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
RUN_PIPELINE_TESTS : yes
TRANSFORMERS_IS_CI : yes
2020-10-23 21:58:19 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2020-10-23 21:58:19 +08:00
- run : pip install --upgrade pip
2020-11-20 05:44:20 +08:00
- run : pip install .[sklearn,tf-cpu,testing,sentencepiece]
2021-11-30 18:07:55 +08:00
- run : pip install tensorflow_probability
2020-10-23 21:58:19 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-tf-{{ checksum "setup.py" }}
2020-10-23 21:58:19 +08:00
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_pipelines_tf $(cat test_list.txt) -m is_pipeline_test | tee tests_output.txt
fi
2020-11-04 05:57:12 +08:00
- store_artifacts :
path : ~/transformers/tests_output.txt
2020-10-23 21:58:19 +08:00
- store_artifacts :
2020-11-04 05:57:12 +08:00
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_pipelines_tf_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
RUN_PIPELINE_TESTS : yes
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-tf-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
- run : pip install .[sklearn,tf-cpu,testing,sentencepiece]
2021-11-30 18:07:55 +08:00
- run : pip install tensorflow_probability
2021-08-10 20:54:52 +08:00
- save_cache :
key : v0.4-tf-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
2021-08-13 14:57:30 +08:00
python -m pytest -n 8 --dist=loadfile -rA -s --make-reports=tests_pipelines_tf tests -m is_pipeline_test | tee tests_output.txt
2021-08-10 20:54:52 +08:00
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2019-12-23 01:21:35 +08:00
run_tests_custom_tokenizers :
2019-12-11 05:43:49 +08:00
working_directory : ~/transformers
docker :
2020-11-24 00:15:02 +08:00
- image : circleci/python:3.7
2019-12-24 16:09:13 +08:00
environment :
RUN_CUSTOM_TOKENIZERS : yes
2021-03-31 21:36:07 +08:00
TRANSFORMERS_IS_CI : yes
2019-12-11 05:43:49 +08:00
steps :
- checkout
2020-08-07 14:48:59 +08:00
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-custom_tokenizers-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
- run : pip install --upgrade pip
2021-04-10 02:07:47 +08:00
- run : pip install .[ja,testing,sentencepiece,jieba]
2020-08-17 12:00:23 +08:00
- run : python -m unidic download
2020-08-07 14:48:59 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-custom_tokenizers-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : |
if [ -f test_list.txt ]; then
python -m pytest -s --make-reports=tests_custom_tokenizers ./tests/test_tokenization_bert_japanese.py | tee tests_output.txt
fi
2020-11-04 05:57:12 +08:00
- store_artifacts :
path : ~/transformers/tests_output.txt
2020-07-01 04:12:14 +08:00
- store_artifacts :
2020-11-04 05:57:12 +08:00
path : ~/transformers/reports
2019-12-23 01:21:35 +08:00
run_examples_torch :
2019-12-21 03:56:59 +08:00
working_directory : ~/transformers
docker :
2020-03-17 22:17:11 +08:00
- image : circleci/python:3.6
2019-12-21 03:56:59 +08:00
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
TRANSFORMERS_IS_CI : yes
2019-12-21 03:56:59 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
2020-08-07 14:48:59 +08:00
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-torch_examples-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2021-09-26 00:47:39 +08:00
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
2020-08-07 14:48:59 +08:00
- run : pip install --upgrade pip
2021-09-26 00:47:39 +08:00
- run : pip install .[sklearn,torch,sentencepiece,testing,torch-speech]
2021-04-21 23:11:20 +08:00
- run : pip install -r examples/pytorch/_tests_requirements.txt
2020-08-07 14:48:59 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-torch_examples-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
paths :
- '~/.cache/pip'
2021-09-17 03:13:00 +08:00
- run : python utils/tests_fetcher.py --filters examples tests | tee test_preparation.txt
2021-07-14 22:56:55 +08:00
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
2021-09-17 03:13:00 +08:00
python -m pytest -n 8 --dist=loadfile -s --make-reports=examples_torch ./examples/pytorch/ | tee tests_output.txt
2021-07-14 22:56:55 +08:00
fi
2020-06-27 01:59:31 +08:00
- store_artifacts :
2020-10-27 21:25:07 +08:00
path : ~/transformers/examples_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-09-17 03:13:00 +08:00
run_examples_torch_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.6
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch_examples-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2021-09-26 00:47:39 +08:00
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
2021-09-17 03:13:00 +08:00
- run : pip install --upgrade pip
2021-09-26 00:47:39 +08:00
- run : pip install .[sklearn,torch,sentencepiece,testing,torch-speech]
2021-09-17 03:13:00 +08:00
- run : pip install -r examples/pytorch/_tests_requirements.txt
- save_cache :
key : v0.4-torch_examples-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
TRANSFORMERS_IS_CI=1 python -m pytest -n 8 --dist=loadfile -s --make-reports=examples_torch ./examples/pytorch/ | tee examples_output.txt
- store_artifacts :
path : ~/transformers/examples_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-11-04 05:57:12 +08:00
2021-12-06 13:18:58 +08:00
run_examples_flax :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-flax_examples-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
- run : sudo pip install .[flax,testing,sentencepiece]
- run : pip install -r examples/flax/_tests_requirements.txt
- save_cache :
key : v0.4-flax_examples-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : python utils/tests_fetcher.py --filters examples tests | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 8 --dist=loadfile -s --make-reports=examples_flax ./examples/flax/ | tee tests_output.txt
fi
- store_artifacts :
path : ~/transformers/flax_examples_output.txt
- store_artifacts :
path : ~/transformers/reports
run_examples_flax_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-flax_examples-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
- run : sudo pip install .[flax,testing,sentencepiece]
- run : pip install -r examples/flax/_tests_requirements.txt
- save_cache :
key : v0.4-flax_examples-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
TRANSFORMERS_IS_CI=1 python -m pytest -n 8 --dist=loadfile -s --make-reports=examples_flax ./examples/flax/ | tee examples_output.txt
- store_artifacts :
path : ~/transformers/flax_examples_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-04-23 21:17:37 +08:00
run_tests_hub :
2020-12-08 05:38:39 +08:00
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
2021-03-31 21:36:07 +08:00
environment :
2021-04-23 21:17:37 +08:00
HUGGINGFACE_CO_STAGING : yes
2021-03-31 21:36:07 +08:00
RUN_GIT_LFS_TESTS : yes
TRANSFORMERS_IS_CI : yes
2020-12-08 05:38:39 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
2021-04-23 21:17:37 +08:00
- restore_cache :
keys :
- v0.4-hub-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2020-12-08 05:38:39 +08:00
- run : sudo apt-get install git-lfs
- run : |
git config --global user.email "ci@dummy.com"
git config --global user.name "ci"
- run : pip install --upgrade pip
2021-04-23 21:17:37 +08:00
- run : pip install .[torch,sentencepiece,testing]
- save_cache :
key : v0.4-hub-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
2021-08-10 20:54:52 +08:00
python -m pytest -sv --make-reports=tests_hub $(cat test_list.txt) -m is_staging_test | tee tests_output.txt
2021-07-14 22:56:55 +08:00
fi
2021-08-10 20:54:52 +08:00
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
run_tests_hub_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
HUGGINGFACE_CO_STAGING : yes
RUN_GIT_LFS_TESTS : yes
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-hub-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : sudo apt-get install git-lfs
- run : |
git config --global user.email "ci@dummy.com"
git config --global user.name "ci"
- run : pip install --upgrade pip
- run : pip install .[torch,sentencepiece,testing]
- save_cache :
key : v0.4-hub-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -sv --make-reports=tests_hub tests -m is_staging_test | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-12-08 05:38:39 +08:00
2021-07-08 22:54:42 +08:00
run_tests_onnxruntime :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
- run : pip install .[torch,testing,sentencepiece,onnxruntime]
- save_cache :
key : v0.4-onnx-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
2021-07-14 22:56:55 +08:00
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
2021-08-10 20:54:52 +08:00
python -m pytest -n 1 --dist=loadfile -s --make-reports=tests_onnx $(cat test_list.txt) -k onnx | tee tests_output.txt
2021-07-14 22:56:55 +08:00
fi
2021-07-08 22:54:42 +08:00
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2021-08-10 20:54:52 +08:00
run_tests_onnxruntime_all :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
- run : pip install .[torch,testing,sentencepiece,onnxruntime]
- save_cache :
key : v0.4-onnx-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : |
python -m pytest -n 1 --dist=loadfile -s --make-reports=tests_onnx tests -k onnx | tee tests_output.txt
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2019-12-21 22:49:11 +08:00
check_code_quality :
working_directory : ~/transformers
docker :
- image : circleci/python:3.6
2021-07-06 23:46:39 +08:00
resource_class : large
2021-05-04 21:53:44 +08:00
environment :
TRANSFORMERS_IS_CI : yes
2019-12-21 22:49:11 +08:00
parallelism : 1
steps :
- checkout
2020-08-07 14:48:59 +08:00
- restore_cache :
keys :
2020-10-29 01:59:43 +08:00
- v0.4-code_quality-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
- run : pip install --upgrade pip
2020-11-20 05:44:20 +08:00
- run : pip install .[all,quality]
2020-08-07 14:48:59 +08:00
- save_cache :
2020-10-29 01:59:43 +08:00
key : v0.4-code_quality-{{ checksum "setup.py" }}
2020-08-07 14:48:59 +08:00
paths :
- '~/.cache/pip'
2020-10-30 01:38:11 +08:00
- run : black --check examples tests src utils
- run : isort --check-only examples tests src utils
2021-03-20 04:17:13 +08:00
- run : python utils/custom_init_isort.py --check_only
2020-10-30 01:38:11 +08:00
- run : flake8 examples tests src utils
2020-10-27 06:26:02 +08:00
- run : python utils/style_doc.py src/transformers docs/source --max_len 119 --check_only
2020-11-04 05:57:12 +08:00
2019-12-21 03:56:59 +08:00
check_repository_consistency :
2019-12-06 04:24:57 +08:00
working_directory : ~/transformers
docker :
2020-03-17 22:17:11 +08:00
- image : circleci/python:3.6
2021-11-04 05:43:19 +08:00
resource_class : large
environment :
TRANSFORMERS_IS_CI : yes
2019-12-06 04:24:57 +08:00
parallelism : 1
steps :
- checkout
2021-11-04 05:43:19 +08:00
- restore_cache :
keys :
- v0.4-repository_consistency-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : pip install --upgrade pip
- run : pip install .[all,quality]
- save_cache :
key : v0.4-repository_consistency-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : python utils/check_copies.py
- run : python utils/check_table.py
- run : python utils/check_dummies.py
- run : python utils/check_repo.py
- run : python utils/check_inits.py
- run : make deps_table_check_updated
- run : python utils/tests_fetcher.py --sanity_check
2020-08-07 23:17:07 +08:00
2021-08-30 18:35:42 +08:00
run_tests_layoutlmv2 :
working_directory : ~/transformers
docker :
- image : circleci/python:3.7
environment :
OMP_NUM_THREADS : 1
TRANSFORMERS_IS_CI : yes
resource_class : xlarge
parallelism : 1
steps :
- checkout
- restore_cache :
keys :
- v0.4-torch-{{ checksum "setup.py" }}
- v0.4-{{ checksum "setup.py" }}
- run : sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
- run : pip install --upgrade pip
- run : pip install .[torch,testing,vision]
- run : pip install torchvision
- run : python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
- run : sudo apt install tesseract-ocr
- run : pip install pytesseract
- save_cache :
key : v0.4-torch-{{ checksum "setup.py" }}
paths :
- '~/.cache/pip'
- run : python utils/tests_fetcher.py | tee test_preparation.txt
- store_artifacts :
path : ~/transformers/test_preparation.txt
- run : |
if [ -f test_list.txt ]; then
python -m pytest -n 1 tests/*layoutlmv2* --dist=loadfile -s --make-reports=tests_layoutlmv2 --durations=100
fi
- store_artifacts :
path : ~/transformers/tests_output.txt
- store_artifacts :
path : ~/transformers/reports
2020-08-07 23:17:07 +08:00
# TPU JOBS
run_examples_tpu :
docker :
- image : circleci/python:3.6
environment :
OMP_NUM_THREADS : 1
2021-03-31 21:36:07 +08:00
TRANSFORMERS_IS_CI : yes
2020-08-07 23:17:07 +08:00
resource_class : xlarge
parallelism : 1
steps :
- checkout
- go/install
- *checkout_ml_testing
- gcp-gke/install
- gcp-gke/update-kubeconfig-with-credentials :
cluster : $GKE_CLUSTER
perform-login : true
- setup_remote_docker
- *build_push_docker
- *deploy_cluster
2020-11-04 05:57:12 +08:00
2020-08-07 23:17:07 +08:00
cleanup-gke-jobs :
docker :
- image : circleci/python:3.6
steps :
- gcp-gke/install
- gcp-gke/update-kubeconfig-with-credentials :
cluster : $GKE_CLUSTER
perform-login : true
- *delete_gke_jobs
2020-11-04 05:57:12 +08:00
2019-08-30 00:14:29 +08:00
workflow_filters : &workflow_filters
filters :
branches :
only :
2019-10-23 06:01:10 +08:00
- master
2019-02-06 07:25:12 +08:00
workflows :
2019-08-30 00:14:29 +08:00
version : 2
build_and_test :
jobs :
2019-12-21 22:49:11 +08:00
- check_code_quality
2019-12-21 03:56:59 +08:00
- check_repository_consistency
2019-12-23 01:21:35 +08:00
- run_examples_torch
2021-12-06 17:20:43 +08:00
- run_examples_flax
2019-12-23 01:21:35 +08:00
- run_tests_custom_tokenizers
- run_tests_torch_and_tf
2021-03-16 13:05:37 +08:00
- run_tests_torch_and_flax
2019-12-23 01:21:35 +08:00
- run_tests_torch
- run_tests_tf
2020-10-19 21:55:41 +08:00
- run_tests_flax
2020-10-23 21:58:19 +08:00
- run_tests_pipelines_torch
- run_tests_pipelines_tf
2021-07-08 22:54:42 +08:00
- run_tests_onnxruntime
2021-04-23 21:17:37 +08:00
- run_tests_hub
2021-08-30 18:35:42 +08:00
- run_tests_layoutlmv2
2021-08-10 20:54:52 +08:00
nightly :
triggers :
- schedule :
cron : "0 0 * * *"
filters :
branches :
only :
- master
jobs :
2021-09-17 03:13:00 +08:00
- run_examples_torch_all
2021-12-06 17:20:43 +08:00
- run_examples_flax_all
2021-08-10 20:54:52 +08:00
- run_tests_torch_and_tf_all
- run_tests_torch_and_flax_all
- run_tests_torch_all
- run_tests_tf_all
- run_tests_flax_all
- run_tests_pipelines_torch_all
- run_tests_pipelines_tf_all
- run_tests_onnxruntime_all
- run_tests_hub_all
2021-01-21 17:17:39 +08:00
# tpu_testing_jobs:
# triggers:
# - schedule:
# # Set to run at the first minute of every hour.
# cron: "0 8 * * *"
# filters:
# branches:
# only:
# - master
# jobs:
# - cleanup-gke-jobs
# - run_examples_tpu