ray.dag.input_node.InputNode.experimental_compile#

InputNode.experimental_compile(_submit_timeout: float | None = None, _buffer_size_bytes: int | None = None, enable_asyncio: bool = False, _max_inflight_executions: int | None = None, _max_buffered_results: int | None = None, _overlap_gpu_communication: bool | None = None, _default_communicator: str | Communicator | None = 'create') ray.dag.CompiledDAG#

Compile an accelerated execution path for this DAG.

Parameters:
  • _submit_timeout – The maximum time in seconds to wait for execute() calls. None means using default timeout, 0 means immediate timeout (immediate success or timeout without blocking), -1 means infinite timeout (block indefinitely).

  • _buffer_size_bytes – The initial buffer size in bytes for messages that can be passed between tasks in the DAG. The buffers will be automatically resized if larger messages are written to the channel.

  • enable_asyncio – Whether to enable asyncio for this DAG.

  • _max_inflight_executions – The maximum number of in-flight executions that can be submitted via execute or execute_async before consuming the output using ray.get(). If the caller submits more executions, RayCgraphCapacityExceeded is raised.

  • _max_buffered_results – The maximum number of results that can be buffered at the driver. If more than this number of results are buffered, RayCgraphCapacityExceeded is raised. Note that when result corresponding to an execution is retrieved (by calling ray.get() on a CompiledDAGRef or CompiledDAGRef or await on a CompiledDAGFuture), results corresponding to earlier executions that have not been retrieved yet are buffered.

  • _overlap_gpu_communication – (experimental) Whether to overlap GPU communication with computation during DAG execution. If True, the communication and computation can be overlapped, which can improve the performance of the DAG execution. If None, the default value will be used.

  • _default_communicator – The default communicator to use to transfer tensors. Three types of values are valid. (1) Communicator: For p2p operations, this is the default communicator to use for nodes annotated with with_tensor_transport() and when shared memory is not the desired option (e.g., when transport=”nccl”, or when transport=”auto” for communication between two different GPUs). For collective operations, this is the default communicator to use when a custom communicator is not specified. (2) “create”: for each collective operation without a custom communicator specified, a communicator is created and initialized on its involved actors, or an already created communicator is reused if the set of actors is the same. For all p2p operations without a custom communicator specified, it reuses an already created collective communicator if the p2p actors are a subset. Otherwise, a new communicator is created. (3) None: a ValueError will be thrown if a custom communicator is not specified.

Returns:

A compiled DAG.