fix(perf): align BERT reference timing scope - #1163
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 SummarySummaryThe BERT embedding reference now measures the declared end-to-end pipeline operation. Each invocation includes tokenizer input preparation and device input preparation. Model loading, tokenizer loading, and warmup remain outside reported latency. The reference reports timing as The PR adds CPU-safe regression coverage for timing metadata and invocation boundaries. The tests use fake Torch and Transformers boundaries to verify that session creation performs no pipeline work and that invocation performs tokenization before model inference. Validation reports 148 passing tests, successful Ruff checks, and matching reference and candidate pipeline timing on GB300. Architecture impact
Status: HUMAN REVIEW REQUIRED WalkthroughThe embedding reference now prepares tokenizer inputs according to the timing contract and propagates contract settings to the session. Tests cover BERT and Eagle VLM timing scopes, call order, metadata, and embedding output. ChangesEmbedding timing
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Embedding reference timing now follows declared input-preparation boundaries while keeping asset loading and warmup outside measurement. Coverage validates the affected BERT and Eagle VLM behaviors, with no current merge-blocking risk identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 7 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (7 passed)
Full details: Benchmark Validation IntegrityExplanation The PR enables the BERT comparison, but the two timed paths still measure different work. The candidate path calls Resolution Make the reference and candidate use the same returned-output boundary. For the current candidate contract, materialize the reference embedding on the host inside the timed Comment |
Measure BERT embedding input preparation inside the timed reference operation so it matches the declared end-to-end pipeline contract. Add regression coverage for the timing metadata and invocation boundary. Signed-off-by: chaofengw <chaofengw@nvidia.com>
ead6801 to
6ca45e7
Compare
Background
The BERT embedding task reference prepared tokenizer inputs before its timed
operation while the release suite declared end-to-end pipeline timing. The
runtime timing guard therefore rejected
bert.embedbefore collecting a validbaseline or candidate comparison.
The same
hf-transformers-embeddingadapter is also used by Eagle VLM, whosedeclared boundary intentionally excludes input preparation. The fix must
preserve both family contracts.
Exit Criteria
preparation and matches the declared pipeline contract.
boundary.
boundaries.
Implementation
model family inside the shared embedding adapter.
input preparation; otherwise prepare them once outside the timed invocation.
There are no public API, ABI, artifact format, dependency, compatibility,
migration, or rollout changes.
Change categories
Validation
Commands and Results
env PYTHONPATH=/tmp/trtmc-bert-perf-timing/python python3 -m pytest -q tests/tools/test_perf_matrix.py tests/e2e/models/bert/test_bert_embedding_runner.py: 149 passed.python3 -m ruff check benchmarks/performance/baselines/task_reference.py tests/tools/test_perf_matrix.py: passed.git diff --check: passed.all-minilm-l6-v2: containerenvironment ready, native build succeeded, and
check,hf_preflight,preview, andformalall passed without retries or recoveries. The singlebert.embedcase was green.Hardware, Environment, and Revisions
6ca45e757bdda1302902b4677e61c9a95d540fba.sha256:2ec7d8b70819c36d290225d5c56a4b3d6c9ff250d0f4115c32b674a14fe84fd6.sentence-transformers/all-MiniLM-L6-v2, resolved revision1110a243fdf4706b3f48f1d95db1a4f5529b4d41.Reference recorded
task-pipeline-call-wallwith input preparation included;candidate recorded
public_pipeline_call_wallwith input preparationincluded. Both sample sets were stable. P50 latency was 3.4004 ms reference
and 0.3420 ms candidate.
Not Run / Remaining Gaps
behavior is preserved and covered by the focused CPU regression test.
limited to the shared reference timing boundary and the GB300 BERT case
exercises the corrected path.
Notes For Future Readers
thresholds, model selection, or comparison criteria.
worker from the exact repository head above.
parameterized regression test.
Risk level
The change is isolated to reference timing for one shared adapter, derives its
behavior from the existing contract source, and is covered for both consumers.