Skip to content

Commit 6d07a23

Browse files
authored
Optimize inner product, update boilerplate, remove bad benchmarks (#7428)
## Summary Tracking issue: #7297 Optimizes inner product with manual partial sum decomposition (because the compiler can't optimize this because float addition is not associative). Also removes the old benchmarks as they no longer really time the correct thing anymore. The real benchmarks will be finished here: #7399. This change also adds the `vortex-tensor/src/vector_search.rs` file to support that soon. ## Testing N/A Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent 97b18fb commit 6d07a23

8 files changed

Lines changed: 362 additions & 381 deletions

File tree

vortex-tensor/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,3 @@ rand = { workspace = true }
3737
rand_distr = { workspace = true }
3838
rstest = { workspace = true }
3939
vortex-btrblocks = { path = "../vortex-btrblocks" }
40-
41-
[[bench]]
42-
name = "similarity_search"
43-
harness = false
44-
test = false

vortex-tensor/benches/similarity_search.rs

Lines changed: 0 additions & 108 deletions
This file was deleted.

vortex-tensor/benches/similarity_search_common/mod.rs

Lines changed: 0 additions & 256 deletions
This file was deleted.

vortex-tensor/public-api.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,4 +550,12 @@ impl core::marker::Copy for vortex_tensor::vector::VectorMatcherMetadata
550550

551551
impl core::marker::StructuralPartialEq for vortex_tensor::vector::VectorMatcherMetadata
552552

553+
pub mod vortex_tensor::vector_search
554+
555+
pub fn vortex_tensor::vector_search::build_constant_query_vector<T: vortex_array::dtype::ptype::NativePType + core::convert::Into<vortex_array::scalar::typed_view::primitive::pvalue::PValue>>(query: &[T], num_rows: usize) -> vortex_error::VortexResult<vortex_array::array::erased::ArrayRef>
556+
557+
pub fn vortex_tensor::vector_search::build_similarity_search_tree<T: vortex_array::dtype::ptype::NativePType + core::convert::Into<vortex_array::scalar::typed_view::primitive::pvalue::PValue>>(data: vortex_array::array::erased::ArrayRef, query: &[T], threshold: T) -> vortex_error::VortexResult<vortex_array::array::erased::ArrayRef>
558+
559+
pub fn vortex_tensor::vector_search::compress_turboquant(data: vortex_array::array::erased::ArrayRef, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::array::erased::ArrayRef>
560+
553561
pub fn vortex_tensor::initialize(session: &vortex_session::VortexSession)

vortex-tensor/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pub mod vector;
2525

2626
pub mod encodings;
2727

28+
pub mod vector_search;
29+
2830
mod utils;
2931

3032
/// Initialize the Vortex tensor library with a Vortex session.

0 commit comments

Comments
 (0)