generated from dgcnz/ml-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (67 loc) · 2.74 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
clean: ## Clean autogenerated files
rm -rf dist
find . -type f -name "*.DS_Store" -ls -delete
find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
find . | grep -E ".pytest_cache" | xargs rm -rf
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
rm -f .coverage
demo_vitdet:
cd detrex && \
python demo/demo.py --config-file detectron2/projects/ViTDet/configs/COCO/cascade_mask_rcnn_vitdet_b_100ep.py \
--input ../artifacts/idea.jpg \
--output ../artifacts/demo_output.jpg \
--opts train.init_checkpoint=../artifacts/model_final_435fa9.pkl train.device=cpu
demo_eva:
cd detrex && \
python demo/demo.py --config-file projects/dino_eva/configs/dino-eva-02/dino_eva_02_vitdet_b_4attn_1024_lrd0p7_4scale_12ep.py \
--input ../artifacts/idea.jpg \
--output ../artifacts/demo_output_eva.jpg \
--opts train.init_checkpoint=../artifacts/dino_eva_02_in21k_pretrain_vitdet_b_4attn_1024_lrd0p7_4scale_12ep.pth train.device=cpu model.device=cpu
demo_vitdet_dino:
cd detrex && \
python demo/demo.py --config-file projects/dino/configs/dino-vitdet/dino_vitdet_base_4scale_12ep.py \
--input ../artifacts/idea.jpg \
--output ../artifacts/demo_output_dino_vit.jpg \
--opts train.init_checkpoint=../artifacts/dino_vitdet_base_4scale_50ep.pth train.device=cpu model.device=cpu
module_avail: ## greppable module avail
module -t avail 2>&1
load_modules:
module load 2023
module load Python/3.11.3-GCCcore-12.3.0
unload_modlues:
module unload Python/3.11.3-GCCcore-12.3.0
module unload 2023
scat: ## cat slurm log with param
cat scripts/slurm_logs/slurm_output_$(id).out
build_cpp:
cmake -DCMAKE_CXX_FLAGS=-O3 -Bbuild
compile_cpp:
cmake --build build --config Release
# We need to include crypt.h from $CONDA_PREFIX/include
test_modelopt_installation:
CPATH=$(CONDA_PREFIX)/include python -c "import modelopt.torch.quantization.extensions as ext; print(ext.cuda_ext); print(ext.cuda_ext_fp8)"
docs_serve:
python -m http.server --directory docs/_build/html
check_pytorch_abi:
python -c "import torch; print(torch._C._GLIBCXX_USE_CXX11_ABI)"
export_requirements:
poetry export --without-hashes --format=requirements.txt > requirements.txt
setup_detrex:
git submodule init
git submodule update
cd detrex && \
git submodule init && \
git submodule update && \
cd detectron2 && \
python -m pip install -e . && \
cd .. && \
python -m pip install -e .
setup_python: export_requirements
pip install -r requirements.txt
# C++ Runtime
download_libtorch:
sh scripts/setup/download_libtorch.sh
download_tensorrt:
sh scripts/setup/download_tensorrt.sh
download_and_build_torchtrt: download_libtorch download_tensorrt
sh scripts/setup/download_and_build_torchtrt.sh