Skip to content

feat(report): record run_config (load/runtime settings) in result_summary.json#377

Open
nvzhihanj wants to merge 1 commit into
mainfrom
fix/report-fieldorder-gitsha
Open

feat(report): record run_config (load/runtime settings) in result_summary.json#377
nvzhihanj wants to merge 1 commit into
mainfrom
fix/report-fieldorder-gitsha

Conversation

@nvzhihanj

@nvzhihanj nvzhihanj commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Record the run's load/runtime configuration in the benchmark report so a run is self-describing and reproducible from its own result_summary.json.

A single run_config field on Report is populated from the Pydantic config in one line:

settings.model_dump(mode="json", include={"runtime", "load_pattern", "warmup"})

The config model is the single source of truth — new/renamed config fields propagate automatically, with no hand-listing at the from_snapshot/finalize call site. Excluded: client (transport plumbing, not run-defining) and endpoint_config (api_key / endpoint URLs — a sibling of settings, so no secrets leak).

Example result_summary.json

From a real DGX-B300x8 DeepSeek-R1 server (poisson) run — qps/tps stay top-level, the run's settings (incl. seeds) are under run_config (metric dicts elided as { ... }):

{
  "version": "0.1.0",
  "git_sha": "...",
  "n_samples_completed": 40000,
  "duration_ns": 3328465383747,
  "state": "complete",
  "complete": true,
  "ttft": { ... }, "tpot": { ... }, "latency": { ... }, "output_sequence_lengths": { ... },
  "legacy_loadgen_window_duration_ns": 2753346633148,
  "qps": 14.53,
  "tps": 54489.98,
  "run_config":
  {
    "runtime": {
      "min_duration_ms": 600000,
      "max_duration_ms": 3600000,
      "n_samples_to_issue": 40000,
      "scheduler_random_seed": 42,
      "dataloader_random_seed": 42
    },
    "load_pattern": {
      "type": "poisson",
      "target_qps": 14.75,
      "target_concurrency": null,
      "use_legacy_loadgen_qps_metrics": true
    },
    "warmup": {
      "enabled": false,
      "n_requests": null,
      "salt": true,
      "drain": false,
      "warmup_random_seed": 42
    }
  }
}

Same, rendered in report.txt:

Run config:
  runtime: n_samples_to_issue=40000, scheduler_random_seed=42, dataloader_random_seed=42, min_duration_ms=600000, max_duration_ms=3600000
  load_pattern: type=poisson, target_qps=14.75, target_concurrency=None, use_legacy_loadgen_qps_metrics=True
  warmup: enabled=False, salt=True, drain=False, warmup_random_seed=42

Tests

  • run_config keyword-only passthrough; serialization + report.txt rendering; absent -> null.

Rebased on latest main (keeps PR #372's use_legacy_loadgen_qps_metrics; git_sha handled by #398).

🤖 Generated with Claude Code

@nvzhihanj nvzhihanj requested a review from a team June 26, 2026 17:40
@github-actions

Copy link
Copy Markdown

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

@github-actions github-actions Bot requested a review from arekay-nv June 26, 2026 17:40
@nvzhihanj nvzhihanj marked this pull request as draft June 26, 2026 17:41

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism to resolve the package's git commit SHA using git archive's export-subst feature via a new _git_archival.txt file, falling back to running git rev-parse anchored to the package directory. It also reorders the serialized JSON output of metrics reports to surface key throughput and run identity fields first. Feedback is provided regarding a potential issue where git rev-parse could traverse up to a parent repository if the package is installed in a virtual environment within an unrelated git repository, along with a suggestion to check for the existence of the .git directory first.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/inference_endpoint/utils/version.py Outdated
nvzhihanj added a commit that referenced this pull request Jun 26, 2026
…sha hack

Pivot to dynamic VCS versioning per review on #377:
- build backend uv_build -> hatchling + hatch-vcs; version is now `dynamic`,
  derived from git (nearest tag + commits-since + short SHA), written to
  src/inference_endpoint/_version.py at build time (gitignored). __version__ reads it.
- the commit SHA is embedded in the version string itself (e.g. 0.6.dev3+g6eac351),
  so the report's version is self-identifying for submitters; the stale hardcoded
  0.1.0 (unchanged since the first commit) is gone.
- get_git_sha now just parses the +g<sha> local segment from __version__ — drops the
  cwd-dependent `git rev-parse` and the hand-rolled _git_archival.txt parsing.
- git-archive/sdist/container builds (no .git) recover the version via the standard
  setuptools_scm .git_archival.txt export-subst.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nvzhihanj added a commit that referenced this pull request Jun 27, 2026
Per review on #377:
- Drop the result_summary.json key reordering (qps/tps after git_sha) — hard to
  maintain; Report.to_json goes back to plain field-order serialization.
- Add a 'loadgen' field to Report: the run's load-generation settings (benchmark
  mode, load pattern, target qps/concurrency, n_samples, duration bounds, workers),
  sourced from config at finalize like 'seeds'. Serialized into result_summary.json
  and rendered as a 'Load settings:' line in report.txt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nvzhihanj nvzhihanj force-pushed the fix/report-fieldorder-gitsha branch from 728749f to 4fe34b3 Compare June 27, 2026 04:37
@nvzhihanj nvzhihanj force-pushed the fix/report-fieldorder-gitsha branch from 4fe34b3 to bd458f5 Compare July 7, 2026 21:46
@nvzhihanj nvzhihanj marked this pull request as ready for review July 7, 2026 21:54
@nvzhihanj nvzhihanj changed the title fix(report): surface qps/tps/seeds after git_sha; track package git_sha feat(report): record run_config (load/runtime settings) in result_summary.json Jul 7, 2026
@nvzhihanj nvzhihanj force-pushed the fix/report-fieldorder-gitsha branch from bd458f5 to 10c1e36 Compare July 7, 2026 23:11
Snapshot the run's load/runtime configuration into the report so it is
self-describing and a run is identified by its settings. A single 'run_config'
field is populated from settings.model_dump(include={runtime, load_pattern,
warmup}) — the Pydantic config is the single source of truth, so new or renamed
config fields propagate automatically, with no hand-listing at the
from_snapshot/finalize call site. 'client' (transport plumbing) and
endpoint_config (api_key/URLs, a sibling of settings) are excluded — the latter
so no secrets leak. Rendered as a 'Run config:' block in report.txt.

Replaces the standalone 'seeds' field (#353): the RNG seeds now live under
run_config.runtime / run_config.warmup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nvzhihanj nvzhihanj force-pushed the fix/report-fieldorder-gitsha branch from 10c1e36 to bdcc983 Compare July 7, 2026 23:31
Comment on lines +1107 to +1110
run_config = ctx.config.settings.model_dump(
mode="json",
include={"runtime", "load_pattern", "warmup"},
)

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.

Should we replicate sections of the config.yaml here - if the goal is reproducibility, we will still need the config.yaml file to run unless we include the whole thing. Otherwise we might end up with inconsistency between the two.

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.

The saved run_config can differ from what actually ran.

Audit phases override the sample count and ordering in ctx.rt_settings. For example, TEST04 runs one phase with normal sampling and another that repeatedly issues one fixed sample. This code instead saves ctx.config.settings, which does not contain those overrides. Consequently, both phases produce identical run_config blocks and report n_samples_to_issue: null.

Suggested fix: record effective runtime settings from ctx.rt_settings, including the resolved sample count from total_samples_to_issue(), sample_order.kind, and sample_order.fixed_index. Consider placing these under run_config["resolved_runtime"] so the original user configuration remains distinct from resolved values. Please add an integration assertion that TEST04 reference and output-caching phase configurations differ.

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