mstar.conductor.workers#

The workers a deployment config starts, and the device each runs on.

The conductor starts its workers from this list, and the API server places its result threads from it before the conductor exists, so the two can’t disagree about which CPUs the workers take (mstar.utils.cpus).

Functions

accelerator_type()

The device type workers run on: the accelerator's, else cpu.

deployment_workers(config, device_type)

Every rank node_groups names gets a worker (check_placement refuses a rank no walk runs on), on the device worker_device gives it.

worker_device(device_type, rank[, rank_devices])

The device string a worker rank runs on: its own number unless the deployment's rank_devices maps it elsewhere (several ranks may share a GPU); CPU deployments ignore the mapping.

Classes

DeploymentWorkers(ranks, devices)

One entry per worker, in rank order.

class mstar.conductor.workers.DeploymentWorkers(ranks, devices)[source]#

Bases: NamedTuple

One entry per worker, in rank order.

Parameters:
devices: list[str]#

Alias for field number 1

ranks: list[int]#

Alias for field number 0

mstar.conductor.workers.accelerator_type()[source]#

The device type workers run on: the accelerator’s, else cpu.

Return type:

str

mstar.conductor.workers.deployment_workers(config, device_type)[source]#

Every rank node_groups names gets a worker (check_placement refuses a rank no walk runs on), on the device worker_device gives it.

The optional rank_devices: {rank: device_index} places a worker rank on a device other than the one its number implies, e.g. two workers sharing one GPU so a light node’s steps stop interleaving with a heavy node’s on the same worker loop.

The API server reads this before the conductor’s validate_deployment has seen the config, so a malformed entry is skipped here and reported there.

Parameters:
Return type:

DeploymentWorkers

mstar.conductor.workers.worker_device(device_type, rank, rank_devices=None)[source]#

The device string a worker rank runs on: its own number unless the deployment’s rank_devices maps it elsewhere (several ranks may share a GPU); CPU deployments ignore the mapping.

Parameters:
Return type:

str