def load_index(self, config):
        """Loads the FAISS index into GPU memory with sharding."""
        index_path = os.path.join(config.index_path, f'{config.retrieval_method}_Flat.index')
        index = faiss.read_index(index_path)

        if self.config.faiss_gpu:

            # Apply FAISS GPU settings
            co = faiss.GpuMultipleClonerOptions()
            co.useFloat16 = True  # Reduce memory footprint
            co.shard = True  # Distribute index across all GPUs
            
            print("[FAISSIndexServer] Moving FAISS index to all GPUs with sharding enabled...")
            index = faiss.index_cpu_to_all_gpus(index, co=co)

            print("[FAISSIndexServer] FAISS index successfully moved to GPUs.")
        return index
Loads the FAISS index into GPU memory with sharding.
verl/workers/retriever_workers.py