-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
35 lines (26 loc) · 1.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: quality style unit-test integ-test inference-pytorch-gpu inference-pytorch-cpu inference-pytorch-inf2 stop-all
check_dirs := src tests
# Check that source code meets quality standards
quality:
ruff check $(check_dirs)
# Format source code automatically
style:
ruff check $(check_dirs) --fix
# Run unit tests
unit-test:
RUN_SLOW=True python3 -m pytest -s -v tests/unit -n 10 --log-cli-level='ERROR'
# Run integration tests
integ-test:
python3 -m pytest -s -v tests/integ/
# Build Docker image for PyTorch on GPU
inference-pytorch-gpu:
docker build -f dockerfiles/pytorch/Dockerfile -t integration-test-pytorch:gpu .
# Build Docker image for PyTorch on CPU
inference-pytorch-cpu:
docker build --build-arg="BASE_IMAGE=ubuntu:22.04" -f dockerfiles/pytorch/Dockerfile -t integration-test-pytorch:cpu .
# Build Docker image for PyTorch on AWS Inferentia2
inference-pytorch-inf2:
docker build -f dockerfiles/pytorch/Dockerfile.inf2 -t integration-test-pytorch:inf2 .
# Stop all and prune/clean the Docker Containers
stop-all:
docker stop $$(docker ps -a -q) && docker container prune --force