Skip to content

refactor(benchmark): remove redundant accuracy_datasets from BenchmarkContext - #437

Merged
arekay-nv merged 4 commits into
mainfrom
refactor/remove-accuracy-datasets-field
Aug 17, 2026
Merged

refactor(benchmark): remove redundant accuracy_datasets from BenchmarkContext#437
arekay-nv merged 4 commits into
mainfrom
refactor/remove-accuracy-datasets-field

Conversation

@arekay-nv

Copy link
Copy Markdown
Collaborator

Summary

  • Removes accuracy_datasets: list[Dataset] from BenchmarkContext — it was a parallel copy of data already carried by eval_configs: list[AccuracyConfiguration] via the .dataset field
  • _load_datasets return type drops the middle list[Dataset] element; all call sites updated
  • _summarize_and_log_metrics acc_total now uses ec.num_repeats (the canonical AccuracyConfiguration field, consistent with accuracy.py) and filters by dataset_type == ACCURACY explicitly rather than relying on an implicit invariant
  • Restores three dataset-level sample assertions in override tests (eval_configs[0].dataset.load_sample(0)) that were dropped during the migration

Test plan

  • uv run pytest tests/unit/commands/test_benchmark.py — 178 tests pass
  • All override tests (TestLoadDatasetsGenerationConfigOverrideChat, TestLoadDatasetsGenerationConfigOverrideCompletions) pass with restored sample-level assertions

🤖 Generated with Claude Code

…kContext

`accuracy_datasets: list[Dataset]` was a parallel copy of data already
carried by `eval_configs: list[AccuracyConfiguration]` via the
`.dataset` field. Remove it and update all callers to use
`eval_configs` directly.

- `_load_datasets` return type drops the middle `list[Dataset]` element
- `_summarize_and_log_metrics` acc_total now uses `ec.num_repeats`
  (the canonical AccuracyConfiguration field, consistent with
  accuracy.py) and filters by `dataset_type == ACCURACY` explicitly
- All call sites and test mocks updated
- Restored three dataset-level sample assertions in override tests
  that were lost in the migration (now via `eval_configs[0].dataset`)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@arekay-nv
arekay-nv requested a review from a team August 4, 2026 04:35
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@github-actions
github-actions Bot requested a review from nvzhihanj August 4, 2026 04:35

@roborluo roborluo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arekay-nv
arekay-nv merged commit 4b3e7af into main Aug 17, 2026
9 checks passed
@arekay-nv
arekay-nv deleted the refactor/remove-accuracy-datasets-field branch August 17, 2026 21:47
arekay-nv added a commit that referenced this pull request Aug 18, 2026
main #437 refactored _load_datasets to return (dataloader, eval_configs).
test_accuracy_only_skips_salt_validation is branch-only, so the merge kept
its stale 3-tuple unpack — the sole site the merge missed. Adopt the 2-tuple
form; perf_loader is still the first element, so the assertion is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
viraatc added a commit that referenced this pull request Aug 18, 2026
Reviewer feedback on the split granularity (5 new modules felt like too
many): collapse to settings.py + workload.py, criterion 'keep together
what changes together'.

- settings.py absorbs timeouts.py: Timeouts is the settings.timeouts
  sub-model and changes with the settings block.
- workload.py = model_params.py + datasets.py: the request payload and
  data definition (generation params, submission ref, datasets, accuracy
  config, generation-override merge helpers).
- audit.py folds into schema.py beside the root aggregates its audit:
  block plugs into.

