Expand description
GPU-accelerated vector operations using wgpu (WebGPU).
This module provides optional GPU acceleration for batch distance calculations.
Enable with feature flag gpu.
§When to use GPU
- Batch operations (100+ queries at once)
- Large datasets (500K+ vectors)
- Index construction (HNSW graph building)
For single queries on datasets ≤100K, CPU SIMD remains faster.
§Platform Support
| Platform | Backend |
|---|---|
| Windows | DirectX 12 / Vulkan |
| macOS | Metal |
| Linux | Vulkan |
| Browser | WebGPU |
Functions§
- should_
traverse_ gpu - Check if GPU traversal is worthwhile (always false without GPU HNSW traversal support).
- should_
use_ gpu - Check if GPU dispatch is worthwhile (always false without gpu feature).