Java Panama Vector API Integrated with Apache Lucene
1–10 of 18 posts
Re: Java Panama Vector API Integrated with Apache Lucene
#21. Lucene is trying to get Approximate Nearest Neighbours (ANN) search working for semantic search purposes: https://issues.apache.org/jira/browse/LUCENE-9004 https://github.com/apache/lucene/issues/10047
2. The Panama Vector API allows CPU's that support it to accelerate vector operations: https://openjdk.org/jeps/438
So this allows fast ANN on Lucene for semantic search!
How did people do this before Lucene supported it? Only through entirely different tools?
Re: Java Panama Vector API Integrated with Apache Lucene
#3Re: Java Panama Vector API Integrated with Apache Lucene
#4A little hard to understand why this is cool, but if I understand correctly: 1. Lucene is trying to get Approximate Nearest Neighbours (ANN) search working for semantic search purposes: https://issues.apache.org/jira/browse/LUCENE-9004 https://github.com/apache/lucene/issues/10047 2. The Panama Vector API allows CPU's that support it to accelerate vector operations: https://openjdk.org/jeps/438 So this allows fast AN…
Re: Java Panama Vector API Integrated with Apache Lucene
#5A little hard to understand why this is cool, but if I understand correctly: 1. Lucene is trying to get Approximate Nearest Neighbours (ANN) search working for semantic search purposes: https://issues.apache.org/jira/browse/LUCENE-9004 https://github.com/apache/lucene/issues/10047 2. The Panama Vector API allows CPU's that support it to accelerate vector operations: https://openjdk.org/jeps/438 So this allows fast AN…
A little confusing because "vector" here (largely) refers to two different things. "Vector search" being this ANN thing, but the "Vector API" is about SIMD. SIMD provides CPU operations on a bunch of data at a time, i.e. instead of one instruction for each 32-bit float, you operate on, depending on the CPU, 128 or 256 or 512 bits worth of floats at the same time. So, over scalar code, SIMD here could get maybe a 4-16…
Re: Java Panama Vector API Integrated with Apache Lucene
#6A little hard to understand why this is cool, but if I understand correctly: 1. Lucene is trying to get Approximate Nearest Neighbours (ANN) search working for semantic search purposes: https://issues.apache.org/jira/browse/LUCENE-9004 https://github.com/apache/lucene/issues/10047 2. The Panama Vector API allows CPU's that support it to accelerate vector operations: https://openjdk.org/jeps/438 So this allows fast AN…
A little confusing because "vector" here (largely) refers to two different things. "Vector search" being this ANN thing, but the "Vector API" is about SIMD. SIMD provides CPU operations on a bunch of data at a time, i.e. instead of one instruction for each 32-bit float, you operate on, depending on the CPU, 128 or 256 or 512 bits worth of floats at the same time. So, over scalar code, SIMD here could get maybe a 4-16…
Re: Java Panama Vector API Integrated with Apache Lucene
#7But it comes with continued challenges if I understand:
- Panama is an incubating API and Java has taken its time having an official way of using SIMD. It could all change in Java 22
- It only works on Java 20, with a very specific set of flags passed to the JVM. It’ll take time for this change to make it into Elasticsearch and Solr
- Panama itself is a weird and very low level API.
- Lucene organizes the HNSW vector index graph alongside its inverted index segments. And these need to be merged/compacted periodically. Merging HNSW graphs, as I understand it, is computationally difficult as the graph gets rebuilt.
Re: Java Panama Vector API Integrated with Apache Lucene
#8A little hard to understand why this is cool, but if I understand correctly: 1. Lucene is trying to get Approximate Nearest Neighbours (ANN) search working for semantic search purposes: https://issues.apache.org/jira/browse/LUCENE-9004 https://github.com/apache/lucene/issues/10047 2. The Panama Vector API allows CPU's that support it to accelerate vector operations: https://openjdk.org/jeps/438 So this allows fast AN…
A little confusing because "vector" here (largely) refers to two different things. "Vector search" being this ANN thing, but the "Vector API" is about SIMD. SIMD provides CPU operations on a bunch of data at a time, i.e. instead of one instruction for each 32-bit float, you operate on, depending on the CPU, 128 or 256 or 512 bits worth of floats at the same time. So, over scalar code, SIMD here could get maybe a 4-16…
SIMD is supported by Java out of the box but the optimizer might miss some opportunities. With this API it is far more likely that SIMD will be used if it's available and on first compilation so performance should be improved.
Re: Java Panama Vector API Integrated with Apache Lucene
#9A little hard to understand why this is cool, but if I understand correctly: 1. Lucene is trying to get Approximate Nearest Neighbours (ANN) search working for semantic search purposes: https://issues.apache.org/jira/browse/LUCENE-9004 https://github.com/apache/lucene/issues/10047 2. The Panama Vector API allows CPU's that support it to accelerate vector operations: https://openjdk.org/jeps/438 So this allows fast AN…
By performing query expansion based on features of documents within the search results. Very efficient and effective if you have indexed the right features.
Re: Java Panama Vector API Integrated with Apache Lucene
#10Will this allow lucene to drop hnswlib and get similar performance using native java ?