Repository navigation
Conversation
|
Here is a synthetic example showing how counter-productive it can be to call @mrocklin, what do you think? |
|
The alternative here I guess would be to specifically state which messages to offload? On a different kind of message this has less of an impact. In [1]: msg = {'status': b'OK', 'x': 123, 'y': 1.23}
In [2]: import msgpack
In [3]: from distributed.sizeof import sizeof
In [4]: %timeit msgpack.packb(msg)
The slowest run took 90.06 times longer than the fastest. This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 1.06 µs per loop
In [5]: %timeit sizeof(msg)
The slowest run took 117.97 times longer than the fastest. This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 708 ns per loopI'm curious if this shows up when profiling workloads. If not then I'm inclined to ignore it if the alternative is to manually annotate which serialization calls to offload. |
|
Right,
I suppose it would depend which workload? It's still not clear to me in which cases we can have a "rich" message where |
Yeah. The fact that I haven't seen this before gives me some confidence that these workloads are not particularly common. Messages tend to either be very short (like the one in my example) or contain large numpy arrays or pandas dataframes (where cost to transfer will overwhelm other costs). Update_graph is a good counter example. In short though I'm not really that worried about this. A fix would be nice, but I doubt that it would significantly impact usability. |
|
Well, this PR degrades performance on |
|
OK, yeah, that seems relevant |
|
OK, so some options:
|
|
Other thought: until now, since |
|
(original offloading PR was #1218 and was motivated by a private bug report from a customer -- see link there) |
|
Any progress on this? Is the discussion around the offloading still relevant or did this change in the past 2 years? While I'm not an expert on this topic, it feels like the question when and how to offload the serialisation is a topic on its own but not relevant to the implementation of dict/memoryview serialisation, is it?
|
|
(Antoine, you may want to unsubscribe here if you're no longer interested. I'll try to avoid using your username in case it re-subscribes you) The fail case and cost that Antoine points to is relevant. We can't deal with 100us costs on every message. However, maybe it makes sense to recurse if the dict is relatively small, perhaps less than 10 elements. That could cover cases like |
|
It looks like he's also referring to a benchmark here, which might be good to test against. |
|
This was done in another PR |
Note that unfortunately
sizeof()is quite slow, and I'm not sure it's a good idea to call it indistributed.comm.