Skip to content

DistributedNodeConfig

kedro_azureml_pipeline.distributed.DistributedNodeConfig dataclass

Configuration for a distributed training node.

Parameters

Name Type Description Default
framework Framework

Distributed training framework to use.

required
num_nodes str or int

Number of compute nodes.

required
processes_per_node str, int, or None

Number of processes to launch per node.

None

See Also

distributed_job : Decorator that creates this config. AzureMLPipelineGenerator : Reads this config during generation.

Source Code

Show/Hide source
@dataclass
class DistributedNodeConfig:
    """Configuration for a distributed training node.

    Parameters
    ----------
    framework : Framework
        Distributed training framework to use.
    num_nodes : str or int
        Number of compute nodes.
    processes_per_node : str, int, or None
        Number of processes to launch per node.

    See Also
    --------
    [distributed_job][kedro_azureml_pipeline.distributed.decorators.distributed_job] : Decorator that creates this config.
    [AzureMLPipelineGenerator][kedro_azureml_pipeline.generator.AzureMLPipelineGenerator] : Reads this config during generation.
    """

    framework: Framework
    num_nodes: str | int
    processes_per_node: str | int | None = None

    def __repr__(self):
        """Return a JSON string representation.

        Returns
        -------
        str
            JSON-serialized configuration.
        """
        return json.dumps(asdict(self))

    def __str__(self):
        """Return a JSON string representation.

        Returns
        -------
        str
            JSON-serialized configuration.
        """
        return self.__repr__()

Methods

__repr__()

Return a JSON string representation.

Returns
Type Description
str

JSON-serialized configuration.

Source Code
Show/Hide source
def __repr__(self):
    """Return a JSON string representation.

    Returns
    -------
    str
        JSON-serialized configuration.
    """
    return json.dumps(asdict(self))

__str__()

Return a JSON string representation.

Returns
Type Description
str

JSON-serialized configuration.

Source Code
Show/Hide source
def __str__(self):
    """Return a JSON string representation.

    Returns
    -------
    str
        JSON-serialized configuration.
    """
    return self.__repr__()