Skip to content

1.6.0

Choose a tag to compare

@raphaelsty raphaelsty released this 05 Aug 10:23
· 6 commits to main since this release

What's new

  • Roughly 2x search throughput on torch >= 2.8 — the bucket-indices lookup table in ResidualCodec is now stored as Uint8 instead of Int64. torch 2.8.0 rerouted CUDA index_select through gather_out for more than 16 indices, which collapses on a small int64 table 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 as Uint8 keeps 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.