Add node scoped vectors.indexing.use_gpu setting#138738
Add node scoped vectors.indexing.use_gpu setting#138738mayya-sharipova merged 8 commits intoelastic:mainfrom
Conversation
Replace per-index GPU setting with a static node-scoped vectors.indexing.use_gpu setting supporting true/false/auto modes (default: auto). Node will fail to start if GPU vector indexing is required but unavailable.
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
|
Hi @mayya-sharipova, I've created a changelog YAML for you. |
x-pack/plugin/gpu/src/main/java/org/elasticsearch/xpack/gpu/GPUPlugin.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/xpack/gpu/GPUIndexIT.java
Outdated
Show resolved
Hide resolved
ldematte
left a comment
There was a problem hiding this comment.
Looks good, thanks! Left some questions, mainly about testing.
| } | ||
| } | ||
|
|
||
| public void testSearchWithoutGPU() { |
There was a problem hiding this comment.
Don't we want/need to replace this test? (search on the CPU works when GPU disabled?)
There was a problem hiding this comment.
Yes, good point.
this test is good to have but may be not in GPUIndexIT, as the cluster in this test is started with GpuMode.TRUE.name.
I will follow up with another PR to add this test in a separate module.
There was a problem hiding this comment.
In alternative, it maybe can be a different YAML test (see below). OK to add it as a follow-up.
...nternalClusterTest/java/org/elasticsearch/xpack/gpu/GPUPluginInitializationWithoutGPUIT.java
Show resolved
Hide resolved
x-pack/plugin/gpu/src/main/java/org/elasticsearch/xpack/gpu/GPUPlugin.java
Show resolved
Hide resolved
| Settings settings = context.settings(); | ||
| GpuMode gpuMode = VECTORS_INDEXING_USE_GPU_NODE_SETTING.get(settings); | ||
|
|
||
| if (gpuMode == GpuMode.TRUE && GPUSupport.isSupported() == false) { |
There was a problem hiding this comment.
Do we want to check license here too? (isGpuIndexingFeatureAllowed()?)
There was a problem hiding this comment.
I thought about this, but decided against it for these reasons:
- Looks like Boostrap check is designed for infrastructure check, not business logic. I checked all other its implementers and all they only do infrastructure-focused checks (JVM heap, memory, file size etc)
- License are mutable and updatable through API. Thus we should not fail to start a node without license, because a license can be later updated through an API to enable the GPu feature.
WDYT, @ldematte ?
There was a problem hiding this comment.
I'm a bit torn; your points are very good, but I wonder if it's a better user experience if we tell the user right away if they want to use the GPU and don't have a valid license. True, the license can be updated afterwards, but this would be a first check that everything (or most things) are in the right place.
Since I'm not 100% sure what's best, we can leave it this way.
There was a problem hiding this comment.
I will raise this for our sync discussion.
| .module("gpu") | ||
| .setting("xpack.license.self_generated.type", "trial") | ||
| .setting("xpack.security.enabled", "false") | ||
| .setting("vectors.indexing.use_gpu", "true") |
There was a problem hiding this comment.
Do we want/need tests for false too?
There was a problem hiding this comment.
I am interested to know why you think we need to test for false?
For false we default to CPU and we already have a lot of yml tests outside of GPU plugin for testing how hsnw and int8_hnws work on CPU.
There was a problem hiding this comment.
I was thinking about the test above, "(search on the CPU works when GPU disabled)". Instead of a IT test, it could be a YAML test. (Either one or the other, no need to have both).
It's OK to add either in a follow-up though.
There was a problem hiding this comment.
I will add the follow up.
💚 Backport successful
|
Replace per-index GPU setting with a static node-scoped vectors.indexing.use_gpu setting supporting true/false/auto modes (default: auto). Node will fail to start if GPU vector indexing is required but unavailable.
Replace per-index GPU setting with a static node-scoped
vectors.indexing.use_gpu setting supporting true/false/auto modes
(default: auto).