Repository navigation
Commit 41dbc66
authored
Add the metrics registry and the run report (#90)
* feat: record metric inputs and run metadata during generation
Generation, annotation and retargeting now record what dataset metrics
need, without computing any metric:
- Every producer records step_success from the task's success term.
Generation also records the per-step EEF and commanded target poses,
but not object poses, which annotation keeps for the source pool.
- Each exported dataset gets an autodata entry in env_args: run id,
exported count, pose-action layout, robot joint names with simulator
limits, and optional datasheet hardware_limits from the embodiment.
- --result_file adds a run block (run id, seed, revision, input
digests, hardware, setup and generation time) and an attempt log, one
line per attempt with its failure cause and algorithm extras.
- GenerationAlgorithm.attempt_extras() lets an algorithm report
per-attempt facts; SkillGen reports its motion-planning time.
* docs: describe what generation records per step, attempt and run
* feat: add the autodata_metrics registry and the run report
Metrics are plain functions registered with @Metric. Each declares the
evidence it requires (an HDF5 path, an env_args, run or attempt-log
field, or the source dataset); without it the report says which key is
missing instead of computing anything. A metric that raises is reported
as an error without hiding the others. The report refuses a dataset and
run record whose run ids or exported counts differ.
validate_dataset.py --report computes every registered metric, --metrics
loads more from a module, and --gate fails the command when a gated
metric is out of bounds, not applicable or at another version.
Built-in run metrics: generation success rate (stop-corrected, Wilson
interval), demos per GPU-hour, time to dataset, annotation pass rate,
and the failure-share and planning-time diagnostics.
* docs: add the metrics reference page with a table generated from the metric declarations
* fix: keep earlier runs' records and label only this run's datasets
- Each run writes its own attempt log, <stem>.<run_id>.attempts.jsonl,
so rerunning with the same --result_file keeps earlier logs, and an
interrupted rerun leaves the earlier result and its log consistent.
- A _failed dataset gets this run's autodata entry only when this run
kept failed episodes, so one left by an earlier run is not relabelled.
- The e2e helper checks the logged successes against the result.
- Docs: only generated datasets have a result file and attempt log.
* fix: report a run from the attempt log of the dataset's own run
Each run now writes its own attempt log. The report reads the log named
by the result when the result belongs to the dataset's run; otherwise it
sets the result aside with a warning and reads the log named by the
dataset's run id, so an interrupted rerun is still reported and runs are
never mixed.
* docs: say the result file and attempt log come with --result_file
* feat: make metric recording opt-in and keep algorithm diagnostics in extras
- Metric recording is off by default, so datasets and result files
are unchanged unless --record_metric_inputs is given to generation,
annotation or retargeting. It records the per-step poses and task
success, the autodata entry and, with --result_file, the run block
and attempt log.
- GenerationResult no longer has failure_cause; SkillGen reports
planning_failed in its attempt extras, next to planning_time_s.
- metric_context() docstrings say what they record; the pose-action
entry's columns key is now action_slice.
- Docs: the run linkage holds once the run completes.
* fix: reject non-finite values, require --report for report options, run metrics tests in CI
- The report marks a metric whose value is not a finite number as an
error, and the gate counts a missing or non-numeric value as a
violation.
- validate_dataset.py errors when --result_file, --source, --metrics,
--gate or --report_file is given without --report.
- failure_share is replaced by planning_failure_rate, read from
SkillGen's planning_failed attempt extra.
- CI runs autodata_tests/metrics/.
- Docs: metrics need --record_metric_inputs at recording time.
* fix: record metric inputs with a custom recorder and without a success term
- With --record_metric_inputs, the per-step pose term is added to a
custom --recorder_cfg too, unless it already records datagen info.
- Without a success term, step_success is not recorded instead of
failing on the first step.
* fix: check the attempt log against its result and keep reports valid JSON
- The report refuses a result whose attempt and success counts differ
from its attempt log.
- Run and gate input checks raise ValueError, so they also hold under
python -O.
- Non-finite numbers in a metric's details are reported as null.
- A dataset whose env_args are not a JSON object reads as having none.
- An empty metrics mapping computes no metrics instead of all of them.
- Docs: how the report treats a result from another run; the example
metric gets its own name; joint-limit metrics are not mentioned yet.
- The end-to-end tests run the report through assert_ok_metrics.1 parent 4d7419d commit 41dbc66
18 files changed
Lines changed: 993 additions & 5 deletions
File tree
- .github/workflows
- autodata_metrics
- autodata_tests
- e2e
- metrics
- utils
- docs
- _ext
- pages/references
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments