Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Spann works e2e on local tilt #3944

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions rust/frontend/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use chroma_types::{
CreateTenantError, CreateTenantRequest, CreateTenantResponse, DeleteCollectionError,
DeleteCollectionRecordsError, DeleteCollectionRecordsRequest, DeleteCollectionRecordsResponse,
DeleteCollectionRequest, DeleteDatabaseError, DeleteDatabaseRequest, DeleteDatabaseResponse,
DistributedHnswParameters, GetCollectionError, GetCollectionRequest, GetCollectionResponse,
DistributedHnswParameters, DistributedIndexType, DistributedIndexTypeParam,
DistributedSpannParameters, GetCollectionError, GetCollectionRequest, GetCollectionResponse,
GetCollectionsError, GetDatabaseError, GetDatabaseRequest, GetDatabaseResponse, GetRequest,
GetResponse, GetTenantError, GetTenantRequest, GetTenantResponse, HealthCheckResponse,
HeartbeatError, HeartbeatResponse, Include, ListCollectionsRequest, ListCollectionsResponse,
Expand Down Expand Up @@ -422,18 +423,36 @@ impl Frontend {
let collection_id = CollectionUuid::new();
let segments = match self.executor {
Executor::Distributed(_) => {
let hnsw_metadata =
Metadata::try_from(DistributedHnswParameters::try_from(&metadata)?)?;
let index_type = DistributedIndexTypeParam::try_from(&metadata)?;
let vector_segment = match index_type.index_type {
DistributedIndexType::Hnsw => {
let validated_metadata =
Metadata::try_from(DistributedHnswParameters::try_from(&metadata)?)?;
Segment {
id: SegmentUuid::new(),
r#type: SegmentType::HnswDistributed,
scope: SegmentScope::VECTOR,
collection: collection_id,
metadata: Some(validated_metadata),
file_path: Default::default(),
}
}
DistributedIndexType::Spann => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add some feature gating here?

let validated_metadata =
Metadata::try_from(DistributedSpannParameters::try_from(&metadata)?)?;
Segment {
id: SegmentUuid::new(),
r#type: SegmentType::Spann,
scope: SegmentScope::VECTOR,
collection: collection_id,
metadata: Some(validated_metadata),
file_path: Default::default(),
}
}
};

vec![
Segment {
id: SegmentUuid::new(),
r#type: SegmentType::HnswDistributed,
scope: SegmentScope::VECTOR,
collection: collection_id,
metadata: Some(hnsw_metadata),
file_path: Default::default(),
},
vector_segment,
Segment {
id: SegmentUuid::new(),
r#type: SegmentType::BlockfileMetadata,
Expand Down
Loading
Loading