Benchmark Reference

Preset and option reference for the ./xfaiss.sh bench command.

./xfaiss.sh bench <preset> [options...]

Presets

IVF-Flat

Preset Description
ivf-flat-sift1m IVF-Flat on SIFT-1M
ivf-flat-gist1m IVF-Flat on GIST-1M
ivf-flat-sift100m IVF-Flat on SIFT-100M
ivf-flat-deep100m IVF-Flat on Deep-100M
ivf-flat-7m-d1024-l2-query-fixed IVF-Flat on 7M-d1024 (L2, Query-Fixed)
ivf-flat-7m-d1024-l2-cluster-fixed IVF-Flat on 7M-d1024 (L2, Cluster-Fixed) [experimental]
ivf-flat-7m-d1024-ip-query-fixed IVF-Flat on 7M-d1024 (IP, Query-Fixed)
ivf-flat-7m-d1024-ip-cluster-fixed IVF-Flat on 7M-d1024 (IP, Cluster-Fixed) [experimental]
ivf-flat-fullscan-sift1m IVF-Flat full scan (nprobe=nlist) on SIFT-1M
ivf-flat-fullscan-gist1m IVF-Flat full scan (nprobe=nlist) on GIST-1M

IVF-RaBitQ

Preset Description
ivf-rabitq-sift1m IVF-RaBitQ on SIFT-1M
ivf-rabitq-gist1m IVF-RaBitQ on GIST-1M
ivf-rabitq-sift100m IVF-RaBitQ on SIFT-100M
ivf-rabitq-deep100m IVF-RaBitQ on Deep-100M
ivf-rabitq-nb3-sift1m 3-bit IVF-RaBitQ on SIFT-1M [experimental]
ivf-rabitq-nb3-gist1m 3-bit IVF-RaBitQ on GIST-1M [experimental]

The nb3 presets require indexes prepared with --rabitq-nb-bits 3; see Prepare Data.

KNN Exact

Preset Description
knn-exact-sift1m-l2 KNN Exact (MuIndexFlat, L2) on SIFT-1M
knn-exact-sift1m-ip KNN Exact (MuIndexFlat, IP) on SIFT-1M
knn-exact-gist1m-l2 KNN Exact (MuIndexFlat, L2) on GIST-1M
knn-exact-gist1m-ip KNN Exact (MuIndexFlat, IP) on GIST-1M

HNSW-Flat (experimental)

Preset Description
hnsw-flat-sift1m HNSW-Flat (MuIndexHNSWFlat) on SIFT-1M
hnsw-flat-gist1m HNSW-Flat (MuIndexHNSWFlat) on GIST-1M

Options

Data

Option Argument Description Default
--data-dir DIR Root data directory /var/opt/xvector-data
--index-path PATH Index path override (IVF and HNSW presets) preset default
--base-path PATH Base vectors path override (KNN Exact presets) preset default
--query-path PATH Query path override preset default
--groundtruth-path PATH Ground-truth path override preset default
--query-set NAME Select matching queries and ground truth: official or extended-N (GIST L2 only, N=1001–501000) preset paths

--query-set uses all rows in the selected set unless the query count is overridden. It cannot be combined with explicit --query-path or --groundtruth-path options, or nonzero --random-queries. Prepare extended sets with the data preparation command.

Option Argument Description Default
--nprobe N Number of probes (IVF only) preset value: usually 128; 240 for 7M-d1024, 4096 for full-scan presets
--topk N Top-k results 100
--skip-cpu (flag) Skip CPU benchmark off
--max-queries N Query count; truncates or repeats input rows, 0 uses all 10000 for KNN Exact and IVF full-scan presets; all otherwise
--batch-size N Queries per synchronous search call; 0 uses all queries 0
--warmup-runs N Unmeasured full query passes per target 1
--random-queries N Random query count preset default
--search-iterations-on-mu N Repeat MU search N times 1
--search-iterations-on-cpu N Repeat CPU search N times 1

When --max-queries changes the loaded query count, file-based ground truth is skipped. Increasing it repeats existing queries rather than adding distinct ones. For larger GIST query sets with ground truth, use --query-set extended-N.

Search — IVF-Flat

Option Argument Description Default
--flat-parallel-mode M MU parallel mode preset default

--flat-parallel-mode values:

  • 1 — QUERY_FIXED — processes each query across its selected clusters
  • 2 — CLUSTER_LIST_FIXED — groups queries by selected cluster to reuse target vectors across queries

Search — IVF-RaBitQ

Option Argument Description Default
--rabitq-centered (flag) Centered quantization on
--rabitq-qb VALUES qb values (e.g. 0,4,8 or 2-5) 0-8 (full sweep)

qb is the number of bits used to quantize the query vector. 0 disables query quantization (uses the original float query); higher values quantize the query into more bitplanes, improving recall at the cost of additional computation.

Search — KNN Exact

Option Argument Description Default
--metric M Distance metric (L2 or IP) preset metric

Search — HNSW-Flat

Option Argument Description Default
--efsearch N HNSW candidate list size (efSearch) 64 (HNSW presets: 128)

efSearch controls the size of the dynamic candidate list during graph traversal — higher values improve recall at the cost of more distance computations. Both --topk and --efsearch must be in the range [1, 256]; efSearch is raised to at least topk internally. --nprobe does not apply to HNSW-Flat.

Device

Option Argument Description Default
--pxl-device-id ID Device ID PXL_DEVICE_ID or 0
--pxl-num-sub N Number of sub systems 24
--pxl-task-count N Task count preset default
--pxl-locality-mode M Locality mode: 0 = COMPACT, 1 = SPREAD 1 (SPREAD)

--pxl-locality-mode controls how the runtime schedules tasks across sub systems:

  • 0: COMPACT — cluster-first allocation (intra-sub). Packs tasks onto fewer clusters within a sub before moving to the next.
  • 1: SPREAD — sub-first allocation (inter-sub). Distributes tasks across all subs before filling any single sub.
Option Argument Description Default
--xvector-log-host LEVEL Host log level 0
--xvector-log-device LEVEL Device log level 0

CPU / Host

Option Argument Description Default
--numa-cpubind NODE NUMA CPU bind node (empty disables CPU binding) 0
--numa-membind NODE NUMA memory bind node (empty disables memory binding) 0
--gdb (flag) Run under gdb batch mode off

Set both NUMA options to an empty string to run without numactl.

Environment variables

Settings take precedence in this order: CLI > environment > preset > program defaults. The table below lists defaults for ./xfaiss.sh bench unless noted.

Variable Used by Default
PXL_DEVICE_ID Wrapper and binaries 0
PXL_NUM_SUB Wrapper and binaries 24
PXL_TASK_COUNT Wrapper and binaries preset value in bench.sh; 0 in a direct binary (see below)
PXL_LOCALITY_MODE Wrapper and binaries 1 (spread)
XVECTOR_LOG_HOST, XVECTOR_LOG_DEVICE Wrapper and binaries 0 (disabled); TUI starts XVECTOR_LOG_HOST at 5
NUMA_CPUBIND, NUMA_MEMBIND Wrapper 0; explicitly empty disables that binding
OMP_NUM_THREADS Wrapper / OpenMP 64 in the wrapper
OPENBLAS_NUM_THREADS, MKL_NUM_THREADS Wrapper / BLAS 1 in the wrapper
DATA_DIR Preset paths /var/opt/xvector-data
XFAISS_PRESETS_FILE Preset loader unset

When running a benchmark binary directly, set a positive task count for your workload. Values below the selected Sub count, including 0, are raised to that Sub count.

Log levels accept 0–5, none, error, warn, info, debug, trace (case-insensitive), and true/yes (5) or false/no (0). Device IDs and resource counts accept unsigned decimal integers. PXL_DEVICE_ID selects a single device; PXL_LOCALITY_MODE accepts 0 or 1.

Performance tuning

IVF coarse search runs on the CPU through Faiss and OpenMP. Adjust OMP_NUM_THREADS and your BLAS thread settings for the available CPU resources; the benchmark defaults are listed above.

Tune --batch-size and --pxl-task-count together using representative query batches. Compare end-to-end search latency and throughput when choosing settings.