Skip to content

Commit cc19726

Browse files
sayakpaulDN6
andauthored
[Tests] add requires peft decorator. (#11037)
* add requires peft decorator. * install peft conditionally. * conditional deps. Co-authored-by: DN6 <[email protected]> --------- Co-authored-by: DN6 <[email protected]>
1 parent be54a95 commit cc19726

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/nightly_tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,16 @@ jobs:
414414
config:
415415
- backend: "bitsandbytes"
416416
test_location: "bnb"
417+
additional_deps: ["peft"]
417418
- backend: "gguf"
418419
test_location: "gguf"
420+
additional_deps: []
419421
- backend: "torchao"
420422
test_location: "torchao"
423+
additional_deps: []
421424
- backend: "optimum_quanto"
422425
test_location: "quanto"
426+
additional_deps: []
423427
runs-on:
424428
group: aws-g6e-xlarge-plus
425429
container:
@@ -437,6 +441,9 @@ jobs:
437441
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
438442
python -m uv pip install -e [quality,test]
439443
python -m uv pip install -U ${{ matrix.config.backend }}
444+
if [ "${{ join(matrix.config.additional_deps, ' ') }}" != "" ]; then
445+
python -m uv pip install ${{ join(matrix.config.additional_deps, ' ') }}
446+
fi
440447
python -m uv pip install pytest-reportlog
441448
- name: Environment
442449
run: |

tests/quantization/bnb/test_4bit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
numpy_cosine_similarity_distance,
3434
require_accelerate,
3535
require_bitsandbytes_version_greater,
36+
require_peft_backend,
3637
require_torch,
3738
require_torch_gpu,
3839
require_transformers_version_greater,
@@ -668,6 +669,7 @@ def test_quality(self):
668669
max_diff = numpy_cosine_similarity_distance(expected_slice, out_slice)
669670
self.assertTrue(max_diff < 1e-3)
670671

672+
@require_peft_backend
671673
def test_lora_loading(self):
672674
self.pipeline_4bit.load_lora_weights(
673675
hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), adapter_name="hyper-sd"

0 commit comments

Comments
 (0)