Make Parsl stop serializing the entire Runner instance #616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Parsl serializes the callables provided to it and for each chunk keeps one copy of serialized buffer in memory locally. Currently in case of Coffea these are bound methods of Runner, which makes Parsl serialize the entire Runner instance. However the Runner instance contains things like caches and executors, which can be user-provided and very large. This makes the serialized buffer very large as well. In my tests I easily got buffer sizes of ~ MB and with 10000 chunks, which is a normal number for my applications, this amounts to ~ 10 GB. All this memory is occupied without any good reason. In some extreme cases I was even able to fill up all the memory of my machine.
This patch makes the methods that are serialized static, so that the serialization works independent of the Runner instance. Affected methods are
config
,automatic_retries
,metadata_fetcher
and_work_function
.