nemo_gym.data.dataset_preparation
nemo_gym.data.dataset_preparation
Module Contents
Classes
Functions
Data
API
Bases: BaseModel
Bases: Accumulator
Accumulate a bounded categorical distribution.
Bases: Accumulator
Serialize existing metrics, adding task metrics only for materialized rows.
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
Every environment-server instance whose agent_server is the agent c, in config order.
The environment-server instance that drives a self-contained agent’s episodes.
An environment server that names the agent as its agent_server owns the rows the agent
declares (the Harbor layout: the agent block carries datasets so rollout collection
finds them, the environment server seeds and verifies them), so its task_data.py,
when it ships one, is the schema to validate against. Several environment servers may name
one agent (one per taskset, each routing its own rows to one harness instance); they share
the implementation the first one stands for here, and _taskset_folder tells them
apart by the dataset’s taskset.
The implementation key of _owning_environment_server, or None.
The resources-server implementation (directory) that owns a declaring instance’s data.
Datasets declared by a resources server belong to its own implementation; datasets declared by an agent belong to the resources server the agent references. Self-contained agents (no resources_server reference) return None here; the validator lookup then falls back to the environment server that drives the agent, then to the agent’s own directory.
(implementation, base_folder) whose task_data.py validates c’s datasets, or None.
A resources server owns its own data and the data of agents that reference it. An agent
without a reference is owned by the environment server that names it when that server
ships a task_data.py (the Harbor layout), else by itself: a self-contained agent
wrapped by a schema-less environment server (the legacy_agent layout) validates
against its own task_data.py. An agent whose reference is dangling is skipped: its
schema home is the (missing) server.
The in-scope instances plus every other instance of the run config, for schema-home lookups.
The validator for c’s dataset d, or None when no schema applies.
task_data_validation is the collation’s mode. A server schema that does not load is skipped with a
warning in every mode, as before. A Harbor dataset’s own task_data.py that does not load is a warning in
warn mode too, and the rows are then checked for the server’s reserved keys alone, as an untyped
dataset’s are (the seed refuses every episode of that taskset with the same error); in error mode it
fails the collation, as a row the schema rejects would.
The task folder of the Harbor taskset the agent c’s dataset d was materialized from, or None.
Rows route to the environment server whose tasksets carries their taskset (the generated run config
names the agent’s dataset after the taskset and routes by taskset), so that server’s
tasksets.<taskset>.folder is where the loader read the tasks from, whichever of the environment
servers naming the agent comes first in the config. None for a dataset no such server carries.
Returns the conflicting metrics fpath if invalid. Else returns None
See the README section “How To: Prepare and validate data for PR submission or RL training”
Bases: BaseNeMoGymCLIConfig
Prepare and validate training data, generating metrics and statistics for datasets.
Examples:
Whether row already carries a non-empty task_source of its own.
The name of a server reference given as a mapping, a model or nothing.
The entry fields left out of the metrics sidecar’s record of dataset.
Agent and taskset select routing, not source data, so taskset and flat declarations of one file share its
sidecar. Preparation (prepare_script, prepare_dependencies) controls how a local source file is
produced and is not a property of the rows, and defaults must not churn existing sidecars. The catalog
declarations (_CATALOG_DATASET_FIELDS) are left out for the same reason.
preparation False keeps the preparation fields: the per-split sidecar (<split>_metrics.json in the
output folder, TrainDataProcessor.collate_samples) has always recorded them, and
TrainDataProcessor._validate_aggregate_metrics requires every key of an existing sidecar, so leaving
them out there would reject every prepared dataset whose sidecar names them.
Combines misc items (those other than response/response create params) into current metrics
Aggregates metrics and merges current metrics (containing only AvgMinMax) with StringMetrics
Check if required env variables are present for the chosen backend