Hardware Resources for Running Tasks

In HQS Tasks, each task is intended to be executed on a machine for which we can control the available resources, at least to a certain degree. The process of setting up such an execution environment is called "provisioning."

The hardware resource types which can be controlled are:

  • The number of (virtual) CPU shares (a.k.a. threads)
  • The amount of memory
  • The number of GPUs (experimental)

For each task definition some reasonable default values might be provided for these. However, for most tasks these defaults only make sense for smaller problem instances, and for bigger ones you definitely want to have more control over it.

To specify (or overwrite the defaults for) these values, set the corresponding configuration parameters either globally or in a scope.

Example:

from hqs_task_execution.config import scoped_config

with scoped_config(vcpu=8, memory_gb=32):
    # ...

For details about how to specify configuration parameters, please consult the Configuration page.

How these provisioning options are respected when actually provisioning / allocating hardware depends on the backend. See the detail page of the backend you are using. In particular, the local backend does not support all options.