Skip to content

[2.0] Reject unknown benchmark.type at load; delete dead BenchmarkType enum - #393

Closed
ishandhanani wants to merge 1 commit into
idhanani/srt2-07-cluster-gpu-defaultsfrom
idhanani/srt2-08-benchmark-validation
Closed

ishandhanani wants to merge 1 commit into
idhanani/srt2-07-cluster-gpu-defaultsfrom
idhanani/srt2-08-benchmark-validation

Conversation

@ishandhanani

Copy link
Copy Markdown
Collaborator

Summary

Eighth PR of the 2.0 stack (plan: #385, Track 2 step 4, safe half). Stacked on #392.

An unknown benchmark.type (a typo like gsm8k-bench, or a removed type) loaded fine and only failed deep in the benchmark stage after a full allocation. SrtConfig.__post_init__ now validates benchmark.type against the runner registry plus the special manual type, so a bad type fails at load / dry-run. The import is lazy and guarded, so a registry import hiccup never blocks a load.

The BenchmarkType enum listed 10 of the 13 registered types and had zero references; it is removed. The registry (register_benchmark / list_benchmarks) is the single source of truth.

Scope note: this is the safe half of the benchmark step. It validates the type. The per-type field split (rejecting stray fields such as use_chat_template on a custom benchmark, via a discriminated union) is deferred to a follow-up, because a wrong per-type allowlist would hard-error a valid recipe and needs the golden corpus to land safely.

Validation

  • ruff clean; full suite: 1766 passed
  • tests/test_configs.py::TestBenchmarkTypeValidation: registered + manual types load, gsm8k-bench rejected at load, enum is gone

Stack

8 of the stack; see #386-#392 for the earlier PRs.

…pe enum

An unknown benchmark.type (a typo like `gsm8k-bench`, or a removed type)
loaded fine and only failed deep in the benchmark stage after a full
allocation. SrtConfig.__post_init__ now checks benchmark.type against the
runner registry plus the special `manual` type, so a bad type fails at
load / dry-run instead. The registry import is lazy and guarded, so an
import hiccup never blocks a load.

The BenchmarkType enum listed 10 of the 13 registered types and had zero
references anywhere; it is removed. The registry (register_benchmark /
list_benchmarks) is the single source of truth for valid types.

This is the safe half of the benchmark step: it validates the type. The
per-type field split (rejecting stray fields like use_chat_template on a
custom benchmark) is deferred to the discriminated-union follow-up.

Part of the 2.0 plan: #385
@ishandhanani

Copy link
Copy Markdown
Collaborator Author

Consolidated into #407, which carries these same commits as one PR against main (this description is reproduced there as one of its parts). Closing to keep review in one place; the branch stays for per-step reference via stack #398.

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.

1 participant