HighLevelGraphs to the Scheduler#4140
Conversation
|
What about having |
I think this is essential what we are doing right now just using |
5bf6cee to
08a0b8c
Compare
08a0b8c to
34e0612
Compare
|
Woo, nice green check marks 🎉 |
076b36a to
cdc2f67
Compare
cdc2f67 to
b9e2980
Compare
|
I have been working on this PR some time now. Initially, my idea was to implement and use I have compiled a list of requirements and thoughts:
Because of these requirements, I am exploring a new approach where the serialization and deserialization of layers is specialized. I introduce The current implementation does all this in Distributed however we should consider move it to the NB: the current push is just a rough implementation that always falls back to |
|
@madsbk if you're around and want to have a high bandwidth conversation I would be interested. Some quick comments/questions
Materializing all keys might be ok. Ideally we don't have to materialize the entire graph until we get to the scheduler. We could also convert to strings after we get to the scheduler and have the full graph.
Again, I think that materializing keys will be ok for now (this is, I think, likely to be faster than the graph). In the future I hope that we can avoid cases where we need to calculate dependencies in the common case.
Hrm, I'm curious about this. I'll need to think about this more.
Also curious.
We can drop this if we need to
Ah, right. Well, maybe we can change how we stringify in order to keep ordering. Maybe we do both ordering and stringifying on the scheduler after we've moved everything over. |
Notice, the keys here also refers to the keys inside tasks. Since tasks might not exist yet, it requires domain knowledge to stringify them.
True, it is properly possible to serialize keys using msgpack in most cases, but dumping tasks before stringify means that the dumped task may contain non-stringified keys. |
b9e2980 to
02c182a
Compare
3914b46 to
c4a816a
Compare
|
Moved packing of shuffle layers to Dask: dask/dask#6786 thus CI will fail until it has been merged. |
| layers.append( | ||
| { | ||
| "__module__": None, | ||
| "__name__": None, | ||
| "state": _materialized_layer_pack( | ||
| layer, | ||
| hlg.get_all_external_keys(), | ||
| hlg.key_dependencies, | ||
| allowed_client, | ||
| allows_futures, | ||
| ), | ||
| } | ||
| ) |
There was a problem hiding this comment.
What if this was the implementation of Layer.__dask_distributed_pack__? That might simplify things a bit here
There was a problem hiding this comment.
We would import the relevant distributed functions within the method in the Dask codebase.
There was a problem hiding this comment.
It's not a big deal either way, but it might isolate things a bit.
There was a problem hiding this comment.
I think it is best to have the fall back in Distributed for now. Long-term it would be nice to have it in Layer.__dask_distributed_pack__() but right now it requires a lot of very Distributed specific things like key_dependencies, allowed_client, and allows_futures.
Furthermore, my plan is to also incorporate dsk.map_basic_layers() into distributed_pack() in order to remove both map_basic_layers() and map_tasks() from the HLG API.
|
@madsbk is there anything that I can do or should look at to help here? |
The final issue is ordering, which has to be done before converting keys to strings. This is what is failing in CI. |
|
If we do ordering on the scheduler side after stringification I suspect that everything will work the same in almost all cases. I would be willing to take the hit on those cases in order to move forward. Is this an easy option for you? |
|
Yes, that would make this PR almost ready. Should I add a pytest.xfail() on
the affected tests?
…On Wed, Nov 4, 2020 at 10:46 PM Matthew Rocklin ***@***.***> wrote:
If we do ordering on the scheduler side after stringification I suspect
that everything will work the same in almost all cases. I would be willing
to take the hit on those cases in order to move forward. Is this an easy
option for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4140 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH6FQFRGAUSTJAGCZ6YK6TSOHDSZANCNFSM4SAR7EMQ>
.
|
|
That seems sensible to me |
d29755e to
4f95df7
Compare
4f95df7 to
cae685a
Compare
|
@mrocklin, I managed to support ordering but it requires a fancy string comparison in |
|
Let's xfail the test for now, include a link to the order PR in the reason= keyword, and then merge this. I want to think a bit about prefixing with zeroes before we commit to it. |
|
@mrocklin @jrbourbeau, I think this is ready to be merged. It lacks documentation of the pack/unpack API but let's wait with that until we settle on an API. |
|
I'll take another look in a bit and then merge in. |
|
This looks slick. Thank you for figuring this out @madsbk |
|
@sjperkins this is in. Now would probably be a good time to add in support for annotations. I think that they should go in |
@mrocklin Thanks for the headsup. My schedule is busy till next week Thursday. Would it be OK if I picked it up then? |
|
I don't pay you, so sure :)
…On Fri, Nov 6, 2020 at 5:53 AM Simon Perkins ***@***.***> wrote:
@sjperkins <https://github.com/sjperkins> this is in. Now would probably
be a good time to add in support for annotations. I think that they should
go in client.py::Client._graph_to_futures
@mrocklin <https://github.com/mrocklin> Thanks for the headsup. My
schedule is busy till next week Thursday. Would it be OK if I picked it up
then?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4140 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKZTGMNK4VX2HSOF5HHB3SOP5XNANCNFSM4SAR7EMQ>
.
|
)" This reverts commit 09d9799.
This PR implements pack and unpack of send high level graphs, which makes it possible for the Client to send a HLG directly to the scheduler.