Skip to content

Enable HNSW index arrays with transparent huge pages - #72

Merged
gouyt13 merged 1 commit into
VectorDB-NTU:mainfrom
TamimEhsan:hugepages
Aug 26, 2026
Merged

Enable HNSW index arrays with transparent huge pages#72
gouyt13 merged 1 commit into
VectorDB-NTU:mainfrom
TamimEhsan:hugepages

Conversation

@TamimEhsan

@TamimEhsan TamimEhsan commented Aug 26, 2026

Copy link
Copy Markdown
Member

This PR enables hugepage if the device setting is set to madvise mode. The groundwork was already there in the library.

data_level0_memory_ is ~1.28 GiB and every candidate visit is a random access into it. With THP in madvise mode a plain malloc gets no huge pages, so that array sits on ~335,000 4 KiB pages against a ~2048-entry STLB — nearly every visit misses and takes a page walk. The hugepage size is set to 2MB.

The gain exists because this host is in madvise mode. On a host set to always it is already there without the patch; on never, MADV_HUGEPAGE is ignored and it fallbacks to original behaviour.

Benchmarks

dataset: GIST1M, topk = 10

EF Original QPS Hugepage QPS Recall Gain (%)
60 7,903.70 8,608.78 0.8075 8.92%
150 3,786.11 4,198.25 0.9080 10.89%
300 2,024.44 2,127.25 0.9532 5.08%
500 1,274.77 1,327.83 0.9677 4.16%
1000 624.46 670.49 0.9787 7.37%
2000 313.69 327.43 0.9825 4.38%

@TamimEhsan TamimEhsan changed the title back the hnsw index arrays with transparent huge pages Enable hnsw index arrays with transparent huge pages Aug 26, 2026
@TamimEhsan TamimEhsan changed the title Enable hnsw index arrays with transparent huge pages Enable HNSW index arrays with transparent huge pages Aug 26, 2026
@gouyt13
gouyt13 merged commit 17bf7ef into VectorDB-NTU:main Aug 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants