getkeops / keops

KErnel OPerationS, on CPUs and GPUs, with autodiff and without memory overflows
https://www.kernel-operations.io
MIT License
1.06k stars 64 forks source link

Not compiled with cuda support? #128

Closed Xparx closed 3 years ago

Xparx commented 3 years ago

I managed to install keops in a viritual environment on ubuntu 20.04 I'm using python3.8 and managed to downgrade gcc to use version 8 rather than 9. After that I could try to compile the knn example. It seems to compile correctly but running it results in the following error:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-12-1294040a24ae> in <module>
     14     X_j = LazyTensor(x[None, :, :])  # (1, N, 2)
     15     D_ij = ((G_i - X_j) ** 2).sum(-1)  # (M**2, N) symbolic matrix of squared distances
---> 16     indKNN = D_ij.argKmin(K, dim=1)  # Grid <-> Samples, (M**2, K) integer tensor
     17 
     18     clg = cl[indKNN].float().mean(1) > 0.5  # Classify the Grid points

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/common/lazy_tensor.py in argKmin(self, K, axis, dim, **kwargs)
   1730 
   1731         """
-> 1732         return self.reduction("ArgKMin", opt_arg=K, axis=axis, dim=dim, **kwargs)
   1733 
   1734     def argKmin_reduction(self, **kwargs):

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/common/lazy_tensor.py in reduction(self, reduction_op, other, opt_arg, axis, dim, call, **kwargs)
    549                                      res.dtype, res.opt_arg, res.formula2, **kwargs_init, rec_multVar_highdim=res.rec_multVar_highdim)
    550         if call and len(res.symbolic_variables) == 0 and res.dtype is not None:
--> 551             return res()
    552         else:
    553             return res

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/common/lazy_tensor.py in __call__(self, *args, **kwargs)
    703             args = (self.other.variables[0],)
    704 
--> 705         return self.callfun(*args, *self.variables, **self.kwargs)
    706 
    707     def __str__(self):

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in __call__(self, backend, device_id, ranges, *args)
    419             args, ranges, tag_dummy, N = preprocess_half2(args, self.aliases, self.axis, ranges, nx, ny)
    420 
--> 421         out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype, 
    422                                    device_id, ranges, self.optional_flags, self.rec_multVar_highdim, *args)
    423 

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in forward(ctx, formula, aliases, backend, dtype, device_id, ranges, optional_flags, rec_multVar_highdim, *args)
     52         ranges = tuple(r.contiguous() for r in ranges)
     53 
---> 54         result = myconv.genred_pytorch(tagCPUGPU, tag1D2D, tagHostDevice, device_id, ranges, *args)
     55 
     56         # relying on the 'ctx.saved_variables' attribute is necessary  if you want to be able to differentiate the output

RuntimeError: [KeOps] This KeOps shared object has been compiled without cuda support: 
 1) to perform computations on CPU, simply set tagHostDevice to 0
 2) to perform computations on GPU, please recompile the formula with a working version of cuda.

I'm not sure where to go from here. running

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

Any help would be appreciated.

I also looked into the test your install section. Running:

import pykeops
pykeops.clean_pykeops()          # just in case old build files are still present
pykeops.test_numpy_bindings()    # perform the compilation

results in

Cleaning /home/at145/.cache/pykeops-1.4.2-cpython-38/...
    - /home/at145/.cache/pykeops-1.4.2-cpython-38/keops_hash.log has been removed.
    - /home/at145/.cache/pykeops-1.4.2-cpython-38/libKeOpstorchc2fef3a189.cpython-38-x86_64-linux-gnu.so has been removed.
    - /home/at145/.cache/pykeops-1.4.2-cpython-38/libKeOpsnumpy62aa698999.cpython-38-x86_64-linux-gnu.so has been removed.
    - /home/at145/.cache/pykeops-1.4.2-cpython-38/libKeOpstorchc2fef3a189.so has been removed.
    - /home/at145/.cache/pykeops-1.4.2-cpython-38/libKeOpsnumpy62aa698999.so has been removed.
Compiling libKeOpsnumpyd2a7c7c3d2 in /home/at145/.cache/pykeops-1.4.2-cpython-38:
       formula: Sum_Reduction(SqNorm2(x - y),1)
       aliases: x = Vi(0,3); y = Vj(1,3); 
       dtype  : float64

but crashes the jupyter-kernel. The torch gpu version results in the same error as above

import pykeops
pykeops.clean_pykeops()          # just in case old build files are still present
pykeops.test_torch_bindings()    # perform the compilation

results in:

Cleaning /home/login_user/.cache/pykeops-1.4.2-cpython-38/...
    - /home/login_user/.cache/pykeops-1.4.2-cpython-38/libKeOpsnumpyd2a7c7c3d2.so has been removed.
    - /home/login_user/.cache/pykeops-1.4.2-cpython-38/keops_hash.log has been removed.
    - /home/login_user/.cache/pykeops-1.4.2-cpython-38/libKeOpsnumpyd2a7c7c3d2.cpython-38-x86_64-linux-gnu.so has been removed.
Compiling libKeOpstorch2441edd9d8 in /home/login_user/.cache/pykeops-1.4.2-cpython-38:
       formula: Sum_Reduction(SqNorm2(x - y),1)
       aliases: x = Vi(0,3); y = Vj(1,3); 
       dtype  : float32
... Done.
Compiling libKeOpstorch2441edd9d8 in /home/login_user/.cache/pykeops-1.4.2-cpython-38:
       formula: Sum_Reduction(SqNorm2(x - y),1)
       aliases: x = Vi(0,3); y = Vj(1,3); 
       dtype  : float32
... -- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- No CUDA support
-- Using shared_obj_name: libKeOpstorch2441edd9d8
-- First i variables detected is 0
-- First j variables detected is 1
-- Compiled formula is Sum_Reduction(SqNorm2(x - y),1); auto x = Vi(0,3); auto y = Vj(1,3);  where the number of args is 2.
-- pybind11 v2.6.1 
-- Found PythonInterp: /home/login_user/.virtualenvs/keops_test/bin/python3 (found suitable version "3.8.5", minimum required is "3.8") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8

/usr/bin/cmake -S/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops -B/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make -f CMakeFiles/Makefile2 libKeOpstorch2441edd9d8
make[1]: Entering directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
/usr/bin/cmake -S/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops -B/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles 4
/usr/bin/make -f CMakeFiles/Makefile2 CMakeFiles/libKeOpstorch2441edd9d8.dir/all
make[2]: Entering directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
/usr/bin/make -f CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/build.make CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/depend
make[3]: Entering directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
cd /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/DependInfo.cmake --color=
Dependee "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/DependInfo.cmake" is newer than depender "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/depend.internal".
Dependee "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/depend.internal".
Scanning dependencies of target keopslibKeOpstorch2441edd9d8
make[3]: Leaving directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
/usr/bin/make -f CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/build.make CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/build
make[3]: Entering directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
[ 25%] Building CXX object CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/keops/core/link_autodiff.cpp.o
/usr/bin/c++  -DC_CONTIGUOUS=1 -DENABLECHUNK=1 -DMODULE_NAME=libKeOpstorch2441edd9d8 -DSUM_SCHEME=1 -DUSE_CUDA=0 -DUSE_DOUBLE=0 -DUSE_HALF=0 -D_GLIBCXX_USE_CXX11_ABI=0 -D__TYPEACC__=float -D__TYPE__=float -DkeopslibKeOpstorch2441edd9d8_EXPORTS -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/keops -I/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/torch/include -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/torch/include/torch/csrc/api/include  -DUSE_OPENMP -fopenmp -Wall -Wno-unknown-pragmas -fmax-errors=2 -g -O0 -g -fPIC   -include libKeOpstorch2441edd9d8.h -std=gnu++17 -o CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/keops/core/link_autodiff.cpp.o -c /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/keops/core/link_autodiff.cpp
[ 50%] Linking CXX shared library libKeOpstorch2441edd9d8.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC  -DUSE_OPENMP -fopenmp -Wall -Wno-unknown-pragmas -fmax-errors=2 -g -O0 -g  -shared -Wl,-soname,libKeOpstorch2441edd9d8.so -o libKeOpstorch2441edd9d8.so CMakeFiles/keopslibKeOpstorch2441edd9d8.dir/keops/core/link_autodiff.cpp.o 
/usr/bin/cmake -E copy /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/libKeOpstorch2441edd9d8.so /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/../
make[3]: Leaving directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
[ 50%] Built target keopslibKeOpstorch2441edd9d8
/usr/bin/make -f CMakeFiles/libKeOpstorch2441edd9d8.dir/build.make CMakeFiles/libKeOpstorch2441edd9d8.dir/depend
make[3]: Entering directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
cd /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/libKeOpstorch2441edd9d8.dir/DependInfo.cmake --color=
Dependee "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/libKeOpstorch2441edd9d8.dir/DependInfo.cmake" is newer than depender "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/libKeOpstorch2441edd9d8.dir/depend.internal".
Dependee "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles/libKeOpstorch2441edd9d8.dir/depend.internal".
Scanning dependencies of target libKeOpstorch2441edd9d8
make[3]: Leaving directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
/usr/bin/make -f CMakeFiles/libKeOpstorch2441edd9d8.dir/build.make CMakeFiles/libKeOpstorch2441edd9d8.dir/build
make[3]: Entering directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
[ 75%] Building CXX object CMakeFiles/libKeOpstorch2441edd9d8.dir/torch/generic/generic_red.cpp.o
/usr/bin/c++  -DC_CONTIGUOUS=1 -DENABLECHUNK=1 -DMODULE_NAME=libKeOpstorch2441edd9d8 -DSUM_SCHEME=1 -DUSE_CUDA=0 -DUSE_DOUBLE=0 -DUSE_HALF=0 -D_GLIBCXX_USE_CXX11_ABI=0 -D__TYPEACC__=float -D__TYPE__=float -DlibKeOpstorch2441edd9d8_EXPORTS -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/keops -I/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/torch/include -I/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/login_user/.virtualenvs/keops_test/include/python3.8 -isystem /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/pybind11/include  -DUSE_OPENMP -fopenmp -Wall -Wno-unknown-pragmas -fmax-errors=2 -g -O0 -g -fPIC -fvisibility=hidden   -include torch_headers.h -std=gnu++17 -o CMakeFiles/libKeOpstorch2441edd9d8.dir/torch/generic/generic_red.cpp.o -c /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.cpp
[100%] Linking CXX shared module libKeOpstorch2441edd9d8.cpython-38-x86_64-linux-gnu.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/libKeOpstorch2441edd9d8.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC  -DUSE_OPENMP -fopenmp -Wall -Wno-unknown-pragmas -fmax-errors=2 -g -O0 -g -Wl,-rpath,$ORIGIN -shared  -o libKeOpstorch2441edd9d8.cpython-38-x86_64-linux-gnu.so CMakeFiles/libKeOpstorch2441edd9d8.dir/torch/generic/generic_red.cpp.o  -Wl,-rpath,/home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/torch/lib:/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8 /home/login_user/.virtualenvs/keops_test/lib/python3.8/site-packages/torch/lib/libtorch_python.so libKeOpstorch2441edd9d8.so 
/usr/bin/cmake -E copy /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/libKeOpstorch2441edd9d8.cpython-38-x86_64-linux-gnu.so /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/../
make[3]: Leaving directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
[100%] Built target libKeOpstorch2441edd9d8
make[2]: Leaving directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'
/usr/bin/cmake -E cmake_progress_start /home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8/CMakeFiles 0
make[1]: Leaving directory '/home/login_user/.cache/pykeops-1.4.2-cpython-38/build-libKeOpstorch2441edd9d8'

Done.
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/test/install.py in test_torch_bindings()
     56     my_conv = pktorch.Genred(formula, var)
---> 57     if torch.allclose(my_conv(x, y).view(-1), torch.tensor(expected_res).type(torch.float32)):
     58       print("\npyKeOps with torch bindings is working!\n")

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in __call__(self, backend, device_id, ranges, *args)
    420 
--> 421         out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype, 
    422                                    device_id, ranges, self.optional_flags, self.rec_multVar_highdim, *args)

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in forward(ctx, formula, aliases, backend, dtype, device_id, ranges, optional_flags, rec_multVar_highdim, *args)
     53 
---> 54         result = myconv.genred_pytorch(tagCPUGPU, tag1D2D, tagHostDevice, device_id, ranges, *args)
     55 

RuntimeError: [KeOps] This KeOps shared object has been compiled without cuda support: 
 1) to perform computations on CPU, simply set tagHostDevice to 0
 2) to perform computations on GPU, please recompile the formula with a working version of cuda.

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
<ipython-input-1-9c28a002d77a> in <module>
      1 import pykeops
      2 pykeops.clean_pykeops()          # just in case old build files are still present
----> 3 pykeops.test_torch_bindings()    # perform the compilation

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/test/install.py in test_torch_bindings()
     66     pykeops.config.build_type = "Debug"
     67     my_conv = pktorch.Genred(formula, var)
---> 68     print(my_conv(x, y))
     69 

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in __call__(self, backend, device_id, ranges, *args)
    419             args, ranges, tag_dummy, N = preprocess_half2(args, self.aliases, self.axis, ranges, nx, ny)
    420 
--> 421         out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype, 
    422                                    device_id, ranges, self.optional_flags, self.rec_multVar_highdim, *args)
    423 

~/.virtualenvs/keops_test/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in forward(ctx, formula, aliases, backend, dtype, device_id, ranges, optional_flags, rec_multVar_highdim, *args)
     52         ranges = tuple(r.contiguous() for r in ranges)
     53 
---> 54         result = myconv.genred_pytorch(tagCPUGPU, tag1D2D, tagHostDevice, device_id, ranges, *args)
     55 
     56         # relying on the 'ctx.saved_variables' attribute is necessary  if you want to be able to differentiate the output

RuntimeError: [KeOps] This KeOps shared object has been compiled without cuda support: 
 1) to perform computations on CPU, simply set tagHostDevice to 0
 2) to perform computations on GPU, please recompile the formula with a working version of cuda.
Xparx commented 3 years ago

Looking at the error closely it looks like even though i did update-alternatives to gcc version 8.4 for gcc, keops keeps picking cpp version 9.3.0 anyway. Update alternatives for cpp to version 8 did not change much.

Xparx commented 3 years ago

So after some fiddling it turns out that version 8 of gcc and g++ are not the same. To make it work I had to update-alternative for both. or at least the first part worked with gcc <9 and the second error got fixed with g++ < 9. At least it is not throwing an error at me.

jeanfeydy commented 3 years ago

Hi @Xparx ,

Thanks for your interest in the library! Indeed, this gcc/g++ confusion is a common issue: I will make it more explicit in the doc. I understand that you solved your configuration issue, with everything now working as expected. Is that correct?

On a side note, I also see that you are a genomics expert, which is very interesting :-) Would you have any feature request for the library, e.g. for string kernels, etc.? We're planning to add support for "combinatorial" formulas soon, but don't really know what types of operations would be most relevant for the genomics community. If you could suggest us some references on the subject, this would be very helpful!

Best regards, Jean

Xparx commented 3 years ago

Thanks for the quick reply! I did manged to fix the issue I had. Will delve deeper as I have a specific application I want to try to use keops for when time allows (https://gitlab.com/Xparx/dewakss).

I can see the application of keops to some "genomics area" problems but it was a while since I worked with sequences specifically to any degree so my references are not very relevant but I would be happy getting back to you with this ones I mulled if over or I run into any problems that might be fitting.

jeanfeydy commented 3 years ago

I see, thanks a lot for your link! Biologist friends of mine are working with single-cell RNA sequencing data on a daily basis, and I'd be very interested to see what types of methods will be designed to handle these problems. In the short term (i.e. for the summer), our first priority will be to provide better support for UMAP and the K-NN descent algorithm, but we'd be happy to provide the necessary routines for advanced methods too.

Since your compilation problem has been solved, I'm closing the issue now - but please feel free to open a new discussion if you have any other question or feature request in the future.

Best regards, Jean

Xparx commented 3 years ago

Single cell data is definitely the de facto standard at this point for high throughput expression data in biology. The largest dataset is of the size of millions of individual cells which is not possible to handle for my method currently. So an efficient knn method would be very interesting to me. I was wondering how you were handling that currently as your knn method looks pretty fast based on your benchmarks even though they are of a somewhat low dimension in those examples.

If you manage to get the descent algorithm implemented I would suggest keeping the knn part separate from the projection component of umap. This is how it is currently setup in the scanpy package and makes it possible to compute a knn for any arbitrary purpose without extra fluff.

Many thanks

GangLiTarheel commented 2 years ago

Hi I met the same problem and try the code above to install pykeops-1.6 to solve this. It seems to work well with the test_torch_bindings example but fails with test_numpy_bindings. The error information (Error when compiling formula.) is too short. May I ask if you have any insights on how to fix it? See my output for two tests below.

test_numpy_bindings:

[KeOps] ../.cache/keops/build has been cleaned.
[KeOps] Compiling main dll ... OK
[KeOps] Compiling formula Sum_Reduction((Var(0,3,0)-Var(1,3,1))|(Var(0,3,0)-Var(1,3,1)),1) ... 
[KeOps] Error when compiling formula.

test_torch_bindings:

[KeOps] /.cache/keops/build has been cleaned.
[KeOps] Compiling formula Sum_Reduction((Var(0,3,0)-Var(1,3,1))|(Var(0,3,0)-Var(1,3,1)),1) ... OK
/.local/lib/python3.7/site-packages/torch/cuda/__init__.py:80: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 9010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at  ./c10/cuda/CUDAFunctions.cpp:112.)
  return torch._C._cuda_getDeviceCount() > 0
pyKeOps with torch bindings is working!

I am using Cuda V11.5.119 and g++ (GCC) 10.2.0.