nemo_gym.environment.benchmark_preparation
nemo_gym.environment.benchmark_preparation
Prepare a resolved config’s benchmark datasets by running their prepare scripts, and plan a benchmark.
The gym eval prepare and gym eval plan commands and callers that hold a resolved config in Python share this
code. It sits in environment because it builds on BenchmarkConfig. It is not nemo_gym.data.dataset_preparation,
which prepares training data.
Module Contents
Classes
Functions
Data
API
Bases: RuntimeError
A benchmark’s data preparation failed in its own code or environment.
Not resumable: the CLI exits with stop_exit_code (76) and records the kind for the guard of a job chain’s
next segment, which would fail the same way.
Bases: BaseNeMoGymCLIConfig
Prepare benchmark data by running the benchmark’s prepare.py script.
The benchmark is identified from a config_paths entry pointing to a benchmarks/*/config.yaml file.
With use_cached_prepared_benchmarks=true, an existing prepared file is reused. A prepare.py whose output
depends on its own code (for example, settings written into each row) can define
is_prepared_data_current(fpath: Path) -> bool; when it returns False, the cached file is prepared again.
Examples:
Install what a benchmark’s prepare script imports, before importing it.
Gym cannot depend on every benchmark’s data-prep requirements, so a benchmark needing something extra had to shell out to pip from inside the prepare script itself. Declaring it on the dataset puts it in the config instead.
Use explicit dependency arguments as before, or sync an isolated locked project.
Serialize path arguments without silently coercing unsupported values.
Keep preparer stdout visible and pass structured results over a separate file.
Every dataset the resolved config prepares: benchmark datasets and other datasets with a prepare_script.
A config path relative to the Gym checkout when it lies inside it, so plans match across machines.
Prepare the one benchmark a resolved config declares and build its plan (shared by gym eval plan).
Run each dataset’s prepare script, after validating all of them.