You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf9d12b
Browse filesBrowse the repository at this point in the historyBrowse files
feat(metrics): consolidate gpt-oss/deepseek accuracy, dedup reporting, surface TPS
Consolidate per-dataset accuracy reporting, reorganize the run-artifact layout to
the MLCommons submission shape, and fix accuracy-denominator correctness across
the scorers.
BREAKING (report artifacts):
- Remove results.json. A run now writes two separate artifacts:
* performance/result_summary.json - perf rollups (latency / TTFT / TPOT / OSL
percentiles, qps, and the newly-surfaced tps). Accuracy is no longer in it.
* accuracy/accuracy_results.json - accuracy_scores, always a LIST of one entry
per accuracy dataset (previously a dict); an empty list when no accuracy
datasets ran.
- Both artifacts are written atomically (tmp + fsync(file) + rename +
fsync(parent dir)) via the new utils/atomic_write.py.
- All readers migrated off results.json: metrics/report.py, compliance/checker.py,
metrics/results_plots.py, scripts/publish_submission.py,
evaluation/bfcl_v4_multi_turn_cli.py, and the examples. Downstream tooling that
parsed results.json (e.g. the upstream submission checker) must switch to the
two new paths.
Per-dataset accuracy consolidation:
- _score_accuracy returns one entry per accuracy dataset, each carrying
dataset_name, score, unit_samples, num_repeats, total_samples, complete,
dataset_type, plus an optional per-subset breakdown, response_counts, and
output_sequence_lengths.
- Remove the bespoke gpt-oss-120b composite dataset + scorer; gpt-oss now reports
as its constituent per-subset datasets like every other model.
- average_accuracy adds a cross-dataset mean over the accuracy components,
excluding the inline perf-scored entry.
- Drop the duplicated DeepSeek overall fields from the breakdown block; the
headline overall lives on the entry's scalar score.
dataset_type discriminator:
- Add a DatasetType (PERFORMANCE / ACCURACY) discriminator on the accuracy config,
serialized onto each entry. Averaging, plotting, and the compliance gate branch
on dataset_type instead of dataset_name == "performance", so a dataset
legitimately named "performance" is no longer misclassified.
OSL / tokenization:
- Per-dataset output-sequence-length stats for accuracy datasets, computed
post-run (off the hot path) from a shared reference tokenizer
(token_metrics.load_reference_backend / encode_lengths) rather than a bespoke
tokenizer or unreliable server completion_tokens; wall-clock recorded as
osl_tokenize_s.
- Single-source the token-series (OSL/ISL) builder in
metrics_aggregator/registry.build_token_series_dict; report.py and the
aggregator now share it (removes duplicated HDR constants + private imports).
- Split the scorer output contract into get_raw_outputs (what the model
generated) and get_scoring_outputs (text to score; only BFCL overrides).
Accuracy-denominator correctness (missing-as-failure):
- Base Scorer.score() now divides by the ISSUED count (len(sample_index_map),
written at issue time), not the surviving COMPLETE subset. A partial run
(drain-timeout / crash) no longer reports accuracy inflated over only the
samples that came back, and an all-missing run yields 0.0 instead of
mean([]) == NaN (invalid JSON).
- BFCLv4Scorer.score() (the compliance-gated scorer) gets the same fix by padding
each issued-but-missing sample as 0.0 under its subset, plus
drop_duplicates(sample_uuid) so a duplicate COMPLETE cannot double-weight a
sample. total_samples keeps its completed-count meaning (read by
min_sample_count); a new issued_samples records the accuracy denominator.
- DeepSeek-R1 accuracy runs the vendored MLCommons evaluator out-of-process; its
denominator is unchanged.
Compliance gate:
- check_accuracy reads the accuracy entry + breakdown and falls back to the
entry's scalar score for overall_accuracy when the breakdown omits it
(DeepSeek-style), matching the plot path.
- Move the BFCL golden-metric -> breakdown-key map out of the generic
accuracy_results.py into a dependency-light evaluation/bfcl_v4_metrics.py, so
compliance and plots import it without pulling in the heavy BFCL scorer / the
optional bfcl extra.
Report layout:
- Conform to the mlcommons/inference#2628 layout (result_summary.json under
performance/, accuracy_results.json under accuracy/). Surface tps (output
tokens/sec over the run window) and per-accuracy-phase durations.
Robustness / serialization:
- Coerce numpy scalar scores to native Python float for JSON serialization.
Dependencies (pip-audit CVE floors):
- pillow 12.2.0 -> 12.3.0, click >= 8.3.3, setuptools >= 83.0.0.
Tests:
- New / expanded coverage: test_score_accuracy, test_accuracy_results,
test_scoring (denominator), test_bfcl_v4_scorer (missing / duplicate),
test_bfcl_v4_metrics, test_report_builder, test_results_plots, test_atomic_write,
test_deepseek_r1_scorer, test_publish_submission, plus integration updates.
---------
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|**DeepSeek-R1 (MLPerf)**|`src/inference_endpoint/evaluation/scoring.py` (`LegacyMLPerfDeepSeekR1Scorer`), `examples/07_DeepSeekR1_Example/`| MLPerf DeepSeek-R1 accuracy. TensorRT-LLM is OpenAI-compatible, so it is served via `api_type: openai` / `openai_completions` (no dedicated trtllm adapter). The combined multi-subset eval (`math500`/`aime`/`gpqa`/`mmlu_pro`/`livecodebench`) is the official MLCommons `eval_accuracy.py`, run out-of-process via `uv run --project` against the isolated subproject at `src/inference_endpoint/evaluation/legacy_mlperf_deepseek_r1/` (a uv subproject excluded from the parent wheel; mirrors the VBench pattern). The example feeds the exact MLPerf prompt via pre-tokenized `input_tokens` to `/v1/completions`. |
101
101
|**VideoGen**|`src/inference_endpoint/videogen/`| Adapter for video-generation endpoints (e.g. trtllm-serve `POST /v1/videos/generations`, used by MLPerf WAN2.2-T2V-A14B). Defaults to `response_format=video_path` (server saves video to shared storage and returns path) to avoid large byte payloads. Accuracy mode also runs on `video_path`: the adapter mirrors the path into `response_output` so the event log carries it to `VBenchScorer` (see `evaluation/scoring.py`), which scores videos via VBench from a sibling `uv` subproject at `examples/09_Wan22_VideoGen_Example/accuracy/` (vbench's `transformers==4.33.2` + `numpy<2` pins are incompatible with the parent env, so it runs out-of-process via `uv run --project`). Dataset is ingested via the generic JSONL loader. |
102
-
|**Compliance (submission checker)**|`src/inference_endpoint/compliance/checker.py`, `scripts/check_compliance.py`| Validates a completed run's report directory against a registered ruleset. `check_submission(report_dir, ruleset, model)` reads the resolved `config.yaml` plus scorer output (`results.json` for accuracy, `scores.json` for the agentic perf run) and runs config-lock (deterministic + single-stream), the accuracy gate (`score >= factor x reference`, factor 0.97 for Edge-Agentic), and run validity (0 dropped turns). Server-side launch flags (`--reasoning off`, `--ctx-size`) aren't in client artifacts, so they're surfaced as manual attestations. CLI: `scripts/check_compliance.py REPORT_DIR` (exit 0 = pass).|
102
+
|**Compliance (submission checker)**|`src/inference_endpoint/compliance/checker.py`, `scripts/check_compliance.py`| Validates a completed run's report directory against a registered ruleset. `check_submission(report_dir, ruleset, model)` reads the resolved `config.yaml` plus scorer output (`accuracy/accuracy_results.json` for accuracy, `scores.json` for the agentic perf run) and runs config-lock (deterministic + single-stream), the accuracy gate (`score >= factor x reference`, factor 0.97 for Edge-Agentic), and run validity (0 dropped turns). Server-side launch flags (`--reasoning off`, `--ctx-size`) aren't in client artifacts, so they're surfaced as manual attestations. CLI: `scripts/check_compliance.py REPORT_DIR` (exit 0 = pass). |
103
103
|**Compliance (audit tests)**|`src/inference_endpoint/compliance/`, `commands/audit.py`| MLPerf compliance audits. `AuditTest` protocol + `AuditRunSpec`/`AuditRunArtifacts` + registry (`compliance/__init__.py`); `OutputCachingAudit` (`compliance/audit_test/output_caching_test.py`, which also owns the QPS-specific `AuditRunStats`) implements MLPerf **TEST04** output-caching detection — reference phase (distinct samples) vs. fixed-sample audit phase, comparing QPS against `threshold`. `commands/audit.py:run_audit` runs phases via `AuditTest.plan_runs`/`validate`, writing `audit_result.json`/`verify_<TEST>.txt` atomically via `compliance/result.py`. Enabled by the `audit:` YAML block; `cli._run` runs it after the main benchmark (upstream MLPerf order: perf run, then TEST04), or standalone with `audit.only: true`. Performance-only. |
0 commit comments