diff --git a/.circleci/config.yml b/.circleci/config.yml index 06c621621f6a2d..b2eb935da2dd40 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -152,7 +152,49 @@ jobs: key: v0.5-torch_and_tf-{{ checksum "setup.py" }} paths: - '~/.cache/pip' - - run: python -m pytest -n 8 --max-worker-restart=0 --dist=loadfile -rA -s --make-reports=tests_torch_and_tf $(cat test_preparation/test_list.txt) -m is_pt_tf_cross_test --durations=0 | tee tests_output.txt + - 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 --max-worker-restart=0 --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 + - store_artifacts: + path: ~/transformers/tests_output.txt + - store_artifacts: + path: ~/transformers/reports + + run_tests_torch_and_tf_all: + working_directory: ~/transformers + docker: + - image: cimg/python:3.7.12 + environment: + OMP_NUM_THREADS: 1 + RUN_PT_TF_CROSS_TESTS: yes + TRANSFORMERS_IS_CI: yes + PYTEST_TIMEOUT: 120 + resource_class: xlarge + parallelism: 1 + steps: + - checkout + - restore_cache: + keys: + - v0.5-torch_and_tf-{{ checksum "setup.py" }} + - v0.5-{{ checksum "setup.py" }} + - run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev espeak-ng git-lfs + - run: git lfs install + - run: pip install --upgrade pip + - 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.12.0+cpu.html + - run: pip install tensorflow_probability + - run: pip install https://github.com/kpu/kenlm/archive/master.zip + - run: pip install git+https://github.com/huggingface/accelerate + - save_cache: + key: v0.5-{{ checksum "setup.py" }} + paths: + - '~/.cache/pip' + - run: | + python -m pytest -n 8 --max-worker-restart=0 --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: @@ -192,7 +234,47 @@ jobs: key: v0.5-torch_and_flax-{{ checksum "setup.py" }} paths: - '~/.cache/pip' - - run: python -m pytest -n 8 --max-worker-restart=0 --dist=loadfile -rA -s --make-reports=tests_torch_and_flax $(cat test_preparation/test_list.txt) -m is_pt_flax_cross_test --durations=0 | tee tests_output.txt + - 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 --max-worker-restart=0 --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 + - store_artifacts: + path: ~/transformers/tests_output.txt + - store_artifacts: + path: ~/transformers/reports + + run_tests_torch_and_flax_all: + working_directory: ~/transformers + docker: + - image: cimg/python:3.7.12 + environment: + OMP_NUM_THREADS: 1 + RUN_PT_FLAX_CROSS_TESTS: yes + TRANSFORMERS_IS_CI: yes + PYTEST_TIMEOUT: 120 + resource_class: xlarge + parallelism: 1 + steps: + - checkout + - restore_cache: + keys: + - v0.5-torch_and_flax-{{ checksum "setup.py" }} + - v0.5-{{ checksum "setup.py" }} + - run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev espeak-ng + - run: pip install --upgrade pip + - run: pip install .[sklearn,flax,torch,testing,sentencepiece,torch-speech,vision] + - run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.0+cpu.html + - run: pip install https://github.com/kpu/kenlm/archive/master.zip + - run: pip install git+https://github.com/huggingface/accelerate + - save_cache: + key: v0.5-{{ checksum "setup.py" }} + paths: + - '~/.cache/pip' + - run: | + python -m pytest -n 8 --max-worker-restart=0 --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: @@ -231,7 +313,46 @@ jobs: key: v0.5-torch-{{ checksum "setup.py" }} paths: - '~/.cache/pip' - - run: python -m pytest -n 3 --max-worker-restart=0 --dist=loadfile -s --make-reports=tests_torch $(cat test_preparation/test_list.txt) | tee tests_output.txt + - 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 --max-worker-restart=0 --dist=loadfile -s --make-reports=tests_torch $(cat test_list.txt) | tee tests_output.txt + fi + - store_artifacts: + path: ~/transformers/tests_output.txt + - store_artifacts: + path: ~/transformers/reports + + run_tests_torch_all: + working_directory: ~/transformers + docker: + - image: cimg/python:3.7.12 + environment: + OMP_NUM_THREADS: 1 + TRANSFORMERS_IS_CI: yes + PYTEST_TIMEOUT: 120 + resource_class: xlarge + parallelism: 1 + steps: + - checkout + - restore_cache: + keys: + - v0.5-torch-{{ checksum "setup.py" }} + - v0.5-{{ checksum "setup.py" }} + - run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev espeak-ng + - run: pip install --upgrade pip + - run: pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm] + - run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.0+cpu.html + - run: pip install https://github.com/kpu/kenlm/archive/master.zip + - run: pip install git+https://github.com/huggingface/accelerate + - save_cache: + key: v0.5-torch-{{ checksum "setup.py" }} + paths: + - '~/.cache/pip' + - run: | + python -m pytest -n 3 --max-worker-restart=0 --dist=loadfile -s --make-reports=tests_torch tests | tee tests_output.txt - store_artifacts: path: ~/transformers/tests_output.txt - store_artifacts: @@ -345,7 +466,46 @@ jobs: key: v0.5-torch-{{ checksum "setup.py" }} paths: - '~/.cache/pip' - - run: python -m pytest -n 8 --max-worker-restart=0 --dist=loadfile -rA -s --make-reports=tests_pipelines_torch -m is_pipeline_test $(cat test_preparation/test_list.txt) | tee tests_output.txt + - 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 --max-worker-restart=0 --dist=loadfile -rA -s --make-reports=tests_pipelines_torch -m is_pipeline_test $(cat test_list.txt) | tee tests_output.txt + fi + - store_artifacts: + path: ~/transformers/tests_output.txt + - store_artifacts: + path: ~/transformers/reports + + run_tests_pipelines_torch_all: + working_directory: ~/transformers + docker: + - image: cimg/python:3.7.12 + environment: + OMP_NUM_THREADS: 1 + RUN_PIPELINE_TESTS: yes + TRANSFORMERS_IS_CI: yes + PYTEST_TIMEOUT: 120 + resource_class: xlarge + parallelism: 1 + steps: + - checkout + - restore_cache: + keys: + - v0.5-torch-{{ checksum "setup.py" }} + - v0.5-{{ checksum "setup.py" }} + - run: sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev espeak-ng + - run: pip install --upgrade pip + - run: pip install .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm] + - run: pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.0+cpu.html + - run: pip install https://github.com/kpu/kenlm/archive/master.zip + - save_cache: + key: v0.5-torch-{{ checksum "setup.py" }} + paths: + - '~/.cache/pip' + - run: | + python -m pytest -n 8 --max-worker-restart=0 --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: diff --git a/setup.py b/setup.py index a0ff98c9273cb8..14ad0ea8c55bbf 100644 --- a/setup.py +++ b/setup.py @@ -161,8 +161,8 @@ "tf2onnx", "timeout-decorator", "timm", - "tokenizers>=0.11.1,!=0.11.3,<0.14", - "torch>=1.7,!=1.12.0", + "tokenizers>=0.11.1,!=0.11.3,<0.13", + "torch>=1.0,!=0.12.0", "torchaudio", "pyctcdecode>=0.3.0", "tqdm>=4.27", diff --git a/src/transformers/dependency_versions_table.py b/src/transformers/dependency_versions_table.py index 89522d9c6ac4ad..c0084cbac47c00 100644 --- a/src/transformers/dependency_versions_table.py +++ b/src/transformers/dependency_versions_table.py @@ -67,8 +67,8 @@ "tf2onnx": "tf2onnx", "timeout-decorator": "timeout-decorator", "timm": "timm", - "tokenizers": "tokenizers>=0.11.1,!=0.11.3,<0.14", - "torch": "torch>=1.7,!=1.12.0", + "tokenizers": "tokenizers>=0.11.1,!=0.11.3,<0.13", + "torch": "torch>=1.0,!=0.12.0", "torchaudio": "torchaudio", "pyctcdecode": "pyctcdecode>=0.3.0", "tqdm": "tqdm>=4.27",