From 93a28117c0cd45c787ac1ab7478d487743b75ea7 Mon Sep 17 00:00:00 2001 From: BlaiseMuhirwa Date: Sun, 2 Feb 2025 17:25:06 -0600 Subject: [PATCH 1/2] fix batched search comment and remove supervisord config --- Dockerfile | 7 +------ bin/docker-run.sh | 3 +-- bin/supervisord.conf | 19 ------------------- include/flatnav/index/Index.h | 7 +++++-- 4 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 bin/supervisord.conf diff --git a/Dockerfile b/Dockerfile index b8ee053..0db0940 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # debian:buster-slim is much smaller than ubuntu 22 ARG BASE_IMAGE=debian:buster-slim -FROM ${BASE_IMAGE} as base +FROM ${BASE_IMAGE} AS base ARG POETRY_VERSION=1.8.2 ARG PYTHON_VERSION=3.11.6 @@ -34,8 +34,6 @@ RUN apt-get update -y \ libxmlsec1-dev \ libffi-dev \ liblzma-dev \ - # Multi-process manager inside docker - supervisor \ # Install the rest git \ gcc \ @@ -86,9 +84,6 @@ COPY experiments/ ./experiments/ # Copy external dependencies (for now only cereal) COPY external/ ./external/ -# Copy the configuration for supervisor -COPY bin/supervisord.conf /etc/supervisor/conf.d/supervisord.conf - # Install needed dependencies including flatnav. # Install hnwlib (from a forked repo that has extensions we need) WORKDIR ${FLATNAV_PATH} diff --git a/bin/docker-run.sh b/bin/docker-run.sh index 3be2aca..20f9de8 100755 --- a/bin/docker-run.sh +++ b/bin/docker-run.sh @@ -95,8 +95,7 @@ fi docker run \ --name $CONTAINER_NAME \ -it \ - -e MAKE_TARGET=$1 \ --volume ${DATA_DIR}:/root/data \ --volume ${METRICS_DIR}:/root/metrics \ --rm flatnav:$TAG_NAME \ - /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf + make $1 \ No newline at end of file diff --git a/bin/supervisord.conf b/bin/supervisord.conf deleted file mode 100644 index 7971136..0000000 --- a/bin/supervisord.conf +++ /dev/null @@ -1,19 +0,0 @@ - -[supervisord] -nodaemon=true -user=root -loglevel=warn - - -[program:benchmark-runner] -# Terminate the supervisor process once benchmark-runner process exits. kill -s SIGTERM 1 will kill -# the process with PID 1, which is supervisord in the docker container. -command=/bin/bash -c "make '%(ENV_MAKE_TARGET)s'; echo 'Make completed'; kill -s SIGTERM 1" -autostart=true -autorestart=false -stdout_logfile=/dev/stdout -stderr_logfile=/dev/stderr -stdout_logfile_maxbytes=0 -stderr_logfile_maxbytes=0 -stdout_capture_maxbytes=1MB -stderr_capture_maxbytes=1MB diff --git a/include/flatnav/index/Index.h b/include/flatnav/index/Index.h index c288d40..4227f44 100644 --- a/include/flatnav/index/Index.h +++ b/include/flatnav/index/Index.h @@ -72,8 +72,11 @@ class Index { bool _collect_stats = false; - // These are currently only supported for single-threaded search. - // Trying to use them in multi-threaded setting will result in wird behavior. + // NOTE: These metrics are meaningful the most with single-threaded search. + // With multi-threaded search, for instance, the number of distance computations will + // accumulatte across queries, which means at the end of the batched search, the number + // you get is the cumulative sum of all distance computations across all queries. + // Maybe that's what you want, but it's worth noting mutable std::atomic _distance_computations = 0; mutable std::atomic _metric_hops = 0; From b95f713c167d7edf269daa0df5070e0347e751d5 Mon Sep 17 00:00:00 2001 From: BlaiseMuhirwa Date: Sun, 2 Feb 2025 17:39:01 -0600 Subject: [PATCH 2/2] fix comment --- include/flatnav/index/Index.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flatnav/index/Index.h b/include/flatnav/index/Index.h index 4227f44..f164893 100644 --- a/include/flatnav/index/Index.h +++ b/include/flatnav/index/Index.h @@ -74,7 +74,7 @@ class Index { // NOTE: These metrics are meaningful the most with single-threaded search. // With multi-threaded search, for instance, the number of distance computations will - // accumulatte across queries, which means at the end of the batched search, the number + // accumulate across queries, which means at the end of the batched search, the number // you get is the cumulative sum of all distance computations across all queries. // Maybe that's what you want, but it's worth noting mutable std::atomic _distance_computations = 0;