Closed JCBrouwer closed 6 months ago
Ahh I think I've found it!
pairwise_distances.Kmin_argKmin(k, dim=1, enable_chunks=True, backend="CPU")
Hi @JCBrouwer ,
Yes indeed the option backend="CPU"
is what you need to do. Also, the option enable_chunks=True
is useless in CPU mode, it is only used for GPU computing.
Hello, I'm trying to use KeOps to calculate nearest neighbors on large datasets using the following code:
Most of the time this works like a charm, but sometimes I'm getting the below error related to CUDA running out of memory.
I'm pretty sure that the calculation is not actually being run on GPU as my script doesn't appear in
nvidia-smi
.Could this be something to do with pinning GPU memory?
Is there a way to force KeOps to only use the CPU for certain operations?
I can set the entire script to ignore GPU like recommended here: https://github.com/getkeops/keops/issues/176
However, I would like other parts of my computation to use my GPUs, so I would rather only disable them for this section of code.
There does seem to be a kind of global
SetBackend()
class and aset_device
function intorch/generic/generic_red.py
, but I can't figure out how I would use them in the above code.Any help would be appreciated!