joblib / loky

Robust and reusable Executor for joblib
http://loky.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
523 stars 46 forks source link

ENH creating a memmaping_reusable_executor #286

Open tomMoral opened 3 years ago

tomMoral commented 3 years ago

Some people would like to benefit from joblib memmaping serialization while still retainning the flexibility of asynchronous computations offered by the concurrent.futures API. This issue intend to keep track of ideas for this feature.

We could expose a memmaping_reusable_executor that would use the serialization from joblib with the classical API. This would require some tweaking to correctly keep track of the memmap files. Talking with @pierreglaser IRL, he proposed the following strategy to keep track of memmap:

This way, memmaps are only created when sending tasks to the pool of workers and once the futures that depends on it are done, no other process should require them to run.

jakirkham commented 1 year ago

Building off the discussion in issue ( https://github.com/joblib/joblib/issues/705 ), wonder if it would be worth using SharedMemoryManager from Python 3.8+. There's also a backport package for Python 3.6 & 3.7