Skip to navigation

nemo_gym.data.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: the facts Harbor has no field for (license and type, which say which split the rows may enter; allowed_agents, the harnesses admitted to run it; domain and verified, catalog metadata; source, the hub reference a committed entry under environments/harbor/ is pulled from), defaults that scale every task or set how many rollouts an evaluation takes per task, and per-task overrides expressed with Harbor’s own [environment] fields. The loader applies the task-shaping settings before anything else sees a task, so servers, agents and rows only ever see the effective task.toml; the other keys flow into the generated run config’s datasets: entry (nemo_gym.data.tasks.harbor.materialize.run_config). 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’s own fields.

Functions

NameDescription
_added_artifacts-
_override_environment-
_override_verifier-
_scale_environment-
_scale_step_timeoutsOne [[steps]] entry with its own [steps.agent].timeout_sec and [steps.verifier].timeout_sec scaled
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

DatasetSplit

GYM_TABLE

SCALED_RESOURCES

TRAINING_SPLITS

API

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

Bases: BaseModel

The whole [gym] table.

_path
Path | None = PrivateAttr(default=None)
allowed_agents
list[str] | None = None
defaults
GymDatasetDefaults = Field(default_factory=GymDatasetDefaults)
domain
Domain | None = None
effective_type
str

The split the rows enter: the declared one, else validation with a license, else benchmark.

is_empty
bool

Whether the [gym] table says nothing at all: every key at its default.

What a scaffolded dataset.toml reads as (its keys are comments). Nothing branches on it: a task’s digest folds the table in by shapes_tasks, and the entry and run defaults read each key.

license
DatasetLicense | None = None
model_config
= ConfigDict(extra='forbid')
path
Path | None
shapes_tasks
bool

Whether any setting changes the effective task.toml (identity and run fields never do).

source
str | None = None
tasks
dict[str, GymTaskOverride] = Field(default_factory=dict)
type
DatasetSplit | None = None
verified
bool = Field(default=False, strict=True)
nemo_gym.data.tasks.harbor.dataset_config.GymDatasetConfig._allowed_agents_name_distinct_agents(
value: list[str] | None
) -> list[str] | None
classmethod
nemo_gym.data.tasks.harbor.dataset_config.GymDatasetConfig._domain_is_one_of_gyms(
value: typing.Any
) -> typing.Any
classmethod

Refuse a domain outside Gym’s values with the values named: the entry’s domain is the same enum.

nemo_gym.data.tasks.harbor.dataset_config.GymDatasetConfig._source_is_a_hub_reference(
value: str | None
) -> str | None
classmethod

Refuse a source that is not a well-formed harbor: reference, in the hub’s own words.

nemo_gym.data.tasks.harbor.dataset_config.GymDatasetConfig.admits(
agent: str
) -> bool

Whether agent (an implementation name) may run the dataset: any when allowed_agents is unset.

class nemo_gym.data.tasks.harbor.dataset_config.GymDatasetDefaults()

Bases: BaseModel

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

model_config
= ConfigDict(extra='forbid')
num_repeats
int = Field(default=1, ge=1, strict=True)
resource_multiplier
float = Field(default=1.0, gt=0)
timeout_multiplier
float = Field(default=1.0, gt=0)
class nemo_gym.data.tasks.harbor.dataset_config.GymTaskOverride()

Bases: BaseModel

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

environment and verifier take any key of the task’s [environment] and [verifier] tables; env merges over the task’s own and every other field replaces the task’s value. artifacts are added after the task’s own artifacts entries, in Harbor’s shape (a path, or a table with source, destination and service).

artifacts
list[Any] = Field(default_factory=list)
environment
dict[str, Any] = Field(default_factory=dict)
model_config
= ConfigDict(extra='forbid')
verifier
dict[str, Any] = Field(default_factory=dict)
nemo_gym.data.tasks.harbor.dataset_config._added_artifacts(
entries: list[typing.Any],
task_id: str
nemo_gym.data.tasks.harbor.dataset_config._override_environment(
override: dict[str, typing.Any],
task_id: str
nemo_gym.data.tasks.harbor.dataset_config._override_verifier(
override: dict[str, typing.Any],
task_id: str
nemo_gym.data.tasks.harbor.dataset_config._scale_environment(
multiplier: float
nemo_gym.data.tasks.harbor.dataset_config._scale_step_timeouts(
step: typing.Any,
multiplier: float
) -> typing.Any

One [[steps]] entry with its own [steps.agent].timeout_sec and [steps.verifier].timeout_sec scaled once; a budget the step does not name stays None, inherited through HarborTaskConfig’s step accessors (the loader’s hint about steps graded within the step default keys on that).

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

nemo_gym.data.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.data.tasks.harbor.dataset_config.DATASET_FILE = 'dataset.toml'
nemo_gym.data.tasks.harbor.dataset_config.DatasetSplit = Literal['train', 'validation', 'example', 'benchmark']
nemo_gym.data.tasks.harbor.dataset_config.GYM_TABLE = 'gym'
nemo_gym.data.tasks.harbor.dataset_config.SCALED_RESOURCES = ('cpus', 'memory_mb', 'storage_mb')
nemo_gym.data.tasks.harbor.dataset_config.TRAINING_SPLITS = ('train', 'validation')