Expand description
zer-compute, hardware-accelerated backend for entity resolution.
Provides DeviceComparator and DeviceScorer as drop-in replacements for
the CPU-only counterparts in zer-compare. Both implement the same
zer_core::traits::Comparator and zer_core::traits::Scorer
traits, so the rest of the pipeline is backend-agnostic.
§Backend selection
use std::sync::Arc;
use zer_compute::{GpuBackend, DeviceComparator, DeviceScorer};
use zer_core::schema::{FieldKind, SchemaBuilder};
let schema = SchemaBuilder::new()
.field("naam", FieldKind::Name)
.field("datum", FieldKind::Date)
.build()
.unwrap();
// Auto-detect: tries CUDA → AVX2 → CPU in order.
let backend = Arc::new(GpuBackend::auto_detect());
let comparator = DeviceComparator::new(Arc::clone(&backend), &schema).unwrap();
let scorer = DeviceScorer::new(Arc::clone(&backend));§Feature flags
| Flag | Description |
|---|---|
cuda | NVIDIA CUDA via cudarc, requires CUDA Toolkit 13.1+ and nvcc at build time |
vulkan | Vulkan 1.3 compute via ash, requires slangc on PATH at build time |
avx2 | x86_64 AVX2 SIMD via std::arch, no external toolchain required |
cpu | Explicit scalar CPU path backed by zer-compare (Rayon parallel) |
debug-shaders | Embed debug info in compiled CUDA kernels for cuda-gdb / Nsight stepping |
When no flag is set the crate compiles and runs normally using the
always-available scalar CPU fallback backed by zer-compare.
Re-exports§
pub use backend::BackendPreference;pub use backend::DeviceBackend;pub use backend::GpuBackend;pub use batch_sizer::BatchSizer;pub use comparator::DeviceComparator;pub use error::GpuError;pub use scorer::DeviceScorer;
Modules§
- backend
- Backend abstraction,
DeviceBackendenum,BackendPreference, and auto-detection logic. - batch_
sizer - Auto-tunes the GPU batch size from available VRAM using the exact buffer layout.
- comparator
DeviceComparator, implements theComparatortrait.- error
- kernel
- Core trait definitions for the kernel dispatch system.
- kernels
- Typed kernel descriptors, one module per compute operation.
- scorer
DeviceScorer, implements theScorertrait with GPU-accelerated EM.- soa