-
Notifications
You must be signed in to change notification settings - Fork 124
vine: function infile load mode #4246
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
base: master
Are you sure you want to change the base?
vine: function infile load mode #4246
Conversation
|
What is the inspiration behind this change, or can you please provide more context or use case? I'm thinking about the corner case of a Python class as an argument, which AFAIK isn't JSON-serializable or -deserializable out of the box with the Can you also add tests to make sure this proposed feature works? |
|
If you want to support this feature you also need to add a flag somewhere around here to serialize Python objects by JSON too, as arguments via "infile" are always serialized with cloudpickle at the moment (see cctools/taskvine/src/bindings/python3/ndcctools/taskvine/task.py Lines 1113 to 1125 in 2c8f80d
|
This feature enables the design of a new graph executor, where the entire graph is installed within the library. Each function call carries the key that identifies the function to execute, whose format is For example, a task graph can be defined as: Here, Although a single argument could suffice for representing the key, |
The new feature doesn't go through |
I see, you need to be careful when arguments aren't simple objects. The json module can serialize basic types but anything complex enough to be a class then this approach wouldn't work. Also if the serialization time of cloudpickle is of a concern, can you post a benchmark result between that and json? |
|
I see, the Regarding the benchmark, I ran a test earlier with a DAG of one million phony tasks on 1,600 cores: using |
|
I am not completely convinced this is needed? It sounds like a library inside a library? |
|
I may be misunderstanding what "a library inside a library" means here. The goal is simply to make the infile loading mode configurable for function tasks. The default remains |
| os.writev(w, [b"a"]) | ||
|
|
||
|
|
||
| # Load the infile for a function task inside this library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JinZhou5042 I'm referring in particular to what this comment implies. Why is not the function part of the library in the first place? Why not generate the library with the functions needed instead of loading them from a file which may create difficulties when debugging, create new paths for errors, etc.?
…ools into library-infile-load-mode
Proposed Changes
We had only one mode (
cloudpickle) to wrap function arguments and send to workers.But sometimes arguments can also be passed of a
jsonformat and we should support that.Merge Checklist
The following items must be completed before PRs can be merged.
Check these off to verify you have completed all steps.
make testRun local tests prior to pushing.make formatFormat source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)make lintRun lint on source code prior to pushing.