Skip to navigation

Slurm Container

View as Markdown

This workload (test_template_name is SlurmContainer) executes containerized workloads using Slurm with custom container configurations.

Usage Examples

Test TOML example:

name = "my_container_test"
description = "Example Slurm container test"
test_template_name = "SlurmContainer"
[cmd_args]
check_exit_code = true
docker_image_url = "/path/to/container.sqsh"
cmd = "python train.py"

Test Scenario example:

name = "slurm-container-test"
[[Tests]]
id = "container.1"
num_nodes = 2
time_limit = "01:00:00"
test_name = "my_container_test"

Test-in-Scenario example:

name = "slurm-container-test"
[[Tests]]
id = "container.1"
num_nodes = 2
time_limit = "01:00:00"
name = "my_container_test"
description = "Example Slurm container test"
test_template_name = "SlurmContainer"
[Tests.cmd_args]
check_exit_code = true
docker_image_url = "/path/to/container.sqsh"
cmd = "python train.py"

Run Status

Exit-code checking is disabled by default for backwards compatibility. Set check_exit_code = true in cmd_args to record the aggregate srun exit code in the per-test exit_code.txt file and use it to determine success. Only integer 0 is successful. Any non-zero integer, or a missing, malformed, unreadable, or undecodable file, marks the run as failed. Slurm-style exit code 0:0 is not accepted.

API Documentation

Command Arguments

SlurmContainerCmdArgs

Command line arguments for a generic Slurm container test.

FieldTypeDefaultDescription
docker_image_urlstrRequired
cmdstrRequired
check_exit_codeboolFalseWhether to grade the run from the container command exit code.

Test Definition

SlurmContainerTestDefinition

Test definition for a generic Slurm container test.

FieldTypeDefaultDescription
namestrRequired
descriptionstrRequired
test_template_namestrRequired
cmd_argscloudai.workloads.slurm_container.slurm_container.SlurmContainerCmdArgsRequired
dse_excluded_argslist[str]Factory: list
extra_env_varsdict[str, str | typing.List[str]]{}
extra_cmd_argsdict[str, str]{}
extra_container_mountslist[str][]
git_reposlist[cloudai._core.installables.git_repo.GitRepo][]
nsyscloudai.models.workload.NsysConfiguration | NoneNone
predictorcloudai.models.workload.PredictorConfig | NoneNone
training_reportcloudai.models.workload.TrainingReportConfig | NoneNone
agentstr'grid_search'
agent_stepsint1
agent_metricslist[str]['default']
agent_reward_functionstr'inverse'
agent_configdict[str, Any] | NoneNoneAgent configuration.
env_paramsdict[str, cloudai.configurator.env_params.EnvParamSpec]Factory: dictEnvironment parameters sampled by the env per trial. Sibling to cmd_args; not part of the agent’s action space. CloudAIGymEnv samples, persists them in the trajectory output, and includes them in the trajectory cache key.
extra_srun_argslist[str]Factory: list
scriptslist[cloudai._core.installables.file.File]Factory: list