peft
/
Makefile
55 строк · 2.4 Кб
1.PHONY: quality style test docs
2
3check_dirs := src tests examples docs scripts docker
4
5# Check that source code meets quality standards
6
7# this target runs checks on all files
8quality:
9ruff $(check_dirs)
10ruff format --check $(check_dirs)
11doc-builder style src/peft tests docs/source --max_len 119 --check_only
12
13# Format source code automatically and check is there are any problems left that need manual fixing
14style:
15ruff $(check_dirs) --fix
16ruff format $(check_dirs)
17doc-builder style src/peft tests docs/source --max_len 119
18
19test:
20python -m pytest -n 3 tests/ $(if $(IS_GITHUB_CI),--report-log "ci_tests.log",)
21
22tests_examples_multi_gpu:
23python -m pytest -m multi_gpu_tests tests/test_gpu_examples.py $(if $(IS_GITHUB_CI),--report-log "multi_gpu_examples.log",)
24
25tests_examples_single_gpu:
26python -m pytest -m single_gpu_tests tests/test_gpu_examples.py $(if $(IS_GITHUB_CI),--report-log "single_gpu_examples.log",)
27
28tests_core_multi_gpu:
29python -m pytest -m multi_gpu_tests tests/test_common_gpu.py $(if $(IS_GITHUB_CI),--report-log "core_multi_gpu.log",)
30
31tests_core_single_gpu:
32python -m pytest -m single_gpu_tests tests/test_common_gpu.py $(if $(IS_GITHUB_CI),--report-log "core_single_gpu.log",)
33
34tests_common_gpu:
35python -m pytest tests/test_decoder_models.py $(if $(IS_GITHUB_CI),--report-log "common_decoder.log",)
36python -m pytest tests/test_encoder_decoder_models.py $(if $(IS_GITHUB_CI),--report-log "common_encoder_decoder.log",)
37
38tests_examples_multi_gpu_bnb:
39python -m pytest -m "multi_gpu_tests and bitsandbytes" tests/test_gpu_examples.py $(if $(IS_GITHUB_CI),--report-log "multi_gpu_examples.log",)
40
41tests_examples_single_gpu_bnb:
42python -m pytest -m "single_gpu_tests and bitsandbytes" tests/test_gpu_examples.py $(if $(IS_GITHUB_CI),--report-log "single_gpu_examples.log",)
43
44tests_core_multi_gpu_bnb:
45python -m pytest -m "multi_gpu_tests and bitsandbytes" tests/test_common_gpu.py $(if $(IS_GITHUB_CI),--report-log "core_multi_gpu.log",)
46
47tests_core_single_gpu_bnb:
48python -m pytest -m "single_gpu_tests and bitsandbytes" tests/test_common_gpu.py $(if $(IS_GITHUB_CI),--report-log "core_single_gpu.log",)
49
50# For testing transformers tests for bnb runners
51transformers_tests:
52RUN_SLOW=1 python -m pytest transformers-clone/tests/quantization/bnb $(if $(IS_GITHUB_CI),--report-log "transformers_tests.log",)
53
54tests_regression:
55python -m pytest -s --regression tests/regression/ $(if $(IS_GITHUB_CI),--report-log "regression_tests.log",)
56