Skip to content

adapt openGauss for annbenchmark #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
- voyager
- vsag
- weaviate
- openGauss
include:
- library: pynndescent
dataset: random-xs-16-hamming
Expand Down
36 changes: 36 additions & 0 deletions ann_benchmarks/algorithms/openGauss/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ann-benchmarks

RUN add-apt-repository ppa:opengauss/opengauss

RUN DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata
RUN sed -i 's/bookworm/jammy/g' /etc/apt/sources.list.d/opengauss-ubuntu-opengauss-bookworm.list
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
RUN apt install opengauss
RUN sh -c 'echo "local all all trust" > /var/lib/opengauss/data/pg_hba.conf'

# Dynamically set OPTFLAGS based on the architecture
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "aarch64" ]; then \
OPTFLAGS="-march=native -msve-vector-bits=512"; \
elif [ "$ARCH" = "x86_64" ]; then \
OPTFLAGS="-march=native -mprefer-vector-width=512"; \
else \
OPTFLAGS="-march=native"; \
fi && \
cd /tmp/pgvector && \
make clean && \
make OPTFLAGS="$OPTFLAGS" && \
make install

USER opengauss
RUN service opengauss start && \
gsql -c "CREATE USER ann WITH ENCRYPTED PASSWORD 'ann'" && \
gsql -c "CREATE DATABASE ann" && \
gsql -c "GRANT ALL PRIVILEGES ON DATABASE ann TO ann" && \
gsql -d ann -c "GRANT ALL ON SCHEMA public TO ann" && \
gsql -c "ALTER USER ann SET maintenance_work_mem = '4GB'" && \
gsql -c "ALTER USER ann SET max_parallel_maintenance_workers = 0" && \
gsql -c "ALTER SYSTEM SET shared_buffers = '4GB'"
USER root

RUN pip install psycopg[binary]
42 changes: 42 additions & 0 deletions ann_benchmarks/algorithms/openGauss/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
float:
any:
- base_args: ['@metric']
constructor: openGaussHNSWPQ
disabled: false
docker_tag: ann-benchmarks-openGauss
module: ann_benchmarks.algorithms.openGauss
name: openGauss-hnswpq
run_groups:
M-16:
arg_groups: [{M: 16, efConstruction: 200, hnswEarlystopThreshold: 2147483647, pqM: 96, concurrents: 80}]
args: {}
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
M-24:
arg_groups: [{M: 24, efConstruction: 200, hnswEarlystopThreshold: 2147483647, pqM: 96, concurrents: 80}]
args: {}
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
- base_args: ['@metric']
constructor: openGaussHNSW
disabled: false
docker_tag: ann-benchmarks-openGauss
module: ann_benchmarks.algorithms.openGauss
name: openGauss-hnsw
run_groups:
M-16:
arg_groups: [{M: 16, efConstruction: 200, concurrents: 80}]
args: {}
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
M-24:
arg_groups: [{M: 24, efConstruction: 200, concurrents: 80}]
args: {}
query_args: [[10, 20, 40, 80, 120, 200, 400, 800]]
- base_args: ['@metric']
constructor: openGaussIVF
disabled: false
docker_tag: ann-benchmarks-openGauss
module: ann_benchmarks.algorithms.openGauss
name: openGauss-ivfflat
run_groups:
pgvector:
args: [[100, 200, 400, 1000, 2000, 4000]]
query_args: [[1, 2, 4, 10, 20, 40, 100]]
Loading