schema.py stays the re-export hub, so no import site outside config/
changes except three tests that imported config.timeouts directly.
The regenerate-templates pre-commit hook now matches every config/*.py
instead of an enumerated module list, so a consolidated module cannot
silently skip template regeneration.

Also updates a stale 3-tuple _load_datasets mock left behind by the
rebase onto main (#437 changed the return arity to 2).
viraatc added a commit that referenced this pull request Aug 18, 2026
…ackage

Reviewer feedback on the split granularity (5 new sibling modules felt
like too many, and config/settings.py was confusable with the
pre-existing config/runtime_settings.py): the declared YAML/CLI surface
now lives in one namespaced package, config/schema/, three modules
total — criterion 'keep together what changes together'.

- schema/__init__.py: the former schema.py — root aggregates
  (BenchmarkConfig/EndpointConfig), cross-field validation, root-level
  TestType/TestMode, the small audit: block (absorbed from audit.py),
  and the re-export hub, so every config.schema import site is
  unchanged.
- schema/settings.py: the settings: subtree; absorbs timeouts.py
  (Timeouts is the settings.timeouts sub-model).
- schema/workload.py: request payload + data definition; merges
  model_params.py + datasets.py (generation params, submission ref,
  datasets, accuracy config, generation-override merge helpers).

config/ top level now separates cleanly for readers: schema/ = what
users declare; runtime_settings.py = the resolved run plan; rulesets/
et al. = policy machinery.

The regenerate-templates pre-commit hook now matches every config
module (including schema/*) instead of an enumerated filename list, so
a moved module cannot silently skip template regeneration.

Also updates a stale 3-tuple _load_datasets mock left behind by the
rebase onto main (#437 changed the return arity to 2).
viraatc added a commit that referenced this pull request Aug 18, 2026
Reviewer discussion on #409 settled on keeping this MR about the
timeout-knob consolidation; the schema.py monolith split (whatever its
final shape) moves to a dedicated follow-up MR. schema.py stays one
module — the declared YAML/CLI surface, distinct from the resolved run
plan in runtime_settings.py — now containing the settings: subtree
(incl. the frozen Timeouts at settings.timeouts), the workload
definition (model_params:/datasets:), the root aggregates, and the
audit: block, in that order with section banners.

Kept from the split work, split-independent:
- the regenerate-templates pre-commit hook matches every config/*.py
  instead of an enumerated filename list, so a renamed module cannot
  silently skip template regeneration.
- enums.py stays dissolved: each enum lives beside its owner.
- a stale 3-tuple _load_datasets mock left by the rebase onto main
  (#437 changed the return arity to 2) stays fixed.
viraatc added a commit that referenced this pull request Aug 18, 2026
Reviewer discussion on #409 settled on keeping this MR about the
timeout-knob consolidation; the schema.py monolith split (whatever its
final shape) moves to a dedicated follow-up MR. schema.py stays one
module — the declared YAML/CLI surface, distinct from the resolved run
plan in runtime_settings.py — now containing the settings: subtree
(incl. the frozen Timeouts at settings.timeouts), the workload
definition (model_params:/datasets:), the root aggregates, and the
audit: block, in that order with section banners.

Kept from the split work, split-independent:
- the regenerate-templates pre-commit hook matches every config/*.py
  instead of an enumerated filename list, so a renamed module cannot
  silently skip template regeneration.
- enums.py stays dissolved: each enum lives beside its owner.
- a stale 3-tuple _load_datasets mock left by the rebase onto main
  (#437 changed the return arity to 2) stays fixed.
viraatc added a commit that referenced this pull request Aug 18, 2026
Reviewer discussion on #409 settled on keeping this MR about the
timeout-knob consolidation; the schema.py monolith split (whatever its
final shape) moves to a dedicated follow-up MR. schema.py stays one
module — the declared YAML/CLI surface, distinct from the resolved run
plan in runtime_settings.py — now containing the settings: subtree
(incl. the frozen Timeouts at settings.timeouts), the workload
definition (model_params:/datasets:), the root aggregates, and the
audit: block, in that order with section banners.

Kept from the split work, split-independent:
- the regenerate-templates pre-commit hook matches every config/*.py
  instead of an enumerated filename list, so a renamed module cannot
  silently skip template regeneration.
- enums.py stays dissolved: each enum lives beside its owner.
- a stale 3-tuple _load_datasets mock left by the rebase onto main
  (#437 changed the return arity to 2) stays fixed.
viraatc added a commit that referenced this pull request Aug 20, 2026
Reviewer discussion on #409 settled on keeping this MR about the
timeout-knob consolidation; the schema.py monolith split (whatever its
final shape) moves to a dedicated follow-up MR. schema.py stays one
module — the declared YAML/CLI surface, distinct from the resolved run
plan in runtime_settings.py — now containing the settings: subtree
(incl. the frozen Timeouts at settings.timeouts), the workload
definition (model_params:/datasets:), the root aggregates, and the
audit: block, in that order with section banners.

Kept from the split work, split-independent:
- the regenerate-templates pre-commit hook matches every config/*.py
  instead of an enumerated filename list, so a renamed module cannot
  silently skip template regeneration.
- enums.py stays dissolved: each enum lives beside its owner.
- a stale 3-tuple _load_datasets mock left by the rebase onto main
  (#437 changed the return arity to 2) stays fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants