-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhead from serialization contributing to task execution latency #3901
Comments
This isn't a solution, but I've spent a lot of time in the last year or so getting much deeper understanding of whats happening with Python's pickle-style serialization, so just some notes:
if you're in serverless mode, |
(for noticing the "serializing far too much" situation with dill, it's usually pretty apparent from the byte count of the serialized object) |
Attempting to separate and clear out various issues.. @BarrySlyDelgado is there still a distinct problem to solve here?
|
For the question:
For serverless mode: if you're forking fresh for each task, even after performing a deserialization, there are a few Parsl use patterns that might clash with that (compared to how things work with Parsl's High Throughput Executor, which reuses worker processes). Maybe or maybe not relevant specifically to this issue and/or to parsl+task vine, but here's a quick brain dump.
I think that is on topic for this issue. The next two are related behaviours but aren't necessarily on topic for this issue #3901, but I'd like to write them down "somewhere":
|
I use caches to keep some objects in memory between calls in a few of our applications. Sometimes that's explicitly in the function code (as in the above examples), and other times it happens because I'm passing data by reference using proxystore and proxystore maintains the cache. |
@dthain I think the problem is broadly only getting necessary imports. |
@gpauloski Noted that there is an import overhead using python tasks. From the example in #3892 there is a apparent import overhead of 1 tasks/sec. This may be an issue in how we serialize functions for distribution, which I may not understand entirely.
Currently, we use
cloudpickle
to serialize python function and arguments. There are some nuances regarding different serialization modules that are worth discussing. if we serialize the function below, loading the same function will cause imports to happen when deserialized.We see this if we try to deserialize without the relevant module in our environment
If we comment out relevant imports this is not an issue unless you branch on the path that would use the import
From my perspective, this is the preferred failure case.
The first example above also causes an increased latency to deserialize the function:
Vs. second example
with
dill
this is not an issue in either case if the function is defined in main:However, the example has different behavior for functions defined outside the
__main__
module similar to that ofcloudpickle
For example, if
func
is defined outside__main__
:Additionally, switching
cloupickle
todill
does not necessarily improve latency,From the example in #3892
cloudpickle
:dill
:The text was updated successfully, but these errors were encountered: