Skip to content

Commit 2a4e153

Browse files
committed
docs: current-state pass over the timeout surface
Fix references left behind by the consolidation: renamed drain knob in session.py docstring, argv-vs-schema 0-sentinel wording in the aggregator snapshot/help text, config module pointers after the schema split, the from-config flag surface in CLI_QUICK_REFERENCE, regenerate-templates trigger lists, the config DESIGN nested-model table, and the compliance plan's duration-floor note. schema.py re-exports HTTPClientConfig again.
1 parent 344a376 commit 2a4e153

13 files changed

Lines changed: 40 additions & 40 deletions

File tree

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The aggregator is a separate process (`python -m inference_endpoint.async_utils.
128128
CLI is auto-generated from `config/schema.py` Pydantic models via cyclopts. Fields annotated with `cyclopts.Parameter(alias="--flag")` get flat shorthands; all other fields get auto-generated dotted flags (kebab-case).
129129

130130
- **CLI mode** (`offline`/`online`): cyclopts constructs `OfflineBenchmarkConfig`/`OnlineBenchmarkConfig` (subclasses in `config/schema.py`) directly from CLI args. Type locked via `Literal`. `--dataset` is repeatable with TOML-style format `[perf|acc:]<path>[,key=value...]` (e.g. `--dataset data.csv,samples=500,parser.prompt=article`). Full accuracy support via `accuracy_config.eval_method=pass_at_1` etc.
131-
- **YAML mode** (`from-config`): `BenchmarkConfig.from_yaml_file()` loads YAML, resolves env vars, and auto-selects the right subclass via Pydantic discriminated union. Optional `--timeout` (maps to `settings.timeouts.run_timeout_s`)/`--mode` overrides via `config.with_updates()`.
131+
- **YAML mode** (`from-config`): `BenchmarkConfig.from_yaml_file()` loads YAML, resolves env vars, and auto-selects the right subclass via Pydantic discriminated union. Optional `--timeout` override maps to `settings.timeouts.run_timeout_s` via `config.with_updates()`; `--mode` selects the `TestMode` passed to the runner.
132132
- **eval**: Not yet implemented (raises `CLIError` with a tracking issue link)
133133

134134
### Config Construction & Validation
@@ -315,7 +315,7 @@ All of these run automatically on commit:
315315
- `mypy` type checking
316316
- `prettier` for YAML/JSON/Markdown
317317
- License header enforcement
318-
- `regenerate-templates`: auto-regenerates YAML config templates from schema defaults when `schema.py`, `config.py`, or `regenerate_templates.py` change
318+
- `regenerate-templates`: auto-regenerates YAML config templates from schema defaults when any config schema module (`schema|audit|model_params|datasets|settings|timeouts`.py), `endpoint_client/config.py`, or `regenerate_templates.py` changes
319319

320320
**IMPORTANT: Always run `pre-commit run --all-files` before every commit.** Hooks may modify files (prettier, ruff-format, license headers). If files are modified, stage the changes and commit once. Never commit without running pre-commit first.
321321

‎docs/CLI_DESIGN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Both paths produce the **same subclass with the same defaults**. A YAML file wit
6767

6868
2. **Auto-selects subclass.** `type: "offline"` → `OfflineBenchmarkConfig`, `type: "online"` → `OnlineBenchmarkConfig`, others → base `BenchmarkConfig`.
6969

70-
3. **Optional CLI overrides.** `--timeout` and `--mode` applied via `config.with_updates(...)` which re-runs validators.
70+
3. **Optional CLI overrides.** `--timeout` maps into `settings.timeouts.run_timeout_s` via `with_updates(...)` (re-runs validators); `--mode` selects the `TestMode` passed to the runner and never touches the config object.
7171

7272
### Why subclasses?
7373

‎docs/CLI_QUICK_REFERENCE.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@ Flag names shown as `--full.dotted.path --alias`. Both forms work.
102102
- `--endpoint-config.api-key --api-key` - API authentication
103103
- `--endpoint-config.api-type --api-type` - API type: openai/sglang (default: openai)
104104
- `--report-dir` - Report output directory
105-
Note: applies to CLI-driven `benchmark offline` / `benchmark online`; `benchmark from-config`
106-
does not expose a CLI override for `report_dir`. Set it in the YAML only if you need to control
107-
the output location; otherwise a default report directory is used.
105+
Note: `benchmark from-config` also accepts `--report-dir` as an override of the YAML value;
106+
when neither is set a default report directory is used.
108107
- `--timeout` - Whole-run watchdog in seconds (off by default). If it fires, the run is aborted, the report is marked INTERRUPTED, and the process exits non-zero.
109108
- `--enable-cpu-affinity / --no-cpu-affinity` - NUMA-aware CPU pinning (default: true)
110109
- `--no-early-stopping` - opt out of the MLPerf early-stopping percentile estimates in `result_summary.json` (default: on; see [early_stopping.md](early_stopping.md))
@@ -307,8 +306,8 @@ inference-endpoint init submission
307306
# 3. Run (YAML mode)
308307
inference-endpoint benchmark from-config \
309308
--config submission_template.yaml
310-
# Note: from-config only accepts --config, --timeout, and --mode via CLI.
311-
# Set report_dir in the YAML if you need a specific output location.
309+
# from-config accepts --config, --timeout, --mode, --accuracy-only, and
310+
# --report-dir; everything else comes from the YAML.
312311
```
313312

314313
### Validate First

‎docs/DEVELOPMENT.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ docs/short-description
198198

199199
## YAML Config Templates
200200

201-
Config templates in `src/inference_endpoint/config/templates/` are auto-generated from schema defaults. When you change `config/schema.py`, regenerate them:
201+
Config templates in `src/inference_endpoint/config/templates/` are auto-generated from schema defaults. When you change any config schema module (`config/schema.py` and its sibling domain modules), regenerate them:
202202

203203
```bash
204204
uv run python scripts/regenerate_templates.py

‎docs/async_utils/services/metrics_aggregator/DESIGN.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ COMPLETE event ─► trigger.fire ─► queue.enqueue(text, on_count) [
122122

123123
`--drain-timeout` and `--tokenizer-workers` have service-side defaults (`0`
124124
and `2`) so the service is launchable by hand without tuning knobs, but
125-
`config/schema.py` is the single source of truth: the benchmark always
125+
the config schema is the single source of truth (`settings.timeouts.metrics_drain_timeout_s`
126+
in `config/timeouts.py`, `settings.metrics_tokenizer_workers` in `config/settings.py`): the benchmark always
126127
forwards the schema values (`--metrics-drain-timeout`,
127128
`--metrics-tokenizer-workers`), overriding these defaults in normal runs.
128129

‎docs/compliance_audit_plan.md‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,12 @@ Two scenarios must be covered: **Offline** (`max_throughput`) and **SingleStream
523523
> catches a crashed run — but the examples default to equal for the clearest, least-contentious
524524
> comparison.
525525
526-
> **`min_duration` is not a duration floor (current limitation).** The load-generator stop
527-
> check (`session.py`) halts a phase on **sample count** or **`max_duration_ms`** only;
528-
> `min_duration_ms` merely _derives_ a count when no explicit count is set. Because TEST04
529-
> drives an explicit `samples` count, each phase stops at `samples` and `min_duration_ms` is
530-
> **not** honored as a "run for at least 10 minutes" floor. MLCommons' 10-minute compliance
531-
> minimum therefore is **not** enforced today; combining a count floor with a duration floor
532-
> ("AND-semantics") is future work. Set `samples` large enough that each phase reaches a
533-
> stable throughput on its own.
526+
> **No duration floor (current limitation).** Runs are count-driven: the load-generator stop
527+
> check (`session.py`) halts a phase on **sample count** or **`runtime.max_duration_ms`**
528+
> only, and TEST04 drives explicit `samples` / `audit_samples` counts. MLCommons' 10-minute
529+
> compliance minimum therefore is **not** enforced today; combining a count floor with a
530+
> duration floor ("AND-semantics") is future work. Set `samples` large enough that each phase
531+
> reaches a stable throughput on its own.
534532
535533
Both scenarios ship as committed configs (see also
536534
[`compliance/audit_test/README.md`](../src/inference_endpoint/compliance/audit_test/README.md)):

‎docs/config/DESIGN.md‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ the benchmark `type` and `endpoint_config`.
4545

4646
Key nested models:
4747

48-
| Model | Purpose |
49-
| ---------------- | --------------------------------------------------- |
50-
| `LoadPattern` | Pattern type + parameters (target QPS, concurrency) |
51-
| `RuntimeConfig` | Duration, sample count, RNG seeds |
52-
| `ClientSettings` | Worker count and HTTP client settings |
53-
| `EndpointConfig` | Endpoint URLs, API key |
54-
| `Dataset` | Dataset path, type (performance / accuracy) |
48+
| Model | Purpose |
49+
| ------------------ | ----------------------------------------------------------- |
50+
| `LoadPattern` | Pattern type + parameters (target QPS, concurrency) |
51+
| `RuntimeConfig` | Sample count, perf-phase cap (`max_duration_ms`), RNG seeds |
52+
| `Timeouts` | All global waits/deadlines (`settings.timeouts`) |
53+
| `HTTPClientConfig` | Worker count and HTTP client settings (`settings.client`) |
54+
| `EndpointConfig` | Endpoint URLs, API key |
55+
| `Dataset` | Dataset path, type (performance / accuracy) |
5556

5657
### `RuntimeSettings` (frozen dataclass)
5758

@@ -145,8 +146,8 @@ to the report output.
145146
| Consumer | Usage |
146147
| ------------------------------- | ------------------------------------------------------------ |
147148
| `load_generator/session.py` | Receives `RuntimeSettings` at construction |
148-
| `load_generator/scheduler.py` | Reads `load_pattern`, `n_samples_to_issue`, RNG seeds |
149+
| `load_generator/strategy.py` | Reads `load_pattern`, `n_samples_to_issue`, RNG seeds |
149150
| `endpoint_client/config.py` | Reads `api_type`, `num_workers`, streaming mode |
150-
| `metrics/reporter.py` | Reads `reported_metrics`, duration bounds |
151+
| `metrics/report.py` | Reads `reported_metrics`, duration bounds |
151152
| `commands/benchmark/cli.py` | Defines benchmark subcommands and resolves CLI vs YAML input |
152153
| `commands/benchmark/execute.py` | Runs the benchmark lifecycle from resolved configuration |

‎src/inference_endpoint/async_utils/services/metrics_aggregator/__main__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async def main() -> None:
145145
"Wall-clock budget (seconds) to finish tokenizing buffered samples "
146146
"after ENDED before the aggregator emits the final snapshot with "
147147
"n_pending_tasks > 0 (0 = wait indefinitely, the default; the "
148-
"benchmark forwards the schema default, see config/schema.py). "
148+
"benchmark forwards the schema default, see config/timeouts.py). "
149149
"Increase for very large datasets where the end-of-run tokenize "
150150
"batch is big."
151151
),
@@ -176,7 +176,7 @@ async def main() -> None:
176176
"In-process tokenizer threads for live (mid-run) ISL/OSL/TPOT "
177177
"(0 = no mid-run tokenization, everything defers to the "
178178
"end-of-run drain; the benchmark forwards the schema default, "
179-
"see config/schema.py). The drain always uses the auto-sized "
179+
"see config/settings.py). The drain always uses the auto-sized "
180180
"sharded pool — one worker process per 8-core block."
181181
),
182182
)

‎src/inference_endpoint/async_utils/services/metrics_aggregator/snapshot.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SessionState(str, Enum):
4545
LIVE → run in progress; tick task publishing live HDR-derived stats.
4646
DRAINING → ``SessionEventType.ENDED`` has been received; the aggregator
4747
is tokenizing the buffered samples (bounded by the
48-
``--drain-timeout`` budget — schema default 0 = unlimited). Tick task
48+
``--drain-timeout`` budget — argv 0 = unlimited; the schema knob ``settings.timeouts.metrics_drain_timeout_s`` uses None, converted at the argv boundary). Tick task
4949
continues at this stage, still HDR-derived; no new events
5050
will arrive.
5151
COMPLETE → terminal clean state. The ``publish_final()`` snapshot

‎src/inference_endpoint/config/schema.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
)
5252

5353
from ..core.types import APIType
54+
from ..endpoint_client.config import HTTPClientConfig
5455
from ..exceptions import CLIError
5556
from ..utils import WithUpdatesMixin
5657
from .audit import AuditConfig, AuditTestId, OutputCachingTestConfig
@@ -97,6 +98,7 @@
9798
"EarlyStoppingConfig",
9899
"EndpointConfig",
99100
"EvalMethod",
101+
"HTTPClientConfig",
100102
"LoadPattern",
101103
"LoadPatternType",
102104
"ModelParams",

0 commit comments

Comments
 (0)