ray.data.ExecutionResources#

class ray.data.ExecutionResources(cpu: float | None = None, gpu: float | None = None, object_store_memory: int | None = None)[source]#

Specifies resources usage or resource limits for execution.

The value None represents unknown resource usage or an unspecified limit.

classmethod zero() ExecutionResources[source]#

Returns an ExecutionResources object with zero resources.

classmethod inf() ExecutionResources[source]#

Returns an ExecutionResources object with infinite resources.

object_store_memory_str() str[source]#

Returns a human-readable string for the object store memory field.

add(other: ExecutionResources) ExecutionResources[source]#

Adds execution resources.

Returns:

A new ExecutionResource object with summed resources.

subtract(other: ExecutionResources) ExecutionResources[source]#

Subtracts execution resources.

Returns:

A new ExecutionResource object with subtracted resources.

max(other: ExecutionResources) ExecutionResources[source]#

Returns the maximum for each resource type.

min(other: ExecutionResources) ExecutionResources[source]#

Returns the minimum for each resource type.

satisfies_limit(limit: ExecutionResources) bool[source]#

Return if this resource struct meets the specified limits.

Note that None for a field means no limit.

scale(f: float) ExecutionResources[source]#

Return copy with all set values scaled by f.