neural_lam.utils.distributed

neural_lam.utils.distributed#

Utilities for distributed training configuration.

Functions#

training_strategy(→ str)

Select unused-parameter detection only for distributed training.

Module Contents#

neural_lam.utils.distributed.training_strategy(devices: int | str | list[int], num_nodes: int, *, find_unused_parameters: bool = False) → str[source]#

Select unused-parameter detection only for distributed training.

Parameters:
  • devices (int or str or list[int]) – Lightning device count, device indices, or auto selection.

  • num_nodes (int) – Number of distributed nodes.

  • find_unused_parameters (bool, optional) – Whether the training objective leaves some model parameters unused.

Returns:

DDP with unused-parameter detection when requested and distributed; otherwise Lightning’s auto strategy.

Return type:

str