Skip to main content

Resources

Resources such as CPU, Memory, and GPU that can be allocated to a task.

Attributes

  • cpu: Union[CPUBaseType, Tuple[CPUBaseType, CPUBaseType], None] = None

    • The amount of CPU to allocate to the task. This can be a string, int, float, list of ints or strings, or a tuple of two ints or strings.
  • memory: Union[str, Tuple[str, str], None] = None

    • The amount of memory to allocate to the task. This can be a string, int, float, list of ints or strings, or a tuple of two ints or strings.
  • gpu: Union[Accelerators, int, Device, None] = None

    • The amount of GPU to allocate to the task. This can be an Accelerators enum, an int, or None.
  • disk: Union[str, None] = None

    • The amount of disk to allocate to the task. This is a string of the form "10GiB".
  • shm: Union[str, Literal["auto"], None] = None

    • None

Constructors

  • Resources such as CPU, Memory, and GPU that can be allocated to a task.

  • Parameters

    • cpu: Union[CPUBaseType, Tuple[CPUBaseType, CPUBaseType], None]
      • The amount of CPU to allocate to the task. This can be a string, int, float, list of ints or strings, or a tuple of two ints or strings.
    • memory: Union[str, Tuple[str, str], None]
      • The amount of memory to allocate to the task. This can be a string, int, float, list of ints or strings, or a tuple of two ints or strings.
    • gpu: Union[Accelerators, int, Device, None]
      • The amount of GPU to allocate to the task. This can be an Accelerators enum, an int, or None.
    • disk: Union[str, None]
      • The amount of disk to allocate to the task. This is a string of the form "10GiB".
    • shm: Union[str, Literal["auto"], None]
      • None

Methods

def get_device()
  • Get the accelerator string for the task.

     :return: If GPUs are requested, return a tuple of the device name, and potentially a partition string.
    Default cloud provider labels typically use the following values: `1g.5gb`, `2g.10gb`, etc.
  • Return Value: Optional[Device]

    • If GPUs are requested, return a tuple of the device name, and potentially a partition string.
def get_shared_memory()
  • Get the shared memory string for the task.

     :return: The shared memory string.
  • Return Value: Optional[str]

    • The shared memory string.