From 8003dca3f3e666b2fd683bb4736f14ec03546bff Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 16:38:59 +0530 Subject: [PATCH 01/17] use uv for installing stuff in the workflows. --- .github/workflows/benchmark.yml | 4 +-- .github/workflows/nightly_tests.yml | 14 ++++---- .github/workflows/pr_dependency_test.yml | 6 ++-- .github/workflows/pr_flax_dependency_test.yml | 12 +++---- .github/workflows/pr_quality.yml | 4 +-- .github/workflows/pr_test_fetcher.yml | 2 +- .github/workflows/pr_test_peft_backend.yml | 10 +++--- .github/workflows/pr_tests.yml | 8 ++--- .../workflows/pr_torch_dependency_test.yml | 8 ++--- .github/workflows/push_tests.yml | 32 +++++++++---------- .github/workflows/push_tests_fast.yml | 4 +-- .github/workflows/push_tests_mps.yml | 10 +++--- 12 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a3f530d51b7b..e3574de30e27 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,8 +31,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install pandas peft + python -m uv pip install -e .[quality,test] + python -m uv pip install pandas peft - name: Environment run: | python utils/print_env.py diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index fb0ce92cb61c..dfe9ad44a57a 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -60,9 +60,9 @@ jobs: - name: Install dependencies run: | - python -m pip install -e .[quality,test] - python -m pip install -U git+https://github.com/huggingface/transformers - python -m pip install git+https://github.com/huggingface/accelerate + python -m uv pip install -e .[quality,test] + python -m uv pip install -U git+https://github.com/huggingface/transformers + python -m uv pip install git+https://github.com/huggingface/accelerate - name: Environment run: | @@ -132,10 +132,10 @@ jobs: - name: Install dependencies shell: arch -arch arm64 bash {0} run: | - ${CONDA_RUN} python -m pip install --upgrade pip - ${CONDA_RUN} python -m pip install -e .[quality,test] - ${CONDA_RUN} python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu - ${CONDA_RUN} python -m pip install git+https://github.com/huggingface/accelerate + ${CONDA_RUN} python -m pip install --upgrade pip uv + ${CONDA_RUN} python -m uv pip install -e .[quality,test] + ${CONDA_RUN} python -m uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu + ${CONDA_RUN} python -m uv pip install git+https://github.com/huggingface/accelerate - name: Environment shell: arch -arch arm64 bash {0} diff --git a/.github/workflows/pr_dependency_test.yml b/.github/workflows/pr_dependency_test.yml index 102414076d81..f2680ce6d8bf 100644 --- a/.github/workflows/pr_dependency_test.yml +++ b/.github/workflows/pr_dependency_test.yml @@ -23,9 +23,9 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -e . - pip install pytest + python -m pip install --upgrade pip uv + uv pip install -e . + uv pip install pytest - name: Check for soft dependencies run: | pytest tests/others/test_dependencies.py diff --git a/.github/workflows/pr_flax_dependency_test.yml b/.github/workflows/pr_flax_dependency_test.yml index d7d2a2d4c3d5..2f5aae3437a0 100644 --- a/.github/workflows/pr_flax_dependency_test.yml +++ b/.github/workflows/pr_flax_dependency_test.yml @@ -23,12 +23,12 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -e . - pip install "jax[cpu]>=0.2.16,!=0.3.2" - pip install "flax>=0.4.1" - pip install "jaxlib>=0.1.65" - pip install pytest + python -m pip install --upgrade pip uv + uv pip install -e . + uv pip install "jax[cpu]>=0.2.16,!=0.3.2" + uv pip install "flax>=0.4.1" + uv pip install "jaxlib>=0.1.65" + uv pip install pytest - name: Check for soft dependencies run: | pytest tests/others/test_dependencies.py diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index c1b58018fce1..b70e68aef8c6 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -23,8 +23,8 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install .[quality] + python -m pip install --upgrade pip uv + uv pip install .[quality] - name: Check quality run: | ruff check examples tests src utils scripts diff --git a/.github/workflows/pr_test_fetcher.yml b/.github/workflows/pr_test_fetcher.yml index b82f8007aa74..06b47515e272 100644 --- a/.github/workflows/pr_test_fetcher.yml +++ b/.github/workflows/pr_test_fetcher.yml @@ -33,7 +33,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] + python -m uv pip install -e .[quality,test] - name: Environment run: | python utils/print_env.py diff --git a/.github/workflows/pr_test_peft_backend.yml b/.github/workflows/pr_test_peft_backend.yml index 8cc4eb6e59a9..e8a96c563a5f 100644 --- a/.github/workflows/pr_test_peft_backend.yml +++ b/.github/workflows/pr_test_peft_backend.yml @@ -44,13 +44,13 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] + python -m uv pip install -e .[quality,test] if [ "${{ matrix.lib-versions }}" == "main" ]; then - python -m pip install -U git+https://github.com/huggingface/peft.git - python -m pip install -U git+https://github.com/huggingface/transformers.git - python -m pip install -U git+https://github.com/huggingface/accelerate.git + python -m uv pip install -U git+https://github.com/huggingface/peft.git + python -m uv pip install -U git+https://github.com/huggingface/transformers.git + python -m uv pip install -U git+https://github.com/huggingface/accelerate.git else - python -m pip install -U peft transformers accelerate + python -m uv pip install -U peft transformers accelerate fi - name: Environment diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 6693c0aa6964..09284c6c022b 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -66,8 +66,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install accelerate + python -m uv pip install -e .[quality,test] + python -m uv pip install accelerate - name: Environment run: | @@ -100,7 +100,7 @@ jobs: - name: Run example PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch_examples' }} run: | - python -m pip install peft + python -m uv pip install peft python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ --make-reports=tests_${{ matrix.config.report }} \ examples @@ -148,7 +148,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] + python -m uv pip install -e .[quality,test] - name: Environment run: | diff --git a/.github/workflows/pr_torch_dependency_test.yml b/.github/workflows/pr_torch_dependency_test.yml index 57a7a5c77c74..14a70b9a9bac 100644 --- a/.github/workflows/pr_torch_dependency_test.yml +++ b/.github/workflows/pr_torch_dependency_test.yml @@ -23,10 +23,10 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -e . - pip install torch torchvision torchaudio - pip install pytest + python -m pip install --upgrade pip uv + uv pip install -e . + uv pip install torch torchvision torchaudio + uv pip install pytest - name: Check for soft dependencies run: | pytest tests/others/test_dependencies.py diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index 312d3ec22791..b01408985edf 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -32,8 +32,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install -e .[quality,test] + python -m uv pip install git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -76,8 +76,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install -e .[quality,test] + python -m uv pip install git+https://github.com/huggingface/accelerate.git - name: Environment run: | python utils/print_env.py @@ -125,8 +125,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install -e .[quality,test] + python -m uv pip install git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -174,9 +174,9 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install git+https://github.com/huggingface/accelerate.git - python -m pip install git+https://github.com/huggingface/peft.git + python -m uv pip install -e .[quality,test] + python -m uv pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install git+https://github.com/huggingface/peft.git - name: Environment run: | @@ -224,8 +224,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install -e .[quality,test] + python -m uv pip install git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -271,8 +271,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] - python -m pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install -e .[quality,test] + python -m uv pip install git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -320,7 +320,7 @@ jobs: nvidia-smi - name: Install dependencies run: | - python -m pip install -e .[quality,test,training] + python -m uv pip install -e .[quality,test,training] - name: Environment run: | python utils/print_env.py @@ -360,7 +360,7 @@ jobs: nvidia-smi - name: Install dependencies run: | - python -m pip install -e .[quality,test,training] + python -m uv pip install -e .[quality,test,training] - name: Environment run: | python utils/print_env.py @@ -401,7 +401,7 @@ jobs: - name: Install dependencies run: | - python -m pip install -e .[quality,test,training] + python -m uv pip install -e .[quality,test,training] - name: Environment run: | diff --git a/.github/workflows/push_tests_fast.yml b/.github/workflows/push_tests_fast.yml index 2f69b00af982..bee2b0a49ad6 100644 --- a/.github/workflows/push_tests_fast.yml +++ b/.github/workflows/push_tests_fast.yml @@ -65,7 +65,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] + python -m uv pip install -e .[quality,test] - name: Environment run: | @@ -98,7 +98,7 @@ jobs: - name: Run example PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch_examples' }} run: | - python -m pip install peft + python -m uv pip install peft python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ --make-reports=tests_${{ matrix.config.report }} \ examples diff --git a/.github/workflows/push_tests_mps.yml b/.github/workflows/push_tests_mps.yml index bdea0b760b26..e3afca0808da 100644 --- a/.github/workflows/push_tests_mps.yml +++ b/.github/workflows/push_tests_mps.yml @@ -41,11 +41,11 @@ jobs: - name: Install dependencies shell: arch -arch arm64 bash {0} run: | - ${CONDA_RUN} python -m pip install --upgrade pip - ${CONDA_RUN} python -m pip install -e .[quality,test] - ${CONDA_RUN} python -m pip install torch torchvision torchaudio - ${CONDA_RUN} python -m pip install git+https://github.com/huggingface/accelerate.git - ${CONDA_RUN} python -m pip install transformers --upgrade + ${CONDA_RUN} python -m pip install --upgrade pip uv + ${CONDA_RUN} python -m uv pip install -e .[quality,test] + ${CONDA_RUN} python -m uv pip install torch torchvision torchaudio + ${CONDA_RUN} python -m uv pip install git+https://github.com/huggingface/accelerate.git + ${CONDA_RUN} python -m uv pip install transformers --upgrade - name: Environment shell: arch -arch arm64 bash {0} From fba3204805f53f96fbd8df10bd3a53089fa45535 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 17:40:32 +0530 Subject: [PATCH 02/17] fix: from source installation command when using uv. --- .github/workflows/nightly_tests.yml | 6 +++--- .github/workflows/pr_test_peft_backend.yml | 6 +++--- .github/workflows/push_tests.yml | 14 +++++++------- .github/workflows/push_tests_mps.yml | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index dfe9ad44a57a..b6287f7e520a 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -61,8 +61,8 @@ jobs: - name: Install dependencies run: | python -m uv pip install -e .[quality,test] - python -m uv pip install -U git+https://github.com/huggingface/transformers - python -m uv pip install git+https://github.com/huggingface/accelerate + python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers + python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate - name: Environment run: | @@ -135,7 +135,7 @@ jobs: ${CONDA_RUN} python -m pip install --upgrade pip uv ${CONDA_RUN} python -m uv pip install -e .[quality,test] ${CONDA_RUN} python -m uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu - ${CONDA_RUN} python -m uv pip install git+https://github.com/huggingface/accelerate + ${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate - name: Environment shell: arch -arch arm64 bash {0} diff --git a/.github/workflows/pr_test_peft_backend.yml b/.github/workflows/pr_test_peft_backend.yml index e8a96c563a5f..3aa0c9e306b3 100644 --- a/.github/workflows/pr_test_peft_backend.yml +++ b/.github/workflows/pr_test_peft_backend.yml @@ -46,9 +46,9 @@ jobs: apt-get update && apt-get install libsndfile1-dev libgl1 -y python -m uv pip install -e .[quality,test] if [ "${{ matrix.lib-versions }}" == "main" ]; then - python -m uv pip install -U git+https://github.com/huggingface/peft.git - python -m uv pip install -U git+https://github.com/huggingface/transformers.git - python -m uv pip install -U git+https://github.com/huggingface/accelerate.git + python -m uv pip install -U peft@git+https://github.com/huggingface/peft.git + python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git + python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git else python -m uv pip install -U peft transformers accelerate fi diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index b01408985edf..7230dfed8139 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -33,7 +33,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y python -m uv pip install -e .[quality,test] - python -m uv pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -77,7 +77,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y python -m uv pip install -e .[quality,test] - python -m uv pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment run: | python utils/print_env.py @@ -126,7 +126,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y python -m uv pip install -e .[quality,test] - python -m uv pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -175,8 +175,8 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y python -m uv pip install -e .[quality,test] - python -m uv pip install git+https://github.com/huggingface/accelerate.git - python -m uv pip install git+https://github.com/huggingface/peft.git + python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git + python -m uv pip install peft@git+https://github.com/huggingface/peft.git - name: Environment run: | @@ -225,7 +225,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y python -m uv pip install -e .[quality,test] - python -m uv pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -272,7 +272,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y python -m uv pip install -e .[quality,test] - python -m uv pip install git+https://github.com/huggingface/accelerate.git + python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment run: | diff --git a/.github/workflows/push_tests_mps.yml b/.github/workflows/push_tests_mps.yml index e3afca0808da..a6e6bba52a91 100644 --- a/.github/workflows/push_tests_mps.yml +++ b/.github/workflows/push_tests_mps.yml @@ -44,7 +44,7 @@ jobs: ${CONDA_RUN} python -m pip install --upgrade pip uv ${CONDA_RUN} python -m uv pip install -e .[quality,test] ${CONDA_RUN} python -m uv pip install torch torchvision torchaudio - ${CONDA_RUN} python -m uv pip install git+https://github.com/huggingface/accelerate.git + ${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git ${CONDA_RUN} python -m uv pip install transformers --upgrade - name: Environment From 322e7f27807287da2d558a6852991ffcd0ff72d0 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 17:55:21 +0530 Subject: [PATCH 03/17] fix uv venv issue --- .github/workflows/benchmark.yml | 1 + .github/workflows/nightly_tests.yml | 1 + .github/workflows/pr_dependency_test.yml | 1 + .github/workflows/pr_flax_dependency_test.yml | 1 + .github/workflows/pr_quality.yml | 6 ++++-- .github/workflows/pr_test_fetcher.yml | 1 + .github/workflows/pr_test_peft_backend.yml | 1 + .github/workflows/pr_tests.yml | 2 ++ .github/workflows/pr_torch_dependency_test.yml | 1 + .github/workflows/push_tests.yml | 9 +++++++++ .github/workflows/push_tests_fast.yml | 1 + 11 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e3574de30e27..827ae4714400 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,6 +31,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install pandas peft - name: Environment diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index b6287f7e520a..f6ad187ffe22 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -60,6 +60,7 @@ jobs: - name: Install dependencies run: | + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate diff --git a/.github/workflows/pr_dependency_test.yml b/.github/workflows/pr_dependency_test.yml index f2680ce6d8bf..670118404321 100644 --- a/.github/workflows/pr_dependency_test.yml +++ b/.github/workflows/pr_dependency_test.yml @@ -24,6 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip uv + uv venv && source .venv/bin/activate uv pip install -e . uv pip install pytest - name: Check for soft dependencies diff --git a/.github/workflows/pr_flax_dependency_test.yml b/.github/workflows/pr_flax_dependency_test.yml index 2f5aae3437a0..5730003fb255 100644 --- a/.github/workflows/pr_flax_dependency_test.yml +++ b/.github/workflows/pr_flax_dependency_test.yml @@ -24,6 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip uv + uv venv && source .venv/bin/activate uv pip install -e . uv pip install "jax[cpu]>=0.2.16,!=0.3.2" uv pip install "flax>=0.4.1" diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index b70e68aef8c6..a97f7caddfd7 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -24,6 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip uv + uv venv && source .venv/bin/activate uv pip install .[quality] - name: Check quality run: | @@ -40,8 +41,9 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install .[quality] + python -m pip install --upgrade pip uv + uv venv && source .venv/bin/activate + uv pip install .[quality] - name: Check quality run: | python utils/check_copies.py diff --git a/.github/workflows/pr_test_fetcher.yml b/.github/workflows/pr_test_fetcher.yml index 06b47515e272..ef5fd6188043 100644 --- a/.github/workflows/pr_test_fetcher.yml +++ b/.github/workflows/pr_test_fetcher.yml @@ -33,6 +33,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] - name: Environment run: | diff --git a/.github/workflows/pr_test_peft_backend.yml b/.github/workflows/pr_test_peft_backend.yml index 3aa0c9e306b3..fb3b2fc4db9e 100644 --- a/.github/workflows/pr_test_peft_backend.yml +++ b/.github/workflows/pr_test_peft_backend.yml @@ -44,6 +44,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] if [ "${{ matrix.lib-versions }}" == "main" ]; then python -m uv pip install -U peft@git+https://github.com/huggingface/peft.git diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 09284c6c022b..971427b77314 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -66,6 +66,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install accelerate @@ -148,6 +149,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] - name: Environment diff --git a/.github/workflows/pr_torch_dependency_test.yml b/.github/workflows/pr_torch_dependency_test.yml index 14a70b9a9bac..806d2ad257fc 100644 --- a/.github/workflows/pr_torch_dependency_test.yml +++ b/.github/workflows/pr_torch_dependency_test.yml @@ -24,6 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip uv + uv venv && source .venv/bin/activate uv pip install -e . uv pip install torch torchvision torchaudio uv pip install pytest diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index 7230dfed8139..c4a32b9b82b2 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -32,6 +32,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -76,6 +77,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment @@ -125,6 +127,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -174,6 +177,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git python -m uv pip install peft@git+https://github.com/huggingface/peft.git @@ -224,6 +228,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -271,6 +276,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -320,6 +326,7 @@ jobs: nvidia-smi - name: Install dependencies run: | + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test,training] - name: Environment run: | @@ -360,6 +367,7 @@ jobs: nvidia-smi - name: Install dependencies run: | + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test,training] - name: Environment run: | @@ -401,6 +409,7 @@ jobs: - name: Install dependencies run: | + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test,training] - name: Environment diff --git a/.github/workflows/push_tests_fast.yml b/.github/workflows/push_tests_fast.yml index bee2b0a49ad6..02e7cbb2a305 100644 --- a/.github/workflows/push_tests_fast.yml +++ b/.github/workflows/push_tests_fast.yml @@ -65,6 +65,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m uv pip install -e .[quality,test] - name: Environment From 360bc05a93c20948fa070aaf45fd494b7fdfe0ec Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:07:03 +0530 Subject: [PATCH 04/17] edit editable installation. --- .github/workflows/benchmark.yml | 2 +- .github/workflows/nightly_tests.yml | 4 ++-- .github/workflows/pr_quality.yml | 4 ++-- .github/workflows/pr_test_fetcher.yml | 6 +++--- .github/workflows/pr_test_peft_backend.yml | 2 +- .github/workflows/pr_tests.yml | 4 ++-- .github/workflows/push_tests.yml | 18 +++++++++--------- .github/workflows/push_tests_fast.yml | 2 +- .github/workflows/push_tests_mps.yml | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 827ae4714400..bc2d45ee904f 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -32,7 +32,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install pandas peft - name: Environment run: | diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index f6ad187ffe22..b295f39223c2 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -61,7 +61,7 @@ jobs: - name: Install dependencies run: | uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate @@ -134,7 +134,7 @@ jobs: shell: arch -arch arm64 bash {0} run: | ${CONDA_RUN} python -m pip install --upgrade pip uv - ${CONDA_RUN} python -m uv pip install -e .[quality,test] + ${CONDA_RUN} python -m uv pip install -e [quality,test] ${CONDA_RUN} python -m uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu ${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index a97f7caddfd7..3df346f052cc 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -25,7 +25,7 @@ jobs: run: | python -m pip install --upgrade pip uv uv venv && source .venv/bin/activate - uv pip install .[quality] + uv pip install [quality] - name: Check quality run: | ruff check examples tests src utils scripts @@ -43,7 +43,7 @@ jobs: run: | python -m pip install --upgrade pip uv uv venv && source .venv/bin/activate - uv pip install .[quality] + uv pip install [quality] - name: Check quality run: | python utils/check_copies.py diff --git a/.github/workflows/pr_test_fetcher.yml b/.github/workflows/pr_test_fetcher.yml index ef5fd6188043..5a54392a61be 100644 --- a/.github/workflows/pr_test_fetcher.yml +++ b/.github/workflows/pr_test_fetcher.yml @@ -34,7 +34,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] - name: Environment run: | python utils/print_env.py @@ -90,7 +90,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] + python -m pip install -e [quality,test] python -m pip install accelerate - name: Environment @@ -145,7 +145,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - python -m pip install -e .[quality,test] + python -m pip install -e [quality,test] - name: Environment run: | diff --git a/.github/workflows/pr_test_peft_backend.yml b/.github/workflows/pr_test_peft_backend.yml index fb3b2fc4db9e..5671f95c0de2 100644 --- a/.github/workflows/pr_test_peft_backend.yml +++ b/.github/workflows/pr_test_peft_backend.yml @@ -45,7 +45,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] if [ "${{ matrix.lib-versions }}" == "main" ]; then python -m uv pip install -U peft@git+https://github.com/huggingface/peft.git python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 971427b77314..6b344ce835c3 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -67,7 +67,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install accelerate - name: Environment @@ -150,7 +150,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] - name: Environment run: | diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index c4a32b9b82b2..d263216ad961 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -33,7 +33,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment @@ -78,7 +78,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment run: | @@ -128,7 +128,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment @@ -178,7 +178,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git python -m uv pip install peft@git+https://github.com/huggingface/peft.git @@ -229,7 +229,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment @@ -277,7 +277,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment @@ -327,7 +327,7 @@ jobs: - name: Install dependencies run: | uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test,training] + python -m uv pip install -e [quality,test,training] - name: Environment run: | python utils/print_env.py @@ -368,7 +368,7 @@ jobs: - name: Install dependencies run: | uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test,training] + python -m uv pip install -e [quality,test,training] - name: Environment run: | python utils/print_env.py @@ -410,7 +410,7 @@ jobs: - name: Install dependencies run: | uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test,training] + python -m uv pip install -e [quality,test,training] - name: Environment run: | diff --git a/.github/workflows/push_tests_fast.yml b/.github/workflows/push_tests_fast.yml index 02e7cbb2a305..3bed1421c66c 100644 --- a/.github/workflows/push_tests_fast.yml +++ b/.github/workflows/push_tests_fast.yml @@ -66,7 +66,7 @@ jobs: run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y uv venv && source .venv/bin/activate - python -m uv pip install -e .[quality,test] + python -m uv pip install -e [quality,test] - name: Environment run: | diff --git a/.github/workflows/push_tests_mps.yml b/.github/workflows/push_tests_mps.yml index a6e6bba52a91..9618535c64ea 100644 --- a/.github/workflows/push_tests_mps.yml +++ b/.github/workflows/push_tests_mps.yml @@ -42,7 +42,7 @@ jobs: shell: arch -arch arm64 bash {0} run: | ${CONDA_RUN} python -m pip install --upgrade pip uv - ${CONDA_RUN} python -m uv pip install -e .[quality,test] + ${CONDA_RUN} python -m uv pip install -e [quality,test] ${CONDA_RUN} python -m uv pip install torch torchvision torchaudio ${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git ${CONDA_RUN} python -m uv pip install transformers --upgrade From 92a153bffd5747eefce5b4bd4a8ff4590b071c13 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:14:00 +0530 Subject: [PATCH 05/17] fix quality installation --- .github/workflows/pr_quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index 3df346f052cc..c284430e6482 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -25,7 +25,7 @@ jobs: run: | python -m pip install --upgrade pip uv uv venv && source .venv/bin/activate - uv pip install [quality] + python -m uv pip install [quality] - name: Check quality run: | ruff check examples tests src utils scripts @@ -43,7 +43,7 @@ jobs: run: | python -m pip install --upgrade pip uv uv venv && source .venv/bin/activate - uv pip install [quality] + python -m uv pip install [quality] - name: Check quality run: | python utils/check_copies.py From 8adf7cce3c6619e0b4dd3879ea49edae150287d2 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:15:45 +0530 Subject: [PATCH 06/17] checking --- .github/workflows/pr_quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index c284430e6482..f80f582a0e26 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -23,8 +23,8 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip uv uv venv && source .venv/bin/activate + python -m pip install --upgrade pip uv python -m uv pip install [quality] - name: Check quality run: | @@ -41,8 +41,8 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m pip install --upgrade pip uv uv venv && source .venv/bin/activate + python -m pip install --upgrade pip uv python -m uv pip install [quality] - name: Check quality run: | From 9653a0e3efe91d73dbfc5d52d5cd67c8834a8094 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:19:35 +0530 Subject: [PATCH 07/17] make editable. --- .github/workflows/pr_quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index f80f582a0e26..324360a857f3 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -25,7 +25,7 @@ jobs: run: | uv venv && source .venv/bin/activate python -m pip install --upgrade pip uv - python -m uv pip install [quality] + python -m uv pip install -e [quality] - name: Check quality run: | ruff check examples tests src utils scripts @@ -43,7 +43,7 @@ jobs: run: | uv venv && source .venv/bin/activate python -m pip install --upgrade pip uv - python -m uv pip install [quality] + python -m uv pip install -e [quality] - name: Check quality run: | python utils/check_copies.py From 4ae64af205f41a024db90b39a6e2a058fd3cb29e Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:24:00 +0530 Subject: [PATCH 08/17] more check --- .github/workflows/pr_quality.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index 324360a857f3..018b28c031a9 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -23,7 +23,8 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv + export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv python -m uv pip install -e [quality] - name: Check quality @@ -41,7 +42,8 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv + export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv python -m uv pip install -e [quality] - name: Check quality From fbfc7d5d14eb722281b2424ea40d82ebbec2e2d3 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:25:48 +0530 Subject: [PATCH 09/17] check --- .github/workflows/pr_quality.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index 018b28c031a9..efe0f947dc6f 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -29,6 +29,7 @@ jobs: python -m uv pip install -e [quality] - name: Check quality run: | + python -m venv /opt/venv ruff check examples tests src utils scripts ruff format examples tests src utils scripts --check @@ -48,6 +49,7 @@ jobs: python -m uv pip install -e [quality] - name: Check quality run: | + python -m venv /opt/venv python utils/check_copies.py python utils/check_dummies.py make deps_table_check_updated From e1858ebcf0ca2b29fa77354eb623ab51a204e33f Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:27:41 +0530 Subject: [PATCH 10/17] add: export step --- .github/workflows/pr_quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index efe0f947dc6f..444683d47a4e 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -29,7 +29,7 @@ jobs: python -m uv pip install -e [quality] - name: Check quality run: | - python -m venv /opt/venv + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" ruff check examples tests src utils scripts ruff format examples tests src utils scripts --check @@ -49,7 +49,7 @@ jobs: python -m uv pip install -e [quality] - name: Check quality run: | - python -m venv /opt/venv + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/check_copies.py python utils/check_dummies.py make deps_table_check_updated From 51d8acc86f737a174cc99238750b5aa43829972f Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:36:52 +0530 Subject: [PATCH 11/17] venv handling. --- .github/workflows/nightly_tests.yml | 3 +++ .github/workflows/pr_dependency_test.yml | 2 ++ .github/workflows/pr_flax_dependency_test.yml | 3 ++- .github/workflows/pr_quality.yml | 3 +-- .github/workflows/pr_test_fetcher.yml | 6 ++++++ .github/workflows/pr_test_peft_backend.yml | 1 + .github/workflows/pr_tests.yml | 7 +++++++ .github/workflows/pr_torch_dependency_test.yml | 3 ++- .github/workflows/push_tests.yml | 2 ++ .github/workflows/push_tests_fast.yml | 5 +++++ 10 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index b295f39223c2..ea6ea7cf969b 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -74,6 +74,7 @@ jobs: env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -84,6 +85,7 @@ jobs: env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 0 \ -s -v -k "Flax" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -94,6 +96,7 @@ jobs: env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ diff --git a/.github/workflows/pr_dependency_test.yml b/.github/workflows/pr_dependency_test.yml index 670118404321..fa3a6396a02f 100644 --- a/.github/workflows/pr_dependency_test.yml +++ b/.github/workflows/pr_dependency_test.yml @@ -23,11 +23,13 @@ jobs: python-version: "3.8" - name: Install dependencies run: | + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv uv venv && source .venv/bin/activate uv pip install -e . uv pip install pytest - name: Check for soft dependencies run: | + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" pytest tests/others/test_dependencies.py \ No newline at end of file diff --git a/.github/workflows/pr_flax_dependency_test.yml b/.github/workflows/pr_flax_dependency_test.yml index 5730003fb255..75ab63f2e13e 100644 --- a/.github/workflows/pr_flax_dependency_test.yml +++ b/.github/workflows/pr_flax_dependency_test.yml @@ -23,8 +23,8 @@ jobs: python-version: "3.8" - name: Install dependencies run: | + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv - uv venv && source .venv/bin/activate uv pip install -e . uv pip install "jax[cpu]>=0.2.16,!=0.3.2" uv pip install "flax>=0.4.1" @@ -32,4 +32,5 @@ jobs: uv pip install pytest - name: Check for soft dependencies run: | + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" pytest tests/others/test_dependencies.py diff --git a/.github/workflows/pr_quality.yml b/.github/workflows/pr_quality.yml index 444683d47a4e..dea2cd87d152 100644 --- a/.github/workflows/pr_quality.yml +++ b/.github/workflows/pr_quality.yml @@ -23,8 +23,7 @@ jobs: python-version: "3.8" - name: Install dependencies run: | - python -m venv /opt/venv - export PATH="/opt/venv/bin:$PATH" + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv python -m uv pip install -e [quality] - name: Check quality diff --git a/.github/workflows/pr_test_fetcher.yml b/.github/workflows/pr_test_fetcher.yml index 5a54392a61be..e4319d3ad19b 100644 --- a/.github/workflows/pr_test_fetcher.yml +++ b/.github/workflows/pr_test_fetcher.yml @@ -90,15 +90,18 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m pip install -e [quality,test] python -m pip install accelerate - name: Environment run: | + uv venv && source .venv/bin/activate python utils/print_env.py - name: Run all selected tests on CPU run: | + uv venv && source .venv/bin/activate python -m pytest -n 2 --dist=loadfile -v --make-reports=${{ matrix.modules }}_tests_cpu ${{ fromJson(needs.setup_pr_tests.outputs.test_map)[matrix.modules] }} - name: Failure short reports @@ -145,15 +148,18 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y + uv venv && source .venv/bin/activate python -m pip install -e [quality,test] - name: Environment run: | + uv venv && source .venv/bin/activate python utils/print_env.py - name: Run Hub tests for models, schedulers, and pipelines on a staging env if: ${{ matrix.config.framework == 'hub_tests_pytorch' }} run: | + uv venv && source .venv/bin/activate HUGGINGFACE_CO_STAGING=true python -m pytest \ -m "is_staging_test" \ --make-reports=tests_${{ matrix.config.report }} \ diff --git a/.github/workflows/pr_test_peft_backend.yml b/.github/workflows/pr_test_peft_backend.yml index 5671f95c0de2..d318f011007b 100644 --- a/.github/workflows/pr_test_peft_backend.yml +++ b/.github/workflows/pr_test_peft_backend.yml @@ -60,6 +60,7 @@ jobs: - name: Run fast PyTorch LoRA CPU tests with PEFT backend run: | + uv venv && source .venv/bin/activate python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ -s -v \ --make-reports=tests_${{ matrix.config.report }} \ diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 6b344ce835c3..80714c161b55 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -72,11 +72,13 @@ jobs: - name: Environment run: | + uv venv && source .venv/bin/activate python utils/print_env.py - name: Run fast PyTorch Pipeline CPU tests if: ${{ matrix.config.framework == 'pytorch_pipelines' }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -85,6 +87,7 @@ jobs: - name: Run fast PyTorch Model Scheduler CPU tests if: ${{ matrix.config.framework == 'pytorch_models' }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx and not Dependency" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -93,6 +96,7 @@ jobs: - name: Run fast Flax TPU tests if: ${{ matrix.config.framework == 'flax' }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Flax" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -101,6 +105,7 @@ jobs: - name: Run example PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch_examples' }} run: | + uv venv && source .venv/bin/activate python -m uv pip install peft python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ --make-reports=tests_${{ matrix.config.report }} \ @@ -154,11 +159,13 @@ jobs: - name: Environment run: | + uv venv && source .venv/bin/activate python utils/print_env.py - name: Run Hub tests for models, schedulers, and pipelines on a staging env if: ${{ matrix.config.framework == 'hub_tests_pytorch' }} run: | + uv venv && source .venv/bin/activate HUGGINGFACE_CO_STAGING=true python -m pytest \ -m "is_staging_test" \ --make-reports=tests_${{ matrix.config.report }} \ diff --git a/.github/workflows/pr_torch_dependency_test.yml b/.github/workflows/pr_torch_dependency_test.yml index 806d2ad257fc..6612a2ce9595 100644 --- a/.github/workflows/pr_torch_dependency_test.yml +++ b/.github/workflows/pr_torch_dependency_test.yml @@ -23,11 +23,12 @@ jobs: python-version: "3.8" - name: Install dependencies run: | + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv - uv venv && source .venv/bin/activate uv pip install -e . uv pip install torch torchvision torchaudio uv pip install pytest - name: Check for soft dependencies run: | + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" pytest tests/others/test_dependencies.py diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index d263216ad961..e4b89eb2cde2 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -414,12 +414,14 @@ jobs: - name: Environment run: | + uv venv && source .venv/bin/activate python utils/print_env.py - name: Run example tests on GPU env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=examples_torch_cuda examples/ - name: Failure short reports diff --git a/.github/workflows/push_tests_fast.yml b/.github/workflows/push_tests_fast.yml index 3bed1421c66c..e4b14fdf0515 100644 --- a/.github/workflows/push_tests_fast.yml +++ b/.github/workflows/push_tests_fast.yml @@ -70,11 +70,13 @@ jobs: - name: Environment run: | + uv venv && source .venv/bin/activate python utils/print_env.py - name: Run fast PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch' }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -83,6 +85,7 @@ jobs: - name: Run fast Flax TPU tests if: ${{ matrix.config.framework == 'flax' }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Flax" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -91,6 +94,7 @@ jobs: - name: Run fast ONNXRuntime CPU tests if: ${{ matrix.config.framework == 'onnxruntime' }} run: | + uv venv && source .venv/bin/activate python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -99,6 +103,7 @@ jobs: - name: Run example PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch_examples' }} run: | + uv venv && source .venv/bin/activate python -m uv pip install peft python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ --make-reports=tests_${{ matrix.config.report }} \ From 98b5863766f88ce4b4af4e38fd5bdc6cde373e31 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:39:41 +0530 Subject: [PATCH 12/17] checking. --- .github/workflows/pr_flax_dependency_test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_flax_dependency_test.yml b/.github/workflows/pr_flax_dependency_test.yml index 75ab63f2e13e..ccdd7287d6bb 100644 --- a/.github/workflows/pr_flax_dependency_test.yml +++ b/.github/workflows/pr_flax_dependency_test.yml @@ -25,11 +25,11 @@ jobs: run: | python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv - uv pip install -e . - uv pip install "jax[cpu]>=0.2.16,!=0.3.2" - uv pip install "flax>=0.4.1" - uv pip install "jaxlib>=0.1.65" - uv pip install pytest + python -m uv pip install -e . + python -m uv pip install "jax[cpu]>=0.2.16,!=0.3.2" + python -m uv pip install "flax>=0.4.1" + python -m uv pip install "jaxlib>=0.1.65" + python -m uv pip install pytest - name: Check for soft dependencies run: | python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" From cb945bb0790361ceadafec102ba20dfde7180a72 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 18:41:27 +0530 Subject: [PATCH 13/17] fix: dependency workflows. --- .github/workflows/pr_dependency_test.yml | 5 ++--- .github/workflows/pr_torch_dependency_test.yml | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_dependency_test.yml b/.github/workflows/pr_dependency_test.yml index fa3a6396a02f..7712c8c59b5c 100644 --- a/.github/workflows/pr_dependency_test.yml +++ b/.github/workflows/pr_dependency_test.yml @@ -25,9 +25,8 @@ jobs: run: | python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv - uv venv && source .venv/bin/activate - uv pip install -e . - uv pip install pytest + python -m uv pip install -e . + python -m uv pip install pytest - name: Check for soft dependencies run: | python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" diff --git a/.github/workflows/pr_torch_dependency_test.yml b/.github/workflows/pr_torch_dependency_test.yml index 6612a2ce9595..b47260e98048 100644 --- a/.github/workflows/pr_torch_dependency_test.yml +++ b/.github/workflows/pr_torch_dependency_test.yml @@ -25,9 +25,9 @@ jobs: run: | python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install --upgrade pip uv - uv pip install -e . - uv pip install torch torchvision torchaudio - uv pip install pytest + python -m uv pip install -e . + python -m uv pip install torch torchvision torchaudio + python -m uv pip install pytest - name: Check for soft dependencies run: | python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" From d7663d0b980dc78a021d2bf99eafa0c71164ea50 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 19:41:45 +0530 Subject: [PATCH 14/17] peft tests. --- .github/workflows/pr_test_peft_backend.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_test_peft_backend.yml b/.github/workflows/pr_test_peft_backend.yml index d318f011007b..dd6e13ba141c 100644 --- a/.github/workflows/pr_test_peft_backend.yml +++ b/.github/workflows/pr_test_peft_backend.yml @@ -44,7 +44,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] if [ "${{ matrix.lib-versions }}" == "main" ]; then python -m uv pip install -U peft@git+https://github.com/huggingface/peft.git @@ -56,11 +56,12 @@ jobs: - name: Environment run: | + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/print_env.py - name: Run fast PyTorch LoRA CPU tests with PEFT backend run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ -s -v \ --make-reports=tests_${{ matrix.config.report }} \ From dfa56988c686997cb707ba89d169d1969e7bcff6 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Tue, 27 Feb 2024 19:53:33 +0530 Subject: [PATCH 15/17] proper way to initialize env. --- .github/workflows/benchmark.yml | 2 +- .github/workflows/nightly_tests.yml | 8 ++++---- .github/workflows/pr_test_fetcher.yml | 14 +++++++------- .github/workflows/pr_tests.yml | 18 +++++++++--------- .github/workflows/push_tests.yml | 22 +++++++++++----------- .github/workflows/push_tests_fast.yml | 12 ++++++------ 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index bc2d45ee904f..b3ec74d8c15b 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install pandas peft - name: Environment diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index ea6ea7cf969b..2019ea154224 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -60,7 +60,7 @@ jobs: - name: Install dependencies run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate @@ -74,7 +74,7 @@ jobs: env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -85,7 +85,7 @@ jobs: env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 0 \ -s -v -k "Flax" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -96,7 +96,7 @@ jobs: env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ diff --git a/.github/workflows/pr_test_fetcher.yml b/.github/workflows/pr_test_fetcher.yml index e4319d3ad19b..6a7da2cb73d0 100644 --- a/.github/workflows/pr_test_fetcher.yml +++ b/.github/workflows/pr_test_fetcher.yml @@ -33,7 +33,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] - name: Environment run: | @@ -90,18 +90,18 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install -e [quality,test] python -m pip install accelerate - name: Environment run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/print_env.py - name: Run all selected tests on CPU run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 2 --dist=loadfile -v --make-reports=${{ matrix.modules }}_tests_cpu ${{ fromJson(needs.setup_pr_tests.outputs.test_map)[matrix.modules] }} - name: Failure short reports @@ -148,18 +148,18 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pip install -e [quality,test] - name: Environment run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/print_env.py - name: Run Hub tests for models, schedulers, and pipelines on a staging env if: ${{ matrix.config.framework == 'hub_tests_pytorch' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" HUGGINGFACE_CO_STAGING=true python -m pytest \ -m "is_staging_test" \ --make-reports=tests_${{ matrix.config.report }} \ diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 80714c161b55..2a5c33c1ca78 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -66,19 +66,19 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install accelerate - name: Environment run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/print_env.py - name: Run fast PyTorch Pipeline CPU tests if: ${{ matrix.config.framework == 'pytorch_pipelines' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -87,7 +87,7 @@ jobs: - name: Run fast PyTorch Model Scheduler CPU tests if: ${{ matrix.config.framework == 'pytorch_models' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx and not Dependency" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -96,7 +96,7 @@ jobs: - name: Run fast Flax TPU tests if: ${{ matrix.config.framework == 'flax' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Flax" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -105,7 +105,7 @@ jobs: - name: Run example PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch_examples' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install peft python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ --make-reports=tests_${{ matrix.config.report }} \ @@ -154,18 +154,18 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] - name: Environment run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/print_env.py - name: Run Hub tests for models, schedulers, and pipelines on a staging env if: ${{ matrix.config.framework == 'hub_tests_pytorch' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" HUGGINGFACE_CO_STAGING=true python -m pytest \ -m "is_staging_test" \ --make-reports=tests_${{ matrix.config.report }} \ diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index e4b89eb2cde2..47e2b7363587 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -32,7 +32,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -77,7 +77,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git - name: Environment @@ -127,7 +127,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -177,7 +177,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git python -m uv pip install peft@git+https://github.com/huggingface/peft.git @@ -228,7 +228,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -276,7 +276,7 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git @@ -326,7 +326,7 @@ jobs: nvidia-smi - name: Install dependencies run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test,training] - name: Environment run: | @@ -367,7 +367,7 @@ jobs: nvidia-smi - name: Install dependencies run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test,training] - name: Environment run: | @@ -409,19 +409,19 @@ jobs: - name: Install dependencies run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test,training] - name: Environment run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/print_env.py - name: Run example tests on GPU env: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=examples_torch_cuda examples/ - name: Failure short reports diff --git a/.github/workflows/push_tests_fast.yml b/.github/workflows/push_tests_fast.yml index e4b14fdf0515..347b2be040a5 100644 --- a/.github/workflows/push_tests_fast.yml +++ b/.github/workflows/push_tests_fast.yml @@ -65,18 +65,18 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install libsndfile1-dev libgl1 -y - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install -e [quality,test] - name: Environment run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python utils/print_env.py - name: Run fast PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "not Flax and not Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -85,7 +85,7 @@ jobs: - name: Run fast Flax TPU tests if: ${{ matrix.config.framework == 'flax' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Flax" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -94,7 +94,7 @@ jobs: - name: Run fast ONNXRuntime CPU tests if: ${{ matrix.config.framework == 'onnxruntime' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ -s -v -k "Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ @@ -103,7 +103,7 @@ jobs: - name: Run example PyTorch CPU tests if: ${{ matrix.config.framework == 'pytorch_examples' }} run: | - uv venv && source .venv/bin/activate + python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH" python -m uv pip install peft python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \ --make-reports=tests_${{ matrix.config.report }} \ From 3f41b037134f8ca11b112f25175781e359e1e50b Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Thu, 29 Feb 2024 06:56:38 +0530 Subject: [PATCH 16/17] Empty-Commit From 0ee49e12190f6c757d208c885d25e58073909428 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Thu, 29 Feb 2024 07:25:21 +0530 Subject: [PATCH 17/17] Empty-Commit