Skip to content

feat(benchmark): add family-local qualification - #1204

Draft
chaofengw-nv wants to merge 12 commits into
NVIDIA:mainfrom
chaofengw-nv:feat/family-local-accuracy
Draft

feat(benchmark): add family-local qualification#1204
chaofengw-nv wants to merge 12 commits into
NVIDIA:mainfrom
chaofengw-nv:feat/family-local-accuracy

Conversation

@chaofengw-nv

@chaofengw-nv chaofengw-nv commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Background

PR #1093 isolated model families but removed the centralized Accuracy path. This draft restores family-local Accuracy and Performance qualification, including HF conversion comparisons, without a central model registry or device policy in model configuration.

Exit Criteria

  • Discover explicit family Accuracy/Performance files; support exact model selection and multiple suites/cases without enrolling L0-only manifests.
  • Reuse common Python by default and allow family-owned environment preparation without modifying the common environment.
  • Compare GPT-2 conversion with HF and measure TensorRT against an actual compiled HF reference with matching outputs and stable timings.
  • Preserve preparation and report evidence, including failure paths, while keeping model-specific behavior inside the family.

Implementation

  • Add trtmc-qualify plan/prepare/run/resume/report, reusable suite definitions, family executors, and JSON/HTML reports. All preparation precedes measurement.
  • Discover optional family prepare_environment.py scripts and propagate selected build/reference interpreters. GPT-2 can provision a private CUDA reference without changing the common build environment.
  • Resolve an immutable HF checkpoint and build a fresh run-owned bundle. Accuracy preparation validates and saves selected dataset samples; execution/resume use this saved selection.
  • Keep GPT-2 reference execution, continuation-parity gates, and ten-sample stability evaluation family-local. Match generated tokens and GPU identity, verify compiled graphs, and reject compilation during timed iterations. Retry one unstable pair; preserve inconclusive status and both attempts.
  • Own executor/preparation process groups. Timeout and SIGINT/SIGTERM terminate descendants before subsequent work is launched.
  • Use generated run-local IDs, repository revision evidence, interpreter/package receipts, and local file-state checks. Do not hash source, dependencies, weights, or bundles.
  • Keep optional device-run speed targets separate from family observation verdicts. Package the qualification catalog and scripts. Extend the architecture guard to reject reverse family Python imports from the benchmark application.

Change categories

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

Validation

Commands and Results

On 230f9d11410183d26c71cd135956980d48899728:

  • PYTHONPATH=core/builder:apps/benchmark:. python3 -m pytest -q apps/benchmark/trtmc_benchmark/tests/test_qualification.py apps/benchmark/trtmc_benchmark/tests/test_qualification_process.py families/gpt2/tests/qualification/test_executor.py families/gpt2/tests/qualification/test_measurement_stability.py families/gpt2/tests/test_e2e.py tools/tests/test_new_ci.py apps/benchmark/trtmc_benchmark/tests/test_perf_matrix.py: 129 passed, 3 GPU-dependent tests skipped.
  • CI_BASE_REF=aefbd09639f2bf036130719554a0df1f80580f94 PYTHONPATH=core/builder:apps/benchmark:. python3 -m tools.community_ci source-quality --base aefbd09639f2bf036130719554a0df1f80580f94: passed, including 125 tests, architecture/family validation, lint, and complexity checks.
  • git diff --check aefbd09639f2bf036130719554a0df1f80580f94...HEAD: passed.
  • Regression tests exercise real executor/environment descendants and SIGINT/SIGTERM cancellation, frozen Accuracy samples, modified prepared files, isolated Python environments, and the real family entry point through the scheduler/report boundary for inconclusive results. GPU acquisition/build is stubbed in the sample-preparation test.

Hardware, Environment, and Revisions

  • Current revision: 230f9d11410183d26c71cd135956980d48899728; clean source checkout, Linux x86_64, Python 3.12.3. This revision's recorded checks are CPU/source checks, not GPU or premerge qualification.
  • Earlier target-hardware evidence at ce7a13336309a6ae02bb58f544deda7937af3f50: GPT-2 continuation parity passed and compiled-HF Performance produced a valid stable comparison. That evidence does not validate this new revision.
  • The earlier comparison used GPT-2 checkpoint 607a30d783dfa663caf39e06633721c8d4cfcd7e, FP32, Torch 2.14.0+cu130, Transformers 5.2.0, and the retained MMLU five-shot continuation dataset. Continuation parity is not an MMLU answer score.

Not Run / Remaining Gaps

  • GPU Accuracy/Performance has not been rerun after these review fixes. The three GPU-dependent pytest cases were skipped because the local check lacks the required runtime/checkpoint setup.
  • Full wheel build/install qualification and protected exact-head premerge remain unverified. No current-head GPU or protected premerge pass is claimed.
  • Remaining historical benchmarks and device-specific CI scheduling are not implemented by this draft.

Notes For Future Readers

  • Start with apps/benchmark/qualification/README.md, then the process/environment boundary, GPT-2 executor, and packaging. No Design document is included.
  • Existing draft runs without input-file state receipts and saved Accuracy samples require fresh preparation; there is no legacy receipt conversion.
  • Execution uses POSIX process groups; family workers must not detach into separate sessions. File-state checks detect ordinary local modifications/replacements, not hostile tampering. Runs must stay in their original trusted storage.
  • Family-only dependencies, reference behavior, and acceptance criteria remain family-owned. Reports are artifacts, not GitHub Pages content.
  • Review findings on the preceding head were addressed without relaxing Accuracy or Performance criteria. Keep the PR draft pending fresh GPU evidence and subsequent review.

Risk level

  • Low
  • Medium
  • High

This adds process lifecycle management, environment provisioning, and resumable artifact handling to a shared application. CPU regressions cover the reported failure modes, but package and current-head GPU/protected qualification are still outstanding.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

Restore Accuracy and Performance orchestration after the family isolation cutover without introducing a central model registry. Discover optional model-owned configurations, resolve shared benchmark definitions by a plain name, execute each case through a family process boundary, and emit resumable JSON and HTML reports.

Add GPT-2 MMLU continuation parity as the first migrated Accuracy workload. Keep model reference and gate settings in the family, device assignment in high-level run configuration, and package the qualification CLI, shared definitions, and family executors.

Refs: NVIDIA#1093
Signed-off-by: chaofengw <chaofengw@nvidia.com>
@chaofengw-nv
chaofengw-nv force-pushed the feat/family-local-accuracy branch from e2b05e3 to 2969ba8 Compare September 8, 2026 08:44
Keep the configured reference interpreter path when launching Accuracy references. Resolving a virtual-environment symlink selected the system interpreter and hid its Torch and Transformers dependencies.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Build the GPT-2 125M test bundle for its full 1024-token position capacity so the retained MMLU five-shot workload can run 960 prompt tokens plus 64 generated tokens. Cover the relationship between family-owned Accuracy settings and the model manifest.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Discover a GPT-2 generation performance case beside its Accuracy configuration and execute it through the family-owned process boundary. Report raw latency samples, reduced latency and throughput metrics, measurement policy, runtime environment, and benchmark artifacts without embedding a device-specific pass threshold in the model.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Require Accuracy reports to identify the converted TensorRT bundle used against the Hugging Face reference. Run GPT-2 Performance against the existing Hugging Face torch.compile baseline, reject output mismatches, and report both measurements plus their p50 ratio.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Default to a common Python environment and discover optional family-owned preparation. Preserve interpreter selection through build and reference subprocesses, freeze prepared inputs, and validate receipts before resume.

Keep the GPT-2 compiled reference family-local, restore paired measurement stability checks, and report device-run targets separately from model validation. Document the historical benchmark migration scope.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Keep the qualification usage guide in the PR without the design document or its README link.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Own executor and preparation process groups so timeout and cancellation stop descendants. Freeze Accuracy samples before building, keep GPT-2 stability family-local, and preserve inconclusive results across the process boundary.

Replace source and artifact content hashes with run-local IDs, explicit revision evidence, and local file-state checks. Add lifecycle, snapshot, reporting, and reverse-dependency regression coverage without changing model acceptance criteria.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Restore ETTh1 conversion parity and add compiled PyTorch-versus-TensorRT performance coverage. Resolve the family-pinned build and reference environment locally so Transformers 4.57.6 does not alter the shared Python environment.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
A nested venv does not inherit packages from a parent venv even with system-site-packages, which leaves CUDA PyTorch unavailable. Add the common purelib as the base layer while keeping family-installed packages first, and expose the verification failure when preparation remains incompatible.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Chronos patch padding exposes symbolic modulo and division expressions that PyTorch Inductor cannot split for the 12-value Performance input when dynamic shapes are enabled. Compile the fixed benchmark workload with static shape specialization and require the report evidence to record that choice.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
Chronos-Bolt's compiled PyTorch reference can fail compilation, output parity, or stability even when the eager official model remains a valid baseline. Prefer torch.compile, retain its failure evidence, and select eager timing only after it passes the same workload, device, parity, and stability checks. Error only when neither mode produces a valid comparison.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
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