Skip to navigation

nemo_gym.tasks.harbor.dataset_config

View as Markdown

The [gym] table of a dataset’s dataset.toml: dataset-level settings for its tasks.

task.toml is the task author’s file and, once fetched, read-only. What a dataset needs on top of it goes here, as data: defaults that scale every task, and per-task overrides expressed with Harbor’s own [environment] fields. The loader applies them before anything else sees a task, so servers, agents and rows only ever see the effective task.toml. Harbor’s own tables in the same file ([dataset] and friends) are left to Harbor.

Deployment settings (which sandbox provider, registry credentials, image mirrors) do not belong here: a dataset must run unchanged on every deployment.

Module Contents

Classes

NameDescription
GymDatasetConfigThe whole [gym] table.
GymDatasetDefaults[gym.defaults]: generic policy applied to every task of the dataset.
GymTaskOverride[gym.tasks."<task_id>"]: per-task overrides, written with Harbor [environment] fields.

Functions

NameDescription
_override_environment-
_scale_environment-
apply_dataset_configThe effective task.toml for task_id: overrides first, then the dataset defaults.
read_dataset_configThe [gym] table of <folder>/dataset.toml; empty when the file or the table is absent.

Data

DATASET_FILE

GYM_TABLE

SCALED_RESOURCES

API

class nemo_gym.tasks.harbor.dataset_config.GymDatasetConfig()

Bases: BaseModel

The whole [gym] table.

_path
Path | None = PrivateAttr(default=None)
defaults
GymDatasetDefaults = Field(default_factory=GymDatasetDefaults)
is_empty
bool
model_config
= ConfigDict(extra='forbid')
path
Path | None
tasks
dict[str, GymTaskOverride] = Field(default_factory=dict)
class nemo_gym.tasks.harbor.dataset_config.GymDatasetDefaults()

Bases: BaseModel

[gym.defaults]: generic policy applied to every task of the dataset.

model_config
= ConfigDict(extra='forbid')
resource_multiplier
float = Field(default=1.0, gt=0)
timeout_multiplier
float = Field(default=1.0, gt=0)
class nemo_gym.tasks.harbor.dataset_config.GymTaskOverride()

Bases: BaseModel

[gym.tasks."<task_id>"]: per-task overrides, written with Harbor [environment] fields.

env merges over the task’s own; every other field replaces the task’s value.

environment
dict[str, Any] = Field(default_factory=dict)
model_config
= ConfigDict(extra='forbid')
nemo_gym.tasks.harbor.dataset_config._override_environment(
override: dict[str, typing.Any],
task_id: str
nemo_gym.tasks.harbor.dataset_config._scale_environment(
multiplier: float
nemo_gym.tasks.harbor.dataset_config.apply_dataset_config(
task_id: str,

The effective task.toml for task_id: overrides first, then the dataset defaults.

nemo_gym.tasks.harbor.dataset_config.read_dataset_config(
folder: pathlib.Path

The [gym] table of <folder>/dataset.toml; empty when the file or the table is absent.

nemo_gym.tasks.harbor.dataset_config.DATASET_FILE = 'dataset.toml'
nemo_gym.tasks.harbor.dataset_config.GYM_TABLE = 'gym'
nemo_gym.tasks.harbor.dataset_config.SCALED_RESOURCES = ('cpus', 'memory_mb', 'storage_mb')