pytorch-lightning

Форк
0
70 строк · 2.2 Кб
1
.PHONY: test clean docs
2

3
# to imitate SLURM set only single node
4
export SLURM_LOCALID=0
5
# assume you have installed need packages
6
export SPHINX_MOCK_REQUIREMENTS=1
7
# install only Lightning Trainer packages
8
export PACKAGE_NAME=pytorch
9

10
clean:
11
	# clean all temp runs
12
	rm -rf $(shell find . -name "mlruns")
13
	rm -rf $(shell find . -name "lightning_log")
14
	rm -rf $(shell find . -name "lightning_logs")
15
	rm -rf _ckpt_*
16
	rm -rf .mypy_cache
17
	rm -rf .pytest_cache
18
	rm -rf ./docs/build
19
	rm -rf ./docs/source-fabric/api/generated
20
	rm -rf ./docs/source-pytorch/notebooks
21
	rm -rf ./docs/source-pytorch/generated
22
	rm -rf ./docs/source-pytorch/*/generated
23
	rm -rf ./docs/source-pytorch/api
24
	rm -rf ./docs/source-app/generated
25
	rm -rf ./docs/source-app/*/generated
26
	rm -rf build
27
	rm -rf dist
28
	rm -rf *.egg-info
29
	rm -rf src/*.egg-info
30
	rm -rf src/lightning_app/*/
31
	rm -rf src/lightning_fabric/*/
32
	rm -rf src/pytorch_lightning/*/
33

34
test: clean
35
	# Review the CONTRIBUTING documentation for other ways to test.
36
	pip install -e . \
37
	-r requirements/pytorch/base.txt \
38
	-r requirements/app/app.txt \
39
	-r requirements/fabric/base.txt \
40
	-r requirements/pytorch/test.txt \
41
	-r requirements/app/test.txt
42

43
	# run tests with coverage
44
	python -m coverage run --source src/lightning/pytorch -m pytest src/lightning/pytorch tests/tests_pytorch -v
45
	python -m coverage run --source src/lightning/app -m pytest tests/tests/app -v
46
	python -m coverage run --source src/lightning/fabric -m pytest src/lightning/fabric tests/tests_fabric -v
47
	python -m coverage report
48

49
docs: docs-pytorch
50

51
sphinx-theme:
52
	pip install -q awscli
53
	mkdir -p dist/
54
	aws s3 sync --no-sign-request s3://sphinx-packages/ dist/
55
	pip install lai-sphinx-theme -f dist/
56

57
docs-app: clean sphinx-theme
58
	pip install -e .[all] --quiet -r requirements/app/docs.txt
59
	cd docs/source-app && $(MAKE) html --jobs $(nproc)
60

61
docs-fabric: clean sphinx-theme
62
	pip install -e .[all] --quiet -r requirements/fabric/docs.txt
63
	cd docs/source-fabric && $(MAKE) html --jobs $(nproc)
64

65
docs-pytorch: clean sphinx-theme
66
	pip install -e .[all] --quiet -r requirements/pytorch/docs.txt -r _notebooks/.actions/requires.txt
67
	cd docs/source-pytorch && $(MAKE) html --jobs $(nproc)
68

69
update:
70
	git submodule update --init --recursive --remote
71

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.