Skip to main content

accelerator

The accelerator directive defines the number of hardware accelerators (for example, GPUs) required by each task execution.

Usage

For example:

process hello {
accelerator 4, type: 'nvidia-tesla-k80'

script:
"""
your_gpu_enabled --command --line
"""
}

This example requests 4 GPUs of type nvidia-tesla-k80 for each task.

note

Additional options may be required to use accelerators. When using containers with GPUs, you must pass the GPU drivers through to the container. For Docker, this requires the option --gpus all in the docker run command. For Apptainer/Singularity, this requires the option --nv. Implementation details depend on the accelerator and container type.

Options

The following options are available:

request: Integer

The number of requested accelerators.

Specifying this directive with a number (for example, accelerator 4) is equivalent to the request option (for example, accelerator request: 4).

type: String

The accelerator type.

The meaning of this option depends on the target execution platform. See the platform-specific documentation for more information about the available accelerators:

This option is not supported for AWS Batch. You can control the accelerator type indirectly through the allowed instance types in your compute environment. See the AWS Batch FAQs for more information.

Executor support

This directive is only used by certain executors. See Executors for the executors that support this directive.