-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Add GPUPlugin for building vector indices on GPU #135545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
./gradlew ":x-pack:plugin:gpu:yamlRestTest" --tests "org.elasticsearch.xpack.gpu.GPUYamlTestSuiteIT.test {p0=gpu/10_basic/*}"
First save Cagra index to hnswlib format on disk. Read this disk file to serialize to Lucene HNSW format.
This reverts commit ec3330e.
Also remove index_options.type:gpu
Plugins can provide VectorsFormatProvider that provides new KnnVectorsFormat for different VectorIndexTypes. If there formats provided by plugins they are used instead of standard
index.vectors.indexing.use_gpu has 3 options: - auto (null) default: use gpu indexing when available - false: don't use gpu indexing - true: use gpu indexing and if not available, throw an error
…ix (#132832) This PR updates cuvs-java dependency to 25.10 (I left 25.08 and updated its verification metadata to the final version for convenience in case we want to go back). It uses CuVSMatrix as a way to transfer data efficiently from GPU memory to the Java heap directly (and then to a Lucene file). I tried to keep changes at a minimum, but some restructuring was necessary (e.g. resource management need to be done at a upper level - we need to keep hold of the resource until we finished reading the CuVSMatrix).
I can't tell, but when the |
|
||
@BeforeClass | ||
public static void checkGPUSupport() { | ||
assumeTrue("cuvs not supported", GPUSupport.isSupported(false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do tests need to check the feature flag too? I just curious what these do when tested against test-release
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should have a couple of tests that asserts that you cannot create GPU things with the feature flag off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more tests in 543fafe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added "test-release" label for the PR. So I guess it will test when FF is disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is strange when I put "test-release", elasticsearch-ci would not run with a message "Pipeline upload rejected: You can only change the pipeline of a running build". So I've eventually deleted "test-release" label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, we have such tests in GPUPluginInitializationIT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good!
I didn't review the native integrations, just format stuff.
I would like tests that verify that you cannot utilize the format if es.vectors_indexing_use_gpu_feature_flag_enable
isn't set :).
…tings" This reverts commit 304bc68.
@elasticsearchmachine test this please |
@elasticsearchmachine test this please |
* HNSW graph is built on GPU, while scalar quantization and search is performed on CPU. | ||
*/ | ||
public class ES92GpuHnswSQVectorsFormat extends KnnVectorsFormat { | ||
public static final String NAME = "Lucene99HnswVectorsFormat"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the name be ES814ScalarQuantizedVectorsFormat
? I'm surprised that tests do not fail with this. Maybe I'm wrong, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ES814ScalarQuantizedVectorsFormat is a flat format that is used inside it, but by itself it is still Lucene99HnswVectorsFormat.
Lucene99HnswVectorsFormat doesn't concern itself how flat format stores data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok then. I honestly confuse myself about these names all the time! Sorry for the noise.
x-pack/plugin/gpu/src/main/java/org/elasticsearch/xpack/gpu/GPUPlugin.java
Outdated
Show resolved
Hide resolved
@elasticsearchmachine test this please |
I temporarily removed the |
Add GPUPlugin that build vector indices on GPU.
Currently available for "hnsw" and "int8_hnws" types.
It uses Nvidia cuvs library that should be available on a node.
GPUPlugin is under the feature flag for 9.2 release.