From 67766926fdccde50026023f5df839a6c220a0d4e Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 12 Mar 2025 08:46:09 +0530 Subject: [PATCH 1/3] add requires peft decorator. --- tests/quantization/bnb/test_4bit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/quantization/bnb/test_4bit.py b/tests/quantization/bnb/test_4bit.py index 97047717cd83..a80286fbb8dd 100644 --- a/tests/quantization/bnb/test_4bit.py +++ b/tests/quantization/bnb/test_4bit.py @@ -33,6 +33,7 @@ numpy_cosine_similarity_distance, require_accelerate, require_bitsandbytes_version_greater, + require_peft_backend, require_torch, require_torch_gpu, require_transformers_version_greater, @@ -668,6 +669,7 @@ def test_quality(self): max_diff = numpy_cosine_similarity_distance(expected_slice, out_slice) self.assertTrue(max_diff < 1e-3) + @require_peft_backend def test_lora_loading(self): self.pipeline_4bit.load_lora_weights( hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), adapter_name="hyper-sd" From fb884497d69c6521c60e742114d09fe17fea6635 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 12 Mar 2025 08:49:50 +0530 Subject: [PATCH 2/3] install peft conditionally. --- .github/workflows/nightly_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index 70dcf0a5f9cb..41a5c3aaf1f0 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -437,6 +437,9 @@ jobs: 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 ${{ matrix.config.backend }} + if [ "${{ matrix.config.backend }}" = "bitsandbytes" ]; then + python -m uv pip install peft + fi python -m uv pip install pytest-reportlog - name: Environment run: | From 6f85919dcf08fad0e13475a19e0c076ea932a146 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Fri, 14 Mar 2025 14:27:14 +0530 Subject: [PATCH 3/3] conditional deps. Co-authored-by: DN6 --- .github/workflows/nightly_tests.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index 41a5c3aaf1f0..2b39eea2fe5d 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -414,12 +414,16 @@ jobs: config: - backend: "bitsandbytes" test_location: "bnb" + additional_deps: ["peft"] - backend: "gguf" test_location: "gguf" + additional_deps: [] - backend: "torchao" test_location: "torchao" + additional_deps: [] - backend: "optimum_quanto" test_location: "quanto" + additional_deps: [] runs-on: group: aws-g6e-xlarge-plus container: @@ -437,8 +441,8 @@ jobs: 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 ${{ matrix.config.backend }} - if [ "${{ matrix.config.backend }}" = "bitsandbytes" ]; then - python -m uv pip install peft + if [ "${{ join(matrix.config.additional_deps, ' ') }}" != "" ]; then + python -m uv pip install ${{ join(matrix.config.additional_deps, ' ') }} fi python -m uv pip install pytest-reportlog - name: Environment