Repository navigation
1.6.0
What's new
- Roughly 2x search throughput on torch >= 2.8 — the bucket-indices lookup table in
ResidualCodecis now stored asUint8instead ofInt64. torch 2.8.0 rerouted CUDAindex_selectthroughgather_outfor more than 16 indices, which collapses on a smallint64table gathered with millions of indices: the[256, keys_per_byte]table cost about 6.3 ms per query on an H100, the largest single cost in the search pipeline. Storing it asUint8keeps the fast kernel on every torch version and drops an 80/160 MB int64 intermediate per query. Measured on FiQA (57,638 documents, H100, torch 2.9.0): 85 QPS to 167 QPS, batch-64 latency 12.1 ms/q to 6.3 ms/q, NDCG@10 unchanged at 0.412 with top-10 overlap 1.0000.
The table is built at load time from nbits, so the index format is unchanged and existing indexes benefit without rebuilding. Results are bit-identical: the values are bucket indices in 0..2^nbits-1, which top out at 255 for the largest usable nbits, and the one consumer already cast the gather result to Uint8.
See PR #50 for details, and #48 for the investigation behind it.