Skip to content

Commit

Permalink
[TST] Move rust benchmark crate to test crate (#2900)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Move the dataset crate to a new test crate that aims to contain all relevant information for testing.
 - New functionality
	 - N/A

## Test plan
*How are these changes tested?*

- [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?*
N/A
  • Loading branch information
Sicheng-Pan authored Oct 4, 2024
1 parent 91ba2c9 commit 200c0c4
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 40 deletions.
49 changes: 25 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
resolver = "2"

members = [
"rust/benchmark-datasets",
"rust/blockstore",
"rust/cache",
"rust/chroma",
Expand All @@ -13,6 +12,7 @@ members = [
"rust/storage",
"rust/types",
"rust/worker",
"rust/test",
]

[workspace.dependencies]
Expand Down Expand Up @@ -44,7 +44,7 @@ chroma-cache = { path = "rust/cache" }
chroma-types = { path = "rust/types" }
chroma-index = { path = "rust/index" }
chroma-distance = { path = "rust/distance" }
chroma-benchmark-datasets = { path = "rust/benchmark-datasets" }
chroma-test = { path = "rust/test" }
worker = { path = "rust/worker" }

# Dev dependencies
Expand Down
3 changes: 0 additions & 3 deletions rust/benchmark-datasets/src/lib.rs

This file was deleted.

2 changes: 1 addition & 1 deletion rust/index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ chroma-distance = { workspace = true }
tempfile = { workspace = true }
rayon = { workspace = true }
criterion = { workspace = true }
chroma-benchmark-datasets = { workspace = true }
chroma-test = { workspace = true }
indicatif = "0.17.8"
anyhow = "1.0.89"

Expand Down
2 changes: 1 addition & 1 deletion rust/index/benches/dataset_utilities.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use chroma_benchmark_datasets::types::{FrozenQuerySubset, QueryDataset, RecordDataset};
use chroma_test::datasets::types::{FrozenQuerySubset, QueryDataset, RecordDataset};
use futures::TryFutureExt;
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};

Expand Down
7 changes: 3 additions & 4 deletions rust/index/benches/full_text.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use std::sync::Arc;

use anyhow::Result;
use chroma_benchmark_datasets::{
datasets::{ms_marco_queries::MicrosoftMarcoQueriesDataset, scidocs::SciDocsDataset},
types::RecordDataset,
};
use chroma_blockstore::{arrow::provider::ArrowBlockfileProvider, provider::BlockfileProvider};
use chroma_cache::{
cache::Cache,
Expand All @@ -15,6 +11,9 @@ use chroma_index::fulltext::{
types::{FullTextIndexReader, FullTextIndexWriter},
};
use chroma_storage::{local::LocalStorage, Storage};
use chroma_test::datasets::{
ms_marco_queries::MicrosoftMarcoQueriesDataset, scidocs::SciDocsDataset, types::RecordDataset,
};
use criterion::{black_box, criterion_group, criterion_main, Criterion, Throughput};
use futures::{StreamExt, TryStreamExt};
use tantivy::tokenizer::NgramTokenizer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "chroma-benchmark-datasets"
name = "chroma-test"
version = "0.1.0"
edition = "2021"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
pub mod types;
pub mod util;

pub mod ms_marco_queries;
pub mod scidocs;
pub mod wikipedia;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashMap, path::PathBuf};

use crate::{
use super::{
types::{QueryDataset, Record, RecordDataset},
util::get_or_populate_cached_dataset_file,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashMap, path::PathBuf};

use crate::{
use super::{
types::{Record, RecordDataset},
util::get_or_populate_cached_dataset_file,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tantivy::{
use tokio::io::AsyncWriteExt;
use tokio_stream::{Stream, StreamExt};

use crate::util::{get_dir_for_persistent_dataset_files, get_or_populate_cached_dataset_file};
use super::util::{get_dir_for_persistent_dataset_files, get_or_populate_cached_dataset_file};

#[derive(Debug, Clone)]
pub struct Record {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tokio::{fs::File, io::AsyncBufReadExt};
use tokio_stream::wrappers::LinesStream;
use tokio_util::io::StreamReader;

use crate::{
use super::{
types::{Record, RecordDataset},
util::get_or_populate_cached_dataset_file,
};
Expand Down
1 change: 1 addition & 0 deletions rust/test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod datasets;

0 comments on commit 200c0c4

Please sign in to comment.