core._slurm_utils#
Utilities for detecting and configuring SLURM cluster environments.
This module provides functionality to detect SLURM environments and extract distributed training configuration from SLURM environment variables.
Module Contents#
Functions#
Detect if running in a SLURM environment. |
|
Get the global rank from SLURM environment. |
|
Get the world size from SLURM environment. |
|
Get the local rank from SLURM environment. |
API#
- core._slurm_utils.is_slurm_job() bool#
Detect if running in a SLURM environment.
- Returns:
True if SLURM job detected, False otherwise.
- core._slurm_utils.resolve_slurm_rank() int | None#
Get the global rank from SLURM environment.
- Returns:
The global rank, or None if not in SLURM environment.
- core._slurm_utils.resolve_slurm_world_size() int | None#
Get the world size from SLURM environment.
- Returns:
The world size, or None if not in SLURM environment.
- core._slurm_utils.resolve_slurm_local_rank() int | None#
Get the local rank from SLURM environment.
- Returns:
The local rank, or None if not in SLURM environment.