@@ -44,10 +44,11 @@ FastPlaid is available in multiple versions to support different PyTorch version
4444
4545| FastPlaid Version | PyTorch Version | Installation Command |
4646| ----------------- | --------------- | ----------------------------------- |
47- | 1.2.4.280 | 2.8.0 | ` pip install fast-plaid==1.2.4.280 ` |
48- | 1.2.4.271 | 2.7.1 | ` pip install fast-plaid==1.2.4.271 ` |
49- | 1.2.4.270 | 2.7.0 | ` pip install fast-plaid==1.2.4.270 ` |
50- | 1.2.4.260 | 2.6.0 | ` pip install fast-plaid==1.2.4.260 ` |
47+ | 1.2.5.290 | 2.9.0 | ` pip install fast-plaid==1.2.5.290 ` |
48+ | 1.2.5.280 | 2.8.0 | ` pip install fast-plaid==1.2.5.280 ` |
49+ | 1.2.5.271 | 2.7.1 | ` pip install fast-plaid==1.2.5.271 ` |
50+ | 1.2.5.270 | 2.7.0 | ` pip install fast-plaid==1.2.5.270 ` |
51+ | 1.2.5.260 | 2.6.0 | ` pip install fast-plaid==1.2.5.260 ` |
5152
5253### Adding FastPlaid as a Dependency
5354
@@ -56,23 +57,23 @@ You can add FastPlaid to your project dependencies with version ranges to ensure
5657** For requirements.txt:**
5758
5859```
59- fast-plaid>=1.2.4 .260,<=1.2.4.280
60+ fast-plaid>=1.2.5 .260,<=1.2.5.290
6061```
6162
6263** For pyproject.toml:**
6364
6465``` toml
6566[project ]
6667dependencies = [
67- " fast-plaid>=1.2.4 .260,<=1.2.4.280 "
68+ " fast-plaid>=1.2.5 .260,<=1.2.5.290 "
6869]
6970```
7071
7172** For setup.py:**
7273
7374``` python
7475install_requires= [
75- " fast-plaid>=1.2.4 .260,<=1.2.4.280 "
76+ " fast-plaid>=1.2.5 .260,<=1.2.5.290 "
7677]
7778```
7879
@@ -316,6 +317,7 @@ class FastPlaid:
316317 self ,
317318 index: str ,
318319 device: str | list[str ] | None = None ,
320+ preload_index: bool = True ,
319321 ) -> None :
320322```
321323
@@ -331,6 +333,11 @@ device: str | list[str] | None = None
331333 - Can be a list of device strings (e.g., [" cuda:0" , " cuda:1" ]).
332334 - If multiple GPUs are specified and available, multiprocessing is automatically set up for parallel execution.
333335 Remember to include your code within an `if __name__ == " __main__" :` block for proper multiprocessing behavior.
336+
337+ preload_index: bool = True (optional)
338+ If `True ` , the index will be loaded into memory upon initialization. This can
339+ speed up the first search operation by " warming up" the index. If `False ` ,
340+ the index will be loaded when doing the search and unloaded afterward.
334341```
335342
336343# ## Creating an Index
@@ -345,6 +352,7 @@ The **`create` method** builds the multi-vector index from your document embeddi
345352 max_points_per_centroid: int = 256 ,
346353 nbits: int = 4 ,
347354 n_samples_kmeans: int | None = None ,
355+ batch_size: int = 25_000 ,
348356 seed: int = 42 ,
349357 use_triton_kmeans: bool | None = None ,
350358 metadata: list[dict[str , Any]] | None = None ,
@@ -376,6 +384,9 @@ n_samples_kmeans: int | None = None (optional)
376384 clustering quality. If you have a large dataset, you might want to set this to a
377385 smaller value to speed up the indexing process and save some memory.
378386
387+ batch_size: int = 25_000 (optional)
388+ Batch size for processing embeddings during index creation.
389+
379390seed: int = 42 (optional)
380391 Seed for the random number generator used in index creation.
381392 Setting this ensures reproducible results across multiple runs.
@@ -402,6 +413,7 @@ The **`update` method** provides an efficient way to add new documents to an exi
402413 self ,
403414 documents_embeddings: list[torch.Tensor] | torch.Tensor,
404415 metadata: list[dict[str , Any]] | None = None ,
416+ batch_size: int = 25_000 ,
405417 ) -> " FastPlaid" :
406418```
407419
@@ -416,6 +428,9 @@ metadata: list[dict[str, Any]] | None = None
416428 Each dictionary can contain arbitrary key- value pairs that you want to associate with the document.
417429 If provided, the length of this list must match the number of new documents being added.
418430 The metadata will be stored in a SQLite database within the index directory for filtering during searches.
431+
432+ batch_size: int = 25_000 (optional)
433+ Batch size for processing embeddings during the update.
419434```
420435
421436# ## Searching the Index
@@ -427,7 +442,7 @@ The **`search` method** lets you query the created index with your query embeddi
427442 self ,
428443 queries_embeddings: torch.Tensor | list[torch.Tensor],
429444 top_k: int = 10 ,
430- batch_size: int = 1 << 18 ,
445+ batch_size: int = 25_000 ,
431446 n_full_scores: int = 4096 ,
432447 n_ivf_probe: int = 8 ,
433448 show_progress: bool = True ,
@@ -444,7 +459,7 @@ queries_embeddings: torch.Tensor | list[torch.Tensor]
444459top_k: int = 10 (optional)
445460 The number of top- scoring documents to retrieve for each query.
446461
447- batch_size: int = 1 << 18 (optional)
462+ batch_size: int = 25_000 (optional)
448463 The internal batch size used for processing queries.
449464 A larger batch size might improve throughput on powerful GPUs but can consume more memory.
450465
0 commit comments