RaBitQ Library 0.8.5¶
This release prepares for 0.9: it adds the names that 0.9 will use and deprecates the 0.8 spellings they replace. Every 0.8 call keeps working, with the same results; index files and C++ are unchanged.
Python: names that change in 0.9¶
0.9 gives the three index classes one name for each concept (#232). This release
accepts both spellings and raises a DeprecationWarning for the old one, at your call
site. The migration guide lists each change.
HnswIndex.capacityreplacesmax_elements, andHnswIndex.reserve(num_points)replacesresize.reserveonly grows the capacity.max_elementsis deprecated onIvfIndexandSymqgIndex; usenum_stored_points.IvfIndex.reserve_cluster(cluster_id, num_points)replacesreserve.IvfIndex(routing=...)andindex.routingreplaceinitializer.HnswIndex.searchandSymqgIndex.searchtakeef_search=instead ofef=. Passing the breadth by position is unaffected.- Passing the
searchoptions after the breadth (high_accuracy,num_threads) by position is deprecated; 0.9 makes them keyword-only. nprobe=0andef_search=0for the default are deprecated; passNoneor omit the argument.num_threads=0keeps meaning every available CPU.HnswIndexseeds above2**32 - 1are deprecated.
The k-means classes take the names of the index parameters (#233):
QGKMeansandQGKMeansParameterstakenbits(32, 4 or 8),max_degreeandef_constructionforquantization_bits(0, 4 or 8),graph_degreeandef_build.final_assignmenttakes'approximate'or'exact', also asindex.cp.final_assignmentonIvfIndexandHnswIndex.FinalAssignmentModemembers are still accepted, and the attribute still reads back as a member until 0.9.KMeansIterationStatsis the one name of the statistics class.QGKMeansIterationStats,RaBitQKMeansIterationStatsandFinalAssignmentModewarn when imported or read from the package. The class now reports its name asKMeansIterationStats.
The type stubs mark the renamed 0.8 forms as deprecated, so mypy and Pyright can
report them (mypy with --enable-error-code deprecated, Pyright with
reportDeprecated). Three forms warn only at run time: nprobe=0 or ef_search=0,
an HnswIndex seed above 2**32 - 1, and the two old names of
KMeansIterationStats.
Python: other changes¶
IvfIndex.set_centroidstakesnum_threads(#231). Without it,set_centroidsnow followsOMP_NUM_THREADS, astrainandadddo; before, it always used every CPU. Only the HNSW routing graph varies with the thread count: build it with one thread and a fixedseedfor a reproducible graph.
Coming in 0.9 without a warning¶
HnswIndex()withoutseed=will draw a seed, asIvfIndexandSymqgIndexdo, instead of using 100. Passseed=, andnum_threads=1toadd, for a reproducible build.repr(index)will printcapacity=androuting=where it printsmax_elements=andinitializer=.cp.final_assignmentwill read back as'approximate'or'exact'instead of aFinalAssignmentModemember.
Upgrading¶
From 0.8.4, index file formats, the stable core API v1 and C++ are unchanged, and every
0.8 Python call keeps its result. Code that uses a deprecated spelling now raises a
DeprecationWarning; move to the new names with the
migration guide before 0.9 removes the old ones.
Rebuild C++ consumers with matching headers and libraries; no cross-version C++ binary
ABI is promised.
When upgrading from 0.7, follow the 0.8.0 release notes and the migration guide.