Backfill total_s from Cam2V's model_step_wall_s for LingBot benchmark scenarios - #589
Backfill total_s from Cam2V's model_step_wall_s for LingBot benchmark scenarios#589AmirF194 wants to merge 2 commits into
Conversation
…ples Cam2V reports its per-step duration as model_step_wall_s and chunk_fps instead of the benchmark tooling's canonical total_s/model_step_s. _generated_fps_for_step and _generated_fps_summary only ever check total_s (falling back to model_step_s), and harness.py's run highlights read total_s directly, so LingBot's Cam2V scenarios never get a derived generated_fps and their step-time/throughput headline cards render empty. The runtime-metric-samples ingest path (_records_from_runtime_metric_samples) has no key-normalization step at all, unlike the stats-rows path, which already renames vendor-specific keys via _KEY_OVERRIDES. Add a small, additive alias step that backfills total_s from model_step_wall_s when a step doesn't already report total_s directly, leaving the app-reported key in place. Every downstream reader of total_s already exists (_generated_fps_for_step, _generated_fps_summary, harness.py's highlights, report.py's headline cards) and needs no change. Refs NVIDIA#564 Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
Greptile SummaryThe PR makes Cam2V’s per-step wall duration available under the canonical
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Cam2V model step] --> B[model_step_wall_s and total_s]
C[Older runtime sample with model_step_wall_s] --> D[Canonical alias backfill]
B --> E[Benchmark record with total_s]
D --> E
E --> F[Derived generated_fps]
E --> G[Timing highlights and report cards]
Reviews (2): Last reviewed commit: "Assign total_s at the source in Cam2VMod..." | Re-trigger Greptile |
ZenAlexa
left a comment
There was a problem hiding this comment.
The alias is applied inside records_from_stats_file(), after the runtime stats artifact has already been written. Cam2V's StepResult.metrics therefore continues to contain model_step_wall_s/chunk_fps and omits total_s, so the raw artifact and every direct consumer keep the non-canonical contract described in #564; the first acceptance criterion remains open. I added assert result.metrics["total_s"] == result.metrics["model_step_wall_s"] to test_model_loop_maps_wasd_to_shared_camera_input_and_metrics, and the PR head fails with KeyError: 'total_s'. Assigning total_s beside model_step_wall_s in Cam2VModelLoop.step() gives every consumer the canonical key. This parser alias can also remain for historical artifacts.
The metrics.py alias backfilled total_s only inside the stats-file ingest path, after the runtime artifact was already written, so StepResult.metrics itself (and anything reading it directly) still carried only model_step_wall_s/chunk_fps. Setting total_s alongside model_step_wall_s in step() gives every consumer the canonical key; the parser-side alias stays for historical artifacts recorded before this change. Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
|
You're right, the alias only patched the ingest path, so StepResult.metrics itself never got total_s. Pushed 7f1270a: Cam2VModelLoop.step() now sets total_s alongside model_step_wall_s at the source, and the parser alias stays for historical artifacts. Added your assertion to the existing WASD test: fails with KeyError: 'total_s' on the prior commit, passes now. Ran it CPU-only (torch cpu wheel, no GPU here) along with the rest of test_application.py and test_benchmark_harness.py, 59 passed, 1 skipped, ruff clean on both files. |
ZenAlexa
left a comment
There was a problem hiding this comment.
Cam2V now emits total_s in the producer, and the parser preserves an explicit canonical value. The runtime-metrics and runtime-records tests pass at 7f1270a8 (59 passed, 1 skipped); restoring the previous producer reproduces KeyError: 'total_s' in the regression. The raw artifact, throughput summary, and report paths now share the metric.
Refs #564
Cam2V's session.py reports its per-step duration and rate as
model_step_wall_s/chunk_fps, and_generated_fps_for_step/_generated_fps_summaryonly ever look attotal_s(falling back tomodel_step_s), so LingBot's Cam2V scenarios never get a derivedgenerated_fps, andharness.py'stotal_shighlights come up empty too.I went with the "report
total_salongside the existing key" option rather than renaming: the runtime-metric-samples ingest path had no key-normalization step at all (unlike the stats-rows path, which already has_KEY_OVERRIDESfor this), so I added a small alias step there that backfillstotal_sfrommodel_step_wall_swhen a step doesn't already reporttotal_s.model_step_wall_sstays in the output. Oncetotal_sis present, the existing fallback in_generated_fps_for_step/_generated_fps_summaryderivesgenerated_fpson its own, andharness.py'stotal_s_median/startup_step_total_shighlights andreport.py's headline cards pick it up with no changes needed there.This covers the LingBot scenarios dropping
generated_fpsand the headline cards, not the regression-gate part of the issue (the metric name lists that skip instead of failing). I couldn't find that gate's config in this repo, so if it lives in an internal tool this half may need a separate change there.Added
test_runtime_benchmark_stats_backfills_total_s_from_model_step_wall_s: feeds amodel_step_wall_s/chunk_fpssample throughrecords_from_stats_fileand checks bothtotal_sandgenerated_fpscome out. The new test fails without the change. The existing runtime-metric-samples tests (group-by-step, warmup exclusion, the v2 sink one) still pass unchanged.Couldn't run the full suite locally, this workspace needs CUDA/transformer-engine to build. Checked the change with ruff (check and format, both clean) and by loading
tools/benchmarks/metrics.pydirectly with no other project dependencies, since the module itself only imports the standard library.