Conversation
|
hey @capemox, please check the new Please add the batcher as an optional object in your struct, with the struct implementing the When it has finished batching and needs to execute a batch, it will call the Resolve the comments and fix the merge conflicts ASAP, I am working on resolving merge conflicts on the base Thanks |
4ab241c to
525cec1
Compare
|
Hey @capemox, i think youre right, I was rebasing over fastmerge on local and should have pushed it later on. Have reverted. |
… cpu index before cloning from gpu to cpu.
…y checking for gpu existence beforehand
…ts the gpu index from being set to nil before the last flush is called
There was a problem hiding this comment.
Pull request overview
Adds GPU acceleration support for Faiss vector indexes by introducing a GPU-backed float32 index wrapper and threading a per-field useGPU option through index creation, merge, and cache-loading paths. It also adjusts the IVF/SQ build flow to preserve direct map / nprobe behavior across GPU↔CPU sync and improves shutdown semantics in the request batcher.
Changes:
- Introduce
faissGPUFloat32Indexand select it viafaissIndexFactorywhenuseGPUis enabled for IVF-based float32 indexes. - Plumb
useGPUthrough vector indexing/merging and vector index cache loading/creation. - Update training/build sequence to
trainAndAdd()(then set direct map / nprobe) and improve batcher shutdown by waiting for monitor goroutine exit.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| section_faiss_vector_index.go | Threads useGPU into index build/merge; reorganizes IVF/SQ train+add vs add flow. |
| faiss_vector_request_batcher.go | Adds doneCh to allow stop() to wait for monitor goroutine exit. |
| faiss_vector_posting.go | Passes per-field useGPU into vector index cache load/create. |
| faiss_vector_index.go | Updates IVF/SQ interfaces to use trainAndAdd. |
| faiss_vector_index_gpu_float32.go | New GPU-backed float32 index wrapper with async GPU init + batched GPU search + CPU fallback. |
| faiss_vector_index_float32.go | Adds trainAndAdd for CPU float32 index wrapper. |
| faiss_vector_index_bivf.go | Replaces train with trainAndAdd for binary IVF wrapper. |
| faiss_vector_cache.go | Extends cache load/create API to optionally wrap indexes with GPU support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CascadingRadium
left a comment
There was a problem hiding this comment.
Please pull in minor fixes from the batcher branch as well.
| func (f *faissGPUFloat32Index) setNProbe(nprobe int32) { | ||
| f.cpuIdx.SetNProbe(nprobe) | ||
| f.waitGPU() | ||
| if f.gpuIdx != nil { |
There was a problem hiding this comment.
I dont think GPU index supports this API. We should be setting nprobe to only the cpu index, since this is in the indexing path and we serialize the cpu index only anyway.
faissGPUFloat32IndeximplementingfaissIndex. It opaquely performs operations on cpu or gpu when appropriate.makeFaissIndexto avoid losing direct map information when transferring to gpu