nf-core / deepmodeloptim

Stochastic Testing and Input Manipulation for Unbiased Learning Systems
https://nf-co.re/deepmodeloptim
MIT License
23 stars 9 forks source link

[bug] avoid competing resources between multiprocessing.pool and ray tune #162

Closed suzannejin closed 4 months ago

suzannejin commented 4 months ago

[x] separate encoding and tuning [x] modify PredictWrapper to get the data already loaded by dataloader

Both modifications will ensure that multiprocessing.pool (used during the loading and encoding of the data) will not compete for the threading sources with ray tune (either during training or predicting the performance in the objective function).

Hope this will help in the deadlock problem. If not, at least it will avoid loading and encoding the data multiple times...

Also, probably multiprocessing is also used by other packages (DataLoader, etc) Related issue: https://github.com/ray-project/ray/issues/28197

Added another modification: [x] pass the data through tune.with_parameters to the workers. In this way, the data is passed as a pointer.