Skip to content

[BUG] Remove num_threads from server return #4327

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 0 additions & 2 deletions chromadb/test/configurations/test_collection_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def test_hnsw_configuration_updates(client: ClientAPI) -> None:
hnsw_config = loaded_config.get("hnsw", {})
if isinstance(hnsw_config, dict):
assert hnsw_config.get("ef_search") == 20
assert hnsw_config.get("num_threads") == 2
assert hnsw_config.get("space") == "cosine"
assert hnsw_config.get("ef_construction") == 100
assert hnsw_config.get("max_neighbors") == 16
Expand Down Expand Up @@ -337,7 +336,6 @@ def test_configuration_result_format(client: ClientAPI) -> None:
hnsw_config = coll._model.configuration_json.get("hnsw")
assert hnsw_config is not None
assert hnsw_config.get("ef_search") == 10
assert hnsw_config.get("num_threads") == 2
assert hnsw_config.get("space") == "cosine"


Expand Down
6 changes: 0 additions & 6 deletions clients/js/packages/chromadb-core/src/generated/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,6 @@ export namespace Api {
* minimum: 0
*/
max_neighbors?: number;
/**
* @type {number}
* @memberof HnswConfiguration
* minimum: 0
*/
num_threads?: number;
/**
* @type {number}
* @memberof HnswConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(100);
expect(collection.configuration?.hnsw?.max_neighbors).toBe(10);
expect(collection.configuration?.hnsw?.ef_search).toBe(20);
expect(collection.configuration?.hnsw?.num_threads).toBe(2);
});

test("it should get a collection with configuration", async () => {
Expand Down Expand Up @@ -67,7 +66,6 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(150);
expect(collection.configuration?.hnsw?.max_neighbors).toBe(15);
expect(collection.configuration?.hnsw?.ef_search).toBe(100);
expect(collection.configuration?.hnsw?.num_threads).toBeGreaterThan(0);
});

test("it should update a collection configuration", async () => {
Expand All @@ -84,7 +82,6 @@ describe("collection operations", () => {
});

expect(collection.configuration?.hnsw?.ef_search).toBe(10);
expect(collection.configuration?.hnsw?.num_threads).toBe(1);

// Update configuration
const updateConfig: UpdateCollectionConfiguration = {
Expand All @@ -108,7 +105,6 @@ describe("collection operations", () => {
expect(updatedCollection.configuration).toBeDefined();
expect(updatedCollection.configuration).toHaveProperty("hnsw");
expect(updatedCollection.configuration?.hnsw?.ef_search).toBe(20);
expect(updatedCollection.configuration?.hnsw?.num_threads).toBe(2);
expect(updatedCollection.configuration?.hnsw?.space).toBe("cosine");
expect(updatedCollection.configuration?.hnsw?.ef_construction).toBe(100);
expect(updatedCollection.configuration?.hnsw?.max_neighbors).toBe(16);
Expand Down Expand Up @@ -145,7 +141,6 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(100); // Default
expect(collection.configuration?.hnsw?.max_neighbors).toBe(16); // Default
expect(collection.configuration?.hnsw?.ef_search).toBe(100); // Default
expect(collection.configuration?.hnsw?.num_threads).toBeGreaterThan(0); // Default > 0
});

test("it should apply defaults for unspecified hnsw params (space)", async () => {
Expand All @@ -160,7 +155,6 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(100); // Default
expect(collection.configuration?.hnsw?.max_neighbors).toBe(16); // Default
expect(collection.configuration?.hnsw?.ef_search).toBe(100); // Default
expect(collection.configuration?.hnsw?.num_threads).toBeGreaterThan(0); // Default > 0
});

test("it should apply defaults for unspecified hnsw params (ef_construction)", async () => {
Expand All @@ -175,7 +169,6 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(200); // Specified
expect(collection.configuration?.hnsw?.max_neighbors).toBe(16); // Default
expect(collection.configuration?.hnsw?.ef_search).toBe(100); // Default
expect(collection.configuration?.hnsw?.num_threads).toBeGreaterThan(0); // Default > 0
});

test("it should apply defaults for unspecified hnsw params (max_neighbors)", async () => {
Expand All @@ -190,7 +183,6 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(100); // Default
expect(collection.configuration?.hnsw?.max_neighbors).toBe(32); // Specified
expect(collection.configuration?.hnsw?.ef_search).toBe(100); // Default
expect(collection.configuration?.hnsw?.num_threads).toBeGreaterThan(0); // Default > 0
});

test("it should apply defaults for unspecified hnsw params (ef_search)", async () => {
Expand All @@ -205,7 +197,6 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(100); // Default
expect(collection.configuration?.hnsw?.max_neighbors).toBe(16); // Default
expect(collection.configuration?.hnsw?.ef_search).toBe(50); // Specified
expect(collection.configuration?.hnsw?.num_threads).toBeGreaterThan(0); // Default > 0
});

test("it should apply defaults for unspecified hnsw params (num_threads)", async () => {
Expand All @@ -220,6 +211,5 @@ describe("collection operations", () => {
expect(collection.configuration?.hnsw?.ef_construction).toBe(100); // Default
expect(collection.configuration?.hnsw?.max_neighbors).toBe(16); // Default
expect(collection.configuration?.hnsw?.ef_search).toBe(100); // Default
expect(collection.configuration?.hnsw?.num_threads).toBe(4); // Specified
});
});
1 change: 1 addition & 0 deletions rust/types/src/hnsw_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pub struct HnswConfiguration {
#[serde(default = "default_m")]
pub max_neighbors: usize,
#[serde(default = "default_num_threads")]
#[serde(skip_serializing)]
pub num_threads: usize,
#[serde(default = "default_resize_factor")]
pub resize_factor: f64,
Expand Down
Loading