When i use GPU IVFPQ train, the program throw an exception. I read the faiss code,
isSupportedPQCodeLength function max only support 96, but my pq size is 208.
terminate called after throwing an instance of 'faiss::FaissException'
what(): Error in void faiss::gpu::GpuIndexIVFPQ::verifySettings_() const at gpu/GpuIndexIVFPQ.cu:407: Error: 'IVFPQ::isSupportedPQCodeLength(subQuantizers_)' failed: Number of bytes per encoded vector / sub-quantizers (208) is not supported
bool
IVFPQ::isSupportedPQCodeLength(int size) {
switch (size) {
case 1:
case 2:
case 3:
case 4:
case 8:
case 12:
case 16:
case 20:
case 24:
case 28:
case 32:
case 40:
case 48:
case 56: // only supported with float16
case 64: // only supported with float16
case 96: // only supported with float16
return true;
default:
return false;
}
}
Only a limited set of predefined code sizes are supported.
Have you considered using a pre-processing to reduce the code dimensionality?
https://github.com/facebookresearch/faiss/wiki/Pre--and-post-processing#pre-transforming-the-data
Due to GPU shared memory limitations (48 KiB per CTA), PQ on the GPU is restricted to 48, or 96 if useFloat16LookupTables is true (though this latter one may impact accuracy)
https://github.com/facebookresearch/faiss/blob/master/gpu/GpuIndexIVFPQ.h#L30
Thank you.