From 8afe20ec42f90d9111590d19a3a05921deebb75e Mon Sep 17 00:00:00 2001 From: Amir Sadoughi Date: Thu, 12 Dec 2024 10:45:07 -0800 Subject: [PATCH] Update __init__.py (#2628) Summary: Pull Request resolved: https://github.com/pytorch/torchrec/pull/2628 Fix erroneous logging `Failed to load GPU Faiss: No module named 'swigfaiss_gpu'. Will not load constructor refs for GPU indexes.` when I was running on a GPU-based index just fine. `GpuIndex...` is loaded via loader.py. X-link: https://github.com/facebookresearch/faiss/pull/4086 Test Plan: before ``` (faiss_gpu_cuvs_nightly) [sadoughi@devvm15198.frc0 ~]$ python3 script.py Failed to load GPU Faiss: No module named 'swigfaiss_gpu'. Will not load constructor refs for GPU indexes. ``` after ``` (faiss_gpu_cuvs_nightly) [sadoughi@devvm15198.frc0 ~]$ python3 Python 3.12.8 | packaged by conda-forge | (main, Dec 5 2024, 14:24:40) [GCC 13.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import faiss >>> ``` Reviewed By: mnorris11 Differential Revision: D67118292 Pulled By: asadoughi fbshipit-source-id: aa05aa20fe61e4ad75d4234f52e3b0d6a673a0b9 --- examples/retrieval/knn_index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/retrieval/knn_index.py b/examples/retrieval/knn_index.py index 81a5c7a37..9db4a6d7d 100644 --- a/examples/retrieval/knn_index.py +++ b/examples/retrieval/knn_index.py @@ -43,6 +43,7 @@ def get_index( res = faiss.StandardGpuResources() # pyre-fixme[16] config = faiss.GpuIndexIVFPQConfig() + # pyre-ignore[16] index = faiss.GpuIndexIVFPQ( res, embedding_dim,