benwtrent opened a new issue, #12403:
URL: https://github.com/apache/lucene/issues/12403
### Description
One of the biggest pain points of HNSW is that the graph and vectors must be
in memory.
Since the vectors are stored off heap and read in via byte streams, it seems
like we could reduce the memory requirements by half for a typical use case if
we stored the vector dimensions in 2 bytes instead of 4.
When the bytes are read into heap for comparison, we would still be required
to use `float` (until the JVM supports a native float16 type).
I guess the open questions are:
- Do we think this is worth it? It seems like users could get 2x memory
savings with almost no configuration change.
- How big a hit on performance is this. I am assuming decoding a `bfloat16`
bytes will take longer than decoding a `float` as `float` decoding can use
intrinsics.
I recognize that in the future Lucene will likely support a separate vector
codec that uses less memory and is more disk-friendly, but I would argue even
such a structure could benefit from only storing `bfloat16` instead of
`float32`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]