Closed wjmaddox closed 3 years ago
I found a naive trick to make multiple parallel KeOps compilations run. The idea is to simply change the compilation folder in which KeOps operates.
import pykeops
import tempfile
with tempfile.TemporaryDirectory() as dirname:
pykeops.set_bin_folder(dirname)
# Run code that triggers compilation.
main()
The context manager makes sure to delete the temporary folder before exit. The downside is that now we do not benefit from existing cache, and the compilation always happens from scratch. The set_bin_folder
needs to be called before any KeOps compilation is triggered.
Closing due to this resolution.
Thanks everyone for pointing this and for the trick. The next keops version should have much smaller compilation times, making (in many cases) the lack of cache folder a painless issue.
Hi, I'm having troubles running several KeOps operations in parallel on an 8-GPU server (the setup is that I'm attempting to use the separate GPUs to fit gpytorch models simultaneously). It seems to work fine unless two scripts are compiling Keops code at the same time, at which point I start getting strange over-writing? related errors.
On the surface, I wouldn't have expected it to be due to multi-processing, but the script seemingly works fine unless two or more are running at once. Is there an easy fix to allow this type of multi-processing (I'd love to be able to launch these on a larger server but will probably hit more issues there)?
Example script
Example commands
Error Message
System profile:
cc @activatedgeek