-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
50 lines (27 loc) · 1.45 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
DOCKER_CMD := docker run -it --rm --gpus=all --privileged=true --ipc=host -v $(shell pwd):/app
DOCKER_PY_CMD := ${DOCKER_CMD} --entrypoint=python
DOCKER_NSYS_CMD := ${DOCKER_CMD} --entrypoint=nsys
PROFILE_CMD := profile -t cuda,cublas,cudnn,nvtx,osrt --force-overwrite=true --delay=2 --duration=30
PROFILE_TARGETS = logs/tuning_baseline.qdrep logs/tuning_postprocess_1.qdrep
.PHONY: sleep
build-container: docker/Dockerfile
docker build -f $< -t pytorch-video-pipeline:latest .
run-container: build-container
${DOCKER_CMD} pytorch-video-pipeline:latest
logs/cli.pipeline.dot:
${DOCKER_CMD} --entrypoint=gst-launch-1.0 pytorch-video-pipeline:latest filesrc location=media/in.mp4 num-buffers=200 ! decodebin ! progressreport update-freq=1 ! fakesink sync=true
logs/%.pipeline.dot: %.py
${DOCKER_PY_CMD} pytorch-video-pipeline:latest $<
logs/%.qdrep: %.py
${DOCKER_NSYS_CMD} pytorch-video-pipeline:latest ${PROFILE_CMD} -o $@ python $<
%.pipeline.png: logs/%.pipeline.dot
dot -Tpng -o$@ $< && rm -f $<
%.output.svg: %.rec
cat $< | svg-term > $@
%.rec:
asciinema rec $@ -c "$(MAKE) --no-print-directory logs/$*.pipeline.dot sleep"
sleep:
@sleep 2
@echo "---"
pipeline: cli.pipeline.png frames_into_python.pipeline.png frames_into_pytorch.pipeline.png
tuning: logs/tuning_baseline.qdrep logs/tuning_postprocess_1.qdrep logs/tuning_postprocess_2.qdrep logs/tuning_batch.qdrep logs/tuning_fp16.qdrep logs/tuning_dtod.qdrep logs/tuning_concurrency.qdrep