Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ global-include *.h
global-include *.cpp
global-include *.cu
global-include *.py
recursive-include pufferlib/config *.ini
recursive-include pufferlib/resources *
recursive-exclude experiments *
recursive-exclude wandb *
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ To add a metric to the report: add its key to `TREND_METRICS` /
`FINALS_METRICS` / `CURVE_METRICS` in `scripts/nightly_report.py`, then run
`update` followed by `report`.

## Key Configuration (`pufferlib/config/ocean/drive.ini`)
## Key Configuration (`pufferlib/config/puffer_drive.yaml`)

### `[env]` — Simulation
### `env` — Simulation

| Parameter | Default | Notes |
|-----------|---------|-------|
Expand All @@ -250,7 +250,7 @@ To add a metric to the report: add its key to `TREND_METRICS` /
| `reward_conditioning` | `False` | Condition policy on reward weights |
| `reward_randomization` | `False` | Randomize reward weights each episode |

### `[env]` — Reward Shaping
### `env` — Reward Shaping

| Parameter | Default | Effect |
|-----------|---------|--------|
Expand All @@ -263,7 +263,7 @@ To add a metric to the report: add its key to `TREND_METRICS` /
| `reward_stop_line` | `1.0` | Stop line penalty |
| `reward_overspeed` | `0.05` | Speeding penalty |

### `[train]` — PPO
### `train` — PPO

| Parameter | Default | Notes |
|-----------|---------|-------|
Expand All @@ -277,7 +277,7 @@ To add a metric to the report: add its key to `TREND_METRICS` /
| `vtrace_rho_clip` / `vtrace_c_clip` | `1` | V-trace IS ratio clipping |
| `adv_sampling_prio_alpha` / `adv_sampling_prio_beta0` | `0.85` | Priority sampling exponents |

### `[policy]` — Network
### `policy` — Network

| Parameter | Default | Notes |
|-----------|---------|-------|
Expand Down
4 changes: 2 additions & 2 deletions data_utils/fetch_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Fetch shared PufferDrive datasets from S3.

Datasets are declared in data_utils/datasets.yaml and sync into
<repo>/data/<name>/ (gitignored), where the drive.ini defaults expect them.
<repo>/data/<name>/ (gitignored), where the default config expects them.
Fetching elsewhere (--data-root) means pointing env.map_dir there too.

python data_utils/fetch_data.py # the default ~10 GB mini sets
Expand Down Expand Up @@ -95,7 +95,7 @@ def main():
parser.add_argument(
"--data-root",
default=DEFAULT_DATA_ROOT,
help="destination root (default: <repo>/data, where the drive.ini defaults expect it)",
help="destination root (default: <repo>/data, where the default config expects it)",
)
parser.add_argument("--dry-run", action="store_true", help="show what would be downloaded without writing")
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion docs/data_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lab's S3 buckets and pulled onto a machine for training and evaluation.
## Fetching data

Datasets are registered in `data_utils/datasets.yaml` and land under
`<repo>/data/` (gitignored), where the `drive.ini` defaults expect them.
`<repo>/data/` (gitignored), where the default config expects them.
Fetching elsewhere (`--data-root`) means pointing `env.map_dir` there too.

```bash
Expand Down
48 changes: 26 additions & 22 deletions docs/evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ training and standalone from the CLI — there is no second eval path.

## Concepts

- **Evaluator** — one evaluation, defined by an `[eval.<name>]` section in
`pufferlib/config/ocean/drive.ini`. It owns an env config, a rollout, a set
- **Evaluator** — one evaluation, defined by an `eval.<name>` section in
`pufferlib/config/puffer_drive.yaml`. It owns an env config, a rollout, a set
of metrics, and optional rendering.
- **EvalManager** — discovers every `[eval.<name>]` section, instantiates the
- **EvalManager** — discovers every `eval.<name>` section, instantiates the
evaluators, and runs the ones whose `interval` is due (inline) or that you
name (standalone). One evaluator failing doesn't stop the rest.
- **Evaluator types** (the `type` field): `multi_scenario` (sweep a scenario
Expand All @@ -20,20 +20,24 @@ training and standalone from the CLI — there is no second eval path.

## Config schema

```ini
[eval.<name>]
type = "multi_scenario" ; registered evaluator class (omit for a template)
enabled = true ; skip when false
interval = 250 ; run every N epochs inline (0 disables inline)
mode = "inline" ; "inline" (block training) | "subprocess"
inherits = "<other_section>" ; optional: pull defaults from another section
clean = true ; zero perturbations/dropout + enforce red lights
render = true ; capture renders during the rollout
render_views = ["sim_state","bev"]; camera views for the egl backend
render_backend = "egl" ; egl | triage_html | obs_html (see Render backends)
env.<key> = <value> ; any [env] override (dotted)
eval.<key> = <value> ; evaluator-specific knob (see below)
vec.<key> = <value> ; any [vec] override
```yaml
eval:
<name>:
type: multi_scenario # registered evaluator class (omit for a template)
enabled: 'true' # skip when false
interval: 250 # run every N epochs inline (0 disables inline)
mode: inline # inline (block training) | subprocess
inherits: <other_section> # optional: pull defaults from another section
clean: 'true' # zero perturbations/dropout + enforce red lights
render: 'true' # capture renders during the rollout
render_views: [sim_state, bev] # camera views for the egl backend
render_backend: egl # egl | triage_html | obs_html (see Render backends)
env: # any env override
<key>: <value>
eval: # evaluator-specific knobs (see below)
<key>: <value>
vec: # any vec override
<key>: <value>
```

A section **without** a `type` is a *template*: it is never instantiated, only
Expand Down Expand Up @@ -70,23 +74,23 @@ puffer eval puffer_drive --evaluator validation_gigaflow \
--load-model-path experiments/puffer_drive_xxxx/models/model_000500.pt
```

Runs that one evaluator with its `[eval.validation_gigaflow]` config. The
Runs that one evaluator with its `eval.validation_gigaflow` config. The
checkpoint's network architecture is read from the sibling `config.yaml` (next
to `models/`), so a checkpoint loads even if its policy/rnn dims differ from
`drive.ini`. With no `--load-model-path`, a fresh (random) policy is used —
`puffer_drive.yaml`. With no `--load-model-path`, a fresh (random) policy is used —
useful for smoke-testing the eval path itself.

### Standalone, ad-hoc

Same as by-name, except instead of naming an evaluator you select one of the two
built-in `validation_*` evaluators by simulation and override its config from the
CLI — no `drive.ini` edit needed:
CLI — no config edit needed:

- `--eval_simulation gigaflow` → runs the `validation_gigaflow` section
- `--eval_simulation replay` → runs the `validation_replay` section

The flags below override that evaluator's config for this run, and each applies
**only when passed** — omit one and the evaluator's own `[eval.*]` value stands:
**only when passed** — omit one and the evaluator's own `eval.*` value stands:

```bash
puffer eval puffer_drive --eval_simulation gigaflow \
Expand Down Expand Up @@ -162,7 +166,7 @@ weights and clean-eval knobs from the `validation_defaults` template.
`evaluators/__init__.py`. Most subclasses only override `env_overrides`,
`_should_stop`, and optionally `_render_env_overrides`; the base `rollout`
handles the step loop, metric aggregation, CSV, and coverage.
2. Add an `[eval.<name>]` section with `type = "<your_type_name>"`.
2. Add an `eval.<name>` section with `type: <your_type_name>`.

## Scripts

Expand Down
213 changes: 0 additions & 213 deletions pufferlib/config/default.ini

This file was deleted.

Loading
Loading