This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: import numpy as np | |
In [2]: import faiss | |
Failed to load GPU Faiss: No module named swigfaiss_gpu | |
Faiss falling back to CPU-only. | |
In [3]: import time | |
In [4]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OMP_WAIT_POLICY=PASSIVE ipython | |
Python 2.7.5 (default, Nov 6 2016, 00:28:07) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 3.2.1 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object', use 'object??' for extra details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import time | |
import faiss | |
import os | |
################################################################# | |
# I/O functions | |
################################################################# | |
def ivecs_read(fname): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[matthijs@matthijs-mbp ~/Desktop/test_cmake/faiss/build]cmake -DCMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-6 .. | |
-- The C compiler identification is AppleClang 8.0.0.8000042 | |
-- The CXX compiler identification is GNU 6.3.0 | |
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc | |
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works | |
-- Detecting C compiler ABI info | |
-- Detecting C compiler ABI info - done | |
-- Detecting C compile features | |
-- Detecting C compile features - done | |
-- Checking whether CXX compiler has -isysroot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/faiss/swigfaiss.swig b/faiss/swigfaiss.swig | |
--- a/faiss/swigfaiss.swig | |
+++ b/faiss/swigfaiss.swig | |
@@ -548,6 +548,10 @@ | |
return NULL; | |
} | |
+float * cast_integer_to_float_ptr (long x) { | |
+ return (float*)x; | |
+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import torch | |
import faiss | |
# make a GPU index | |
d = 16 | |
nq = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2 | |
import numpy as np | |
import faiss | |
import time | |
xd = 100 | |
yd = 1000000 | |
np.random.seed(1234) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ Copyright 2004-present Facebook. All Rights Reserved. | |
Load the dynamic library involved in swig calls for Faiss | |
+ some code to convert input / output arguments | |
the standard way of importing this is | |
swigfaiss = require 'faiss_swig' | |
if you require 'swigfaiss' directly, you get the indexing | |
structures without the additions that make them easy to use from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matthijs@devfair004:~/faiss_py3_cuda9/gpu$ make -j10 | |
g++ -std=c++11 -fPIC -m64 -Wall -g -Wno-sign-compare -O3 -fopenmp \ | |
-c GpuResources.cpp -o GpuResources.o -I/public/apps/cuda/9.0//include | |
g++ -std=c++11 -fPIC -m64 -Wall -g -Wno-sign-compare -O3 -fopenmp \ | |
-c IndexProxy.cpp -o IndexProxy.o -I/public/apps/cuda/9.0//include | |
g++ -std=c++11 -fPIC -m64 -Wall -g -Wno-sign-compare -O3 -fopenmp \ | |
-c StandardGpuResources.cpp -o StandardGpuResources.o -I/public/apps/cuda/9.0//include | |
g++ -std=c++11 -fPIC -m64 -Wall -g -Wno-sign-compare -O3 -fopenmp \ | |
-c GpuAutoTune.cpp -o GpuAutoTune.o -I/public/apps/cuda/9.0//include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matthijs@devfair0144:~/faiss_versions/alex_bug$ /public/apps/cuda/8.0//bin/nvcc -I. -I /public/apps/cuda/8.0//targets/x86_64-linux/include/ -Xcompiler -fPIC -Xcudafe --diag_suppress=unrecognized_attribute -gencode arch=compute_60,code="compute_60" -gencode arch=compute_61,code="compute_61" --std c++11 -lineinfo -ccbin g++ -DFAISS_USE_FLOAT16 -o tt tt.cpp faiss/gpu/libgpufaiss.a faiss/libfaiss.a -Xcompiler -fopenmp -lcublas -Xlinker --no-as-needed -Xlinker -rpath,/public/apps/anaconda2/5.0.1/lib/ -L/public/apps/anaconda2/5.0.1/lib/ -lmkl_intel_lp64 -lmkl_core -lmkl_gnu_thread -ldl -lpthread | |
matthijs@devfair0144:~/faiss_versions/alex_bug$ ./tt | |
Faiss assertion 'err__ == cudaSuccess' failed in faiss::gpu::DeviceTensor<T, Dim, InnerContig, IndexT, PtrTraits>::~DeviceTensor() [with T = float; int Dim = 3; bool InnerContig = true; IndexT = int; PtrTraits = faiss::gpu::traits::DefaultPtrTraits] at impl/../utils/DeviceTensor-inl.cuh:61; details: CUDA error 77 | |
Aborted |
OlderNewer