Skip to content

Commit 1d91095

Browse files
committed
adapt openGauss
1 parent 33ecd5f commit 1d91095

File tree

7 files changed

+536
-2
lines changed

7 files changed

+536
-2
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM ann-benchmarks
2+
3+
# https://github.com/pgvector/pgvector/blob/master/Dockerfile
4+
5+
RUN git clone https://github.com/pgvector/pgvector /tmp/pgvector
6+
7+
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata
8+
RUN apt-get update && apt-get install -y --no-install-recommends build-essential postgresql-common
9+
RUN /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
10+
RUN apt-get install -y --no-install-recommends postgresql-16 postgresql-server-dev-16
11+
RUN sh -c 'echo "local all all trust" > /etc/postgresql/16/main/pg_hba.conf'
12+
13+
# Dynamically set OPTFLAGS based on the architecture
14+
RUN ARCH=$(uname -m) && \
15+
if [ "$ARCH" = "aarch64" ]; then \
16+
OPTFLAGS="-march=native -msve-vector-bits=512"; \
17+
elif [ "$ARCH" = "x86_64" ]; then \
18+
OPTFLAGS="-march=native -mprefer-vector-width=512"; \
19+
else \
20+
OPTFLAGS="-march=native"; \
21+
fi && \
22+
cd /tmp/pgvector && \
23+
make clean && \
24+
make OPTFLAGS="$OPTFLAGS" && \
25+
make install
26+
27+
USER postgres
28+
RUN service postgresql start && \
29+
psql -c "CREATE USER ann WITH ENCRYPTED PASSWORD 'ann'" && \
30+
psql -c "CREATE DATABASE ann" && \
31+
psql -c "GRANT ALL PRIVILEGES ON DATABASE ann TO ann" && \
32+
psql -d ann -c "GRANT ALL ON SCHEMA public TO ann" && \
33+
psql -d ann -c "CREATE EXTENSION vector" && \
34+
psql -c "ALTER USER ann SET maintenance_work_mem = '4GB'" && \
35+
psql -c "ALTER USER ann SET max_parallel_maintenance_workers = 0" && \
36+
psql -c "ALTER SYSTEM SET shared_buffers = '4GB'"
37+
USER root
38+
39+
RUN pip install psycopg[binary] pgvector
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
float:
2+
any:
3+
- base_args: ['@metric']
4+
constructor: openGaussHNSWPQ
5+
disabled: false
6+
docker_tag: ann-benchmarks-openGauss
7+
module: ann_benchmarks.algorithms.openGauss
8+
name: openGauss-hnswpq
9+
run_groups:
10+
M-16:
11+
arg_groups: [{M: 16, efConstruction: 200, hnswEarlystopThreshold: 2147483647, pqM: 96, concurrents: 80}]
12+
args: {}
13+
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
14+
M-24:
15+
arg_groups: [{M: 24, efConstruction: 200, hnswEarlystopThreshold: 2147483647, pqM: 96, concurrents: 80}]
16+
args: {}
17+
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
18+
- base_args: ['@metric']
19+
constructor: openGaussHNSW
20+
disabled: false
21+
docker_tag: ann-benchmarks-openGauss
22+
module: ann_benchmarks.algorithms.openGauss
23+
name: openGauss-hnsw
24+
run_groups:
25+
M-16:
26+
arg_groups: [{M: 16, efConstruction: 200, concurrents: 80}]
27+
args: {}
28+
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
29+
M-24:
30+
arg_groups: [{M: 24, efConstruction: 200, concurrents: 80}]
31+
args: {}
32+
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
33+
- base_args: ['@metric']
34+
constructor: openGaussIVF
35+
disabled: false
36+
docker_tag: ann-benchmarks-openGauss
37+
module: ann_benchmarks.algorithms.openGauss
38+
name: openGauss-ivfflat
39+
run_groups:
40+
pgvector:
41+
args: [[100, 200, 400, 1000, 2000, 4000]]
42+
query_args: [[1, 2, 4, 10, 20, 40, 100]]

0 commit comments

Comments
 (0)