hnswlib icon indicating copy to clipboard operation
hnswlib copied to clipboard

multi thread for addPoint?

Open WaterElapse opened this issue 4 years ago • 3 comments

The commit of apoorv-sharma support multi threads for addPoint? Will this patch reduce the time of the building a hnsw graph?

WaterElapse avatar Sep 01 '20 13:09 WaterElapse

Hello @WaterElapse,

The addPoint supported multithreaded writes before my commit. In my commit, I have added support for performing true vector updates in multi-threaded manner i.e for an existing point in the index you can change the vector associated with it by modifying the graph in memory, without needing to rebuild the index from the scratch. As part of the commit, I have also fixed a bug that existed while adding points. This fix should provide marginal improvements in the build time for hnsw graph.

apoorv-sharma avatar Sep 01 '20 17:09 apoorv-sharma

@apoorv-sharma What bug did you fix?

orrorcol avatar Sep 08 '20 08:09 orrorcol

While building the index, farthest point was being selected at each level as the entry point for the next level. I fixed the code to select the nearest point.

apoorv-sharma avatar Sep 14 '20 19:09 apoorv-sharma