Skip to content

fix(aiperf): report benchmark timings directly - #1630

Open
chaofengw-nv wants to merge 1 commit into
NVIDIA:mainfrom
chaofengw-nv:fix/aiperf-benchmark-perf
Open

chaofengw-nv wants to merge 1 commit into
NVIDIA:mainfrom
chaofengw-nv:fix/aiperf-benchmark-perf

Conversation

@chaofengw-nv

Copy link
Copy Markdown
Collaborator

Background

Benchmark qualification already uses one AIPerf response stream for quality and task-call timings. Its report still treats unequal generation lengths as an invalid performance result and treats capacity exclusions accepted by accuracy as missing timing responses. This contradicts the requested report: benchmark accuracy plus Native/TRTMC p50 from the same execution.

Exit Criteria

  • Benchmark timings report measured, partial, or unavailable coverage without an equal-work acceptance gate.
  • Capacity exclusions accepted by accuracy apply to both timing sides, with attempted counts retained.
  • Existing reports refresh from recorded responses without inference or changes to accuracy entries or gates.

Implementation

  • Separate timing availability from equal-work diagnostics; keep work, precision, and execution-condition observations in the evidence.
  • Record capacity rejection reasons and use the accuracy workload's exclusions across all seed repetitions.
  • Add an offline timing refresh to environment-free rejudge and show measurement status and coverage in Markdown/HTML.
  • Preserve fixed-workload historical diagnostics and task scoring contracts.

Change categories

  • Model or runtime behavior
  • Public API
  • ABI
  • Bundle or artifact format
  • Dependencies
  • Documentation only
  • CI or developer tooling

Validation

Commands and Results

  • PYTHONPATH=/tmp/trtmc-aiperf-accuracy-venv/lib/python3.12/site-packages:/home/chaofengw/workspace/TensorRT-Model-Connect/.venv-trtmc/lib/python3.12/site-packages:apps/aiperf_qual:apps/aiperf_qual/plugins /tmp/trtmc-aiperf-accuracy-venv/bin/python -m pytest apps/aiperf_qual/tests -q: 308 passed, 1 skipped.
  • ruff check --config ruff.toml apps/aiperf_qual/trtmc_aiperf_qual/{accuracy_recovery,benchmark_perf,cli,execution,judge,report,report_html,runner}.py apps/aiperf_qual/tests/{test_execution,test_benchmark_perf}.py: passed.
  • git diff --check: passed.
  • Offline replay of two original GB300 reports: passed. Qwen3-MoE retains all 2,019 samples and both p50 values; 97 unequal-work pairs remain diagnostic. Qwen3-Omni aligns both timing sides to the 2,145 accuracy samples, retains the 88 capacity exclusions and 33 unequal-work pairs, and reports p50 values. Accuracy entries and gates are identical before and after both replays. No inference was rerun.

Hardware, Environment, and Revisions

CPU validation uses Python 3.12 and the prepared AIPerf 0.13.0 qualification environment. The branch starts from 54d77286e (#1628); tested implementation head is 71a78cd93. Offline replay uses original GB300 benchmark records captured by source revision 587840c63 with the conversation-identity fix applied; no new GPU benchmark is claimed.

Not Run / Remaining Gaps

Changes are not deployed to the active GB300 campaigns. Full campaign inference continues with its current code. Fixed-workload diagnostics remain outside this benchmark-report correction. The COCO accuracy dependency test is skipped because pycocotools is absent from the CPU environment.

Contributor Self-Review

  • I have completed a self-review of this change.

Notes For Future Readers

Review the execution scope and measurement verdict before the refresh/reporting paths. Rejudge without an environment intentionally retains the recorded accuracy contract. Reports without execution evidence may reapply their saved aggregate verdict, but capacity reselection requires original execution and raw rejection records. No models, checkpoints, or bundles need rebuilding for this change.

Risk level

  • Low
  • Medium
  • High

The observable Perf status and the Native timing sample population change when accuracy excluded capacity rejections. Rejection counts, attempted counts, and work differences remain visible; missing or inconsistent capacity evidence fails rather than guessing a sample selection.

Report Native and TRTMC benchmark p50 as measurements while retaining work differences and partial coverage as diagnostics. Apply accuracy capacity exclusions to both timing sides and refresh saved reports without inference or changes to accuracy gates.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/TensorRT-Model-Connect/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 91cf1247-d812-4ade-9d7d-53f1f883b2fe
📥 Commits

Reviewing files that changed from the base of the PR and between 54d7728 and 71a78cd.

📒 Files selected for processing (11)
  • apps/aiperf_qual/README.md
  • apps/aiperf_qual/tests/test_benchmark_perf.py
  • apps/aiperf_qual/tests/test_execution.py
  • apps/aiperf_qual/trtmc_aiperf_qual/accuracy_recovery.py
  • apps/aiperf_qual/trtmc_aiperf_qual/benchmark_perf.py
  • apps/aiperf_qual/trtmc_aiperf_qual/cli.py
  • apps/aiperf_qual/trtmc_aiperf_qual/execution.py
  • apps/aiperf_qual/trtmc_aiperf_qual/judge.py
  • apps/aiperf_qual/trtmc_aiperf_qual/report.py
  • apps/aiperf_qual/trtmc_aiperf_qual/report_html.py
  • apps/aiperf_qual/trtmc_aiperf_qual/runner.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary

  • Treat benchmark timings as measurements, not acceptance gates. Reports distinguish measured, partial, and unavailable timing coverage. Work and precision differences remain diagnostic.
  • Apply accuracy capacity exclusions to both timing sides across seed repetitions. Keep attempted-request counts and report excluded requests.
  • Refresh saved timing evidence during environment-free rejudge. The refresh uses recorded execution data and does not rerun inference or alter accuracy entries or gates.
  • Update Markdown and HTML reports to show timing status, coverage, and capacity exclusions.
  • Tests were added for mismatched work, partial coverage, unavailable timings, capacity exclusions, and report refresh. The supplied PR objectives report 308 passed and 1 skipped, and report successful Ruff and git diff --check runs. These results were not independently verified here.

Architecture impact

  • Family-owned files: The changes are within the apps/aiperf_qual application package and its tests. The inspected files show no changes to model-family implementation code.
  • Changed shared surfaces: Within the application, execution.Session.natural_performance and paired_dataset change the timing-data contract. judge.verdict and the report renderers consume the resulting measurement status. benchmark_perf.refresh adds an offline refresh path, called by cli.rejudge_reports.
  • Dependency direction: The new refresh module uses the application’s absolute, execution, and judge modules and its Aiperf runner. The inspected call paths remain within the qualification application. No new cross-family dependency is shown.
  • Affected consumers: Qualification runs and accuracy recovery create natural-dataset timing entries. The judge, CLI rejudge flow, and Markdown and HTML reports consume those entries. Existing natural_performance() callers can omit the new accuracy argument because it has a default.
  • Unresolved blast-radius questions: The available evidence does not establish compatibility with every existing saved-report format or external report consumer. The supplied summary describes tests and offline replay, but those results were not independently inspected.
  • Review outcome: HUMAN REVIEW REQUIRED. The application-local dependency direction is evident, but saved-report compatibility across consumers is not fully established. This outcome is not a claim that a defect was found.
  • Review finding counts: Unavailable. No current review findings or severity counts were supplied.

Walkthrough

Natural-dataset timing is now reported as a measurement rather than an acceptance gate. Capacity-rejected requests are excluded from both timing sides, while other failures can produce partial coverage. Rejudge can refresh benchmark timings from saved execution records without changing recorded accuracy entries.

Changes

Natural-dataset performance

Layer / File(s) Summary
Measure natural-dataset performance
apps/aiperf_qual/trtmc_aiperf_qual/execution.py, apps/aiperf_qual/trtmc_aiperf_qual/runner.py, apps/aiperf_qual/trtmc_aiperf_qual/accuracy_recovery.py, apps/aiperf_qual/tests/test_benchmark_perf.py
Execution records capacity rejections and applies accuracy-derived exclusions to both timing sides. Results include attempted requests and report unavailable, partial, or measured status. Runner and recovery paths pass accuracy results into measurement.
Classify and present timing results
apps/aiperf_qual/trtmc_aiperf_qual/judge.py, apps/aiperf_qual/trtmc_aiperf_qual/report.py, apps/aiperf_qual/trtmc_aiperf_qual/report_html.py, apps/aiperf_qual/tests/test_execution.py, apps/aiperf_qual/README.md
Quality verdicts treat incomplete timing as partial when both sides have timings, and treat missing timing as an error. Reports show coverage, capacity exclusions, and observed work differences. The README describes timing as a measurement, not an acceptance gate.
Refresh measurements from saved records
apps/aiperf_qual/trtmc_aiperf_qual/benchmark_perf.py, apps/aiperf_qual/trtmc_aiperf_qual/cli.py, apps/aiperf_qual/tests/test_benchmark_perf.py, apps/aiperf_qual/README.md
Refresh rebuilds natural-dataset measurements from saved execution records and validates restored capacity-rejection evidence. Rejudge invokes refresh when no selection cache or environment is supplied. Tests cover refresh behavior and error cases.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant rejudge_reports
  participant benchmark_perf_refresh
  participant execution_records
  participant Session
  rejudge_reports->>benchmark_perf_refresh: refresh quality-source report
  benchmark_perf_refresh->>execution_records: load saved JSONL batches
  benchmark_perf_refresh->>Session: derive natural-performance entries
  Session-->>benchmark_perf_refresh: return measurements
  benchmark_perf_refresh-->>rejudge_reports: return updated report
Loading

Merge Risk: ⚪ Minimal · up to 71a78

The timing statuses remain distinguishable, and the reviewed refresh and capacity checks show no established blocker. The change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 8 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 26.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 10 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (8 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: reporting benchmark timings directly.
Description check Passed The description covers the required background, exit criteria, implementation, change categories, validation results, environment, remaining gaps, self-review, future notes, and risk level.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Family Ownership Boundary Passed PASS. The pull request changes only shared apps/aiperf_qual reporting, execution, recovery, judge, and test code. New dependencies in execution.py (changed lines 142, 174, and 188-196) and `benchm…
Shared Semantic Neutrality Passed PASS. The changed production code is model-agnostic qualification, timing, refresh, verdict, and report logic. Session.record stores generic capacity-rejection evidence through the existing `absolut…
Benchmark Validation Integrity Passed No benchmark-integrity failure is introduced. The before/after accounting contract still reads trtmc_timing.model_call_ms from both sides and labels the contract task-call-wall/v1 (`execution.py:2…
Shared Change Blast Radius Passed The check passes. The PR identifies a model-agnostic need: generic benchmark qualification must report timings from the shared quality response stream without using equal work as an acceptance gate. T…
Full details: Docstring Coverage

Explanation

Docstring coverage is 26.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 10 files. (1 skipped: 1 unsupported.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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