-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
92 lines (73 loc) · 4.03 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
91
92
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
build-release:
MKLROOT=${ROOT_DIR}/builds/release/vcpkg_installed/x64-linux/lib/intel64 cmake \
--preset release \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \
-DOpenMP_CXX_LIB_NAMES=libiomp5 \
-DOpenMP_libiomp5_LIBRARY=${ROOT_DIR}/builds/release/vcpkg_installed/x64-linux/lib/intel64/libiomp5.so \
.
cmake --build --preset release -j12
build-debug:
MKLROOT=${ROOT_DIR}/builds/debug/vcpkg_installed/x64-linux/lib/intel64 cmake \
--preset debug \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \
-DOpenMP_CXX_LIB_NAMES=libiomp5 \
-DOpenMP_libiomp5_LIBRARY=${ROOT_DIR}/builds/debug/vcpkg_installed/x64-linux/lib/intel64/libiomp5.so \
.
cmake --build --preset debug -j12
build-python:
MKLROOT=${ROOT_DIR}/builds/python/vcpkg_installed/x64-linux/lib/intel64 cmake \
--preset python \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \
-DOpenMP_CXX_LIB_NAMES=libiomp5 \
-DOpenMP_libiomp5_LIBRARY=${ROOT_DIR}/builds/python/vcpkg_installed/x64-linux/lib/intel64/libiomp5.so \
.
cmake --build --preset python -j12
cd builds/python/lintdb/python
build-server:
MKLROOT=${ROOT_DIR}/builds/server/vcpkg_installed/x64-linux/lib/intel64 cmake \
--preset server \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \
-DOpenMP_CXX_LIB_NAMES=libiomp5 \
-DOpenMP_libiomp5_LIBRARY=${ROOT_DIR}/builds/server/vcpkg_installed/x64-linux/lib/intel64/libiomp5.so \
.
cmake --build --preset server -j12
build-benchmarks:
MKLROOT=${ROOT_DIR}/builds/benchmarks/vcpkg_installed/x64-linux/lib/intel64 cmake \
--preset benchmarks \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DOpenMP_CXX_FLAGS=-fopenmp=libiomp5 \
-DOpenMP_CXX_LIB_NAMES=libiomp5 \
-DOpenMP_libiomp5_LIBRARY=${ROOT_DIR}/builds/benchmarks/vcpkg_installed/x64-linux/lib/intel64/libiomp5.so \
.
cmake --build --preset benchmarks -j12 --target bench_lintdb
test:
cd builds/debug && cmake -E env GLOG_v=5 GLOG_logtostderr=1 ctest --output-on-failure
format:
find ./lintdb -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i
valgrind:
valgrind -s --trace-children=yes --track-origins=yes --keep-stacktraces=alloc-and-free --suppressions=debug/valgrind-python.supp env PYTHONPATH="_build_python_/lintdb/python/build/lib/lintdb" python benchmarks/bench_lintdb.py --index-path=experiments/py_index_bench_test-collection-xtr
callgrind:
OMP_MAX_ACTIVE_LEVELS=2 OMP_THREAD_LIMIT=6 OMP_NUM_THREADS=6 valgrind --tool=callgrind --suppressions=debug/valgrind-python.supp --instr-atstart=yes --dump-instr=yes --collect-jumps=yes python ./benchmarks/bench_lintdb.py index
python -m gprof2dot --format=callgrind --output=out.dot callgrind.out.*
dot -Tsvg out.dot -o graph.svg
callgrind-py:
OMP_MAX_ACTIVE_LEVELS=2 OMP_THREAD_LIMIT=6 OMP_NUM_THREADS=6 valgrind --tool=callgrind --suppressions=debug/valgrind-python.supp --instr-atstart=yes --dump-instr=yes --collect-jumps=yes python ./benchmarks/lotte/indexing_two.py eval --index-path=benchmarks/lintdb-lifestyle-40k --stop=40000
python -m gprof2dot --format=callgrind --output=out.dot callgrind.out.*
dot -Tsvg out.dot -o graph.svg
callgrind-cpp: build-benchmarks
GLOG_v=100 valgrind --tool=callgrind --instr-atstart=yes --dump-instr=yes --collect-jumps=yes ./builds/benchmarks/benchmarks/Release/bench_lintdb
python -m gprof2dot --format=callgrind --output=out.dot callgrind.out.*
dot -Tsvg out.dot -o graph.svg
callgrind-colbert: build-conda
PYTHONPATH="_build_python_/lintdb/python/build/lib/lintdb" valgrind --tool=callgrind --suppressions=debug/valgrind-python.supp --instr-atstart=no --dump-instr=yes --collect-jumps=yes python ./benchmarks/run_colbert.py
run-perf:
# make sure your system allows perf to run. ex: sudo sysctl -w kernel.perf_event_paranoid=1
OMP_MAX_ACTIVE_LEVELS=2 OMP_THREAD_LIMIT=12 OMP_NUM_THREADS=6 perf record -g -- python -X perf benchmarks/bench_lintdb.py single-index
perf script | ./debug/stackcollapse-perf.pl | ./debug/flamegraph.pl > perf.data.svg
run-docs:
mkdocs serve -a 0.0.0.0:8000