dask 2021.10.0

ParametersReturns
__dask_distributed_pack__(self, all_hlg_keys: Iterable[Hashable], known_key_dependencies: Mapping[Hashable, set], client, client_keys: Iterable[Hashable]) -> Any

This method should pack its current state and is called by the Client when communicating with the Scheduler. The Scheduler will then use .__dask_distributed_unpack__(data, ...) to unpack the state, materialize the layer, and merge it into the global task graph.

The returned state must be compatible with Distributed's scheduler, which means it must obey the following: - Serializable by msgpack (notice, msgpack converts lists to tuples) - All remote data must be unpacked (see unpack_remotedata()) - All keys must be converted to strings now or when unpacking - All tasks must be serialized (see dumps_task())

The default implementation materialize the layer thus layers such as Blockwise and ShuffleLayer should implement a specialized pack and unpack function in order to avoid materialization.

Parameters

all_hlg_keys: Iterable[Hashable] :

All keys in the high level graph

known_key_dependencies: Mapping[Hashable, set] :

Already known dependencies

client: distributed.Client :

The client calling this function.

client_keys : Iterable[Hashable]

List of keys requested by the client.

Returns

state: Object serializable by msgpack

Scheduler compatible state of the layer

Pack the layer for scheduler communication in Distributed

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/highlevelgraph.py#326
type: <class 'function'>
Commit: