Repository navigation
[None][test] Cut the CI time of the layer-wise benchmark tests - #22929
Conversation
|
/bot run |
|
No actionable comments were generated in the recent review. WalkthroughWith autotuning enabled, the layer-wise benchmark runner creates and executes a run pack for each batch-size, query-length, and KV-cache-length combination. Without autotuning, it creates one maximum-size pack. The launch script unsets ChangesLayer-wise benchmarks
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Suggested reviewers: Merge Risk:
|
|
PR_Github #87351 [ run ] triggered by Bot. Commit: |
|
PR_Github #87351 [ run ] completed with state
|
|
/bot run |
|
PR_Github #87443 [ run ] triggered by Bot. Commit: |
f38ed57 to
92d187a
Compare
|
/bot run |
|
PR_Github #87448 [ run ] triggered by Bot. Commit: |
|
PR_Github #87443 [ run ] completed with state |
|
PR_Github #87448 [ run ] completed with state
|
The four single-GPU cases of test_layer_wise_benchmarks.py spent most of their CI time outside the benchmark: - run.sh starts its profiled shell under nsys. BASH_ENV makes that bash source the image's shell init, which forks one process per PCI device to detect GCP; under nsys each one loads the profiler's injection libraries, so the shell took over a minute to start. Start it without BASH_ENV: the environment it inherits already has what the init exports. - run.py autotuned every token-count bucket up to the largest benchmarked shape. Tune the benchmarked shapes only, with the existing skip_dynamic_tuning_buckets mode; they look up the buckets they map to. - l0_b200.yml ran each case as its own entry. Run the four as one entry so they share one inner pytest session and its nsys check. Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com>
92d187a to
ee52bdb
Compare
|
/bot run |
|
PR_Github #87522 [ run ] triggered by Bot. Commit: |
trtllm-agent
left a comment
There was a problem hiding this comment.
Reviewed from the infra side. The grouped B200 entry keeps all four tests and leaves the waived alignment case separate. I found one input-validation issue in the new autotune loop.
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
|
/bot run |
|
PR_Github #87600 [ run ] triggered by Bot. Commit: |
|
PR_Github #87522 [ run ] completed with state |
d633111 to
ee52bdb
Compare
|
/bot run |
|
PR_Github #87602 [ run ] triggered by Bot. Commit: |
|
PR_Github #87600 [ run ] completed with state |
|
PR_Github #87602 [ run ] completed with state
|
|
/bot run |
|
PR_Github #87650 [ run ] triggered by Bot. Commit: |
|
PR_Github #87650 [ run ] completed with state
|
|
/bot run |
|
PR_Github #87671 [ run ] triggered by Bot. Commit: |
|
PR_Github #87671 [ run ] completed with state |
Dev Engineer Review
examples/layer_wise_benchmarks/run.py: With autotune enabled, the script now runscreate_run_packandrun_pack()for every combination of batch size, query length, and KV-cache length. It usesautotune(..., skip_dynamic_tuning_buckets=True). This adds run packs and executions compared with the previous single pack. The non-autotune path creates and runs one pack with the maximum batch size and query length and the first KV-cache length. That behavior is unchanged.examples/layer_wise_benchmarks/run.sh: The inner shell runs asenv -u BASH_ENV bash. The added comment makes startup-time claims. The diff does not verify them. Confirm that the inherited environment provides all variables the image's startup file exported.tests/integration/test_lists/test-db/l0_b200.yml: Four node IDs now share one list item, separated by spaces. The diff does not show how the test-db parser handles this format. Confirm that it splits into four selectors.test_performance_alignment[1]stays separate.QA Engineer Review
tests/integration/test_lists/test-db/l0_b200.yml. The fourunittest/tools/test_layer_wise_benchmarks.pycases now share one entry. Node IDs and waivers are unchanged. No test function changed.Per-File QA Perspective
examples/layer_wise_benchmarks/run.py: Verify the autotune sweep over all shape combinations. Verify that the non-autotune path still runs one pack.examples/layer_wise_benchmarks/run.sh: Verify that the benchmark runs withBASH_ENVunset and that the profiled command still writes its log.tests/integration/test_lists/test-db/l0_b200.yml: Verify that the merged entry runs all four cases in CI.Description
tests/unittest/tools/test_layer_wise_benchmarks.pyruns four single-GPU cases in pre-mergel0_b200, one test-db entry each. On main they take about 762 s of B200 time per pipeline. That figure is the sum of the four entries' CI medians over 2026-11-23 to 11-26:The three GEN medians come from about 200 runs each. Most of this time goes to setup rather than to the benchmark. This PR makes three changes and keeps every case:
BASH_ENV.nsys profile ... bash -o pipefail -c 'python3 run.py ... | tee ...'.BASH_ENV, so this bash first sources the image's shell init.caton the vendor ID of every PCI device. That is 557 processes on a DGX B200.shprocesses do not pay this cost: once the init has exported_CUDA_COMPAT_STATUS, the image's/bin/shruns dash.skip_dynamic_tuning_bucketsmode, which profiles exactly those buckets.TLLM_AUTOTUNER_CACHE_PATHwritten by an E2E run as in the README's alignment flow.test_performance_alignment[1]keeps its own entry, so its waive still matches.The merged entry collects the four node IDs. It has no
agg_unit_mem_df.csvrow, so it runs serially as before.scripts/test_to_stage_mapping.pystill maps each case toDGX_B200-PyTorch-1..9.Test Coverage
tests/unittest/tools/test_layer_wise_benchmarks.py: the four[1]cases, now in onel0_b200.ymlentry.Pre-merge CI: the merged entry passed in two pipelines, in 287.9 s (L0 #72560) and 338.7 s (L0 #72770). The table gives inner pytest times per case. The main column holds main's CI medians over 2026-11-23 to 11-26.
On a B200 node with the CI image, parse.py reports the same kernel sequence for every case as on main, and the per-iteration totals agree within 1.2%.
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.🤖 Generated with Claude Code