Repository navigation
[https://nvbugs/7142489][fix] Isolate MPI workers for the user buffer ledger test - #22838
Conversation
Signed-off-by: ZhaoyangWang <[email protected]>
|
No actionable comments were generated in the recent review. WalkthroughThe native-memory-ledger test now creates an MPI pool with ChangesNative-memory-ledger test
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Suggested reviewers: Merge Risk:
|
|
/bot run |
|
PR_Github #86954 [ run ] triggered by Bot. Commit: |
|
PR_Github #86954 [ run ] completed with state
|
trtllm-agent-review
left a comment
There was a problem hiding this comment.
Thanks for the PR. Gives the user-buffer native-memory-ledger test its own two-worker MPI pool, so the cold-start registration counts it asserts no longer see the userbuffers state that earlier tests leave in the shared module-scoped pool.
Reviewed at commit c61e57f38b (1 file, +10/−8).
The review covers the one changed test file at the PR head. The userbuffers C++ code it exercises was read but is unchanged.
Approve: no Blocker found. 1 suggestion below is nice to have.
Nice to have (1): 1 inline, 0 below
- (R3: Repository rules) The rewritten test signature has no type annotations, which CODING_GUIDELINES.md (Static Typing, rule 4) asks for on every function. (test_user_buffers.py:316)
What this review checked
- A fresh
MPIPoolExecutor(2)spawns new workers. On each rankUserBufferAllocator::initialize(cpp/tensorrt_llm/kernels/userbuffers/ub_allocator.cpp:29-35) then builds the communicator, and the ledger goes from 0 to 1 (its region, userbuffers-host.cpp:320) to 2 (the 8 MiB buffer). These are the deltasrun_single_rank_ledgerasserts; in the shared pool the counts could only stay at(4, 4). - The test still runs pre-merge.
unittest/_torch/multi_gpu -m "not post_merge"(l0_dgx_h100.yml:28) collects it on the DGX_H100 2-GPU stage, thetests/unittest/_torch/multi_gpu/path triggers that stage (jenkins/L0_MergeRequest.groovy:2036), and the node id stays[2]. - pytest now runs the test last in the module, while the module-scoped pool is still alive. That stage already runs concurrent 2-worker pools, so MPI slots are not a concern. If the second multicast mapping fails, userbuffers falls back to unicast and still records the registrations the test counts (userbuffers-host.cpp:261-292, 379).
- Not covered: No GPU run. The code does not settle whether H100 can create a second userbuffers multicast object while the module pool's workers still hold theirs on the same two GPUs. The B200 run in the description had the same state, and this PR's DGX_H100 pre-merge run had not finished.
- Not covered: NVBug 7142489 itself was not read.
Automated review by trtllm-agent-review. If a point is wrong, reply in its thread. Once you have pushed code changes and replied in every Blocker thread, the bot re-checks the Blockers within a few hours.
Signed-off-by: ZhaoyangWang <[email protected]>
|
/bot run |
|
PR_Github #86975 [ run ] triggered by Bot. Commit: |
|
PR_Github #86975 [ run ] completed with state
|
|
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 --disable-fail-fast |
|
PR_Github #87120 [ run ] triggered by Bot. Commit: |
|
PR_Github #87120 [ run ] completed with state |
Dev Engineer Review
mpi_pool_executorfixture. It creates its ownMPIPoolExecutor(tensor_parallel_size)per run, so its MPI workers do not inherit allocator state from earlier tests.run_single_rank_ledgernow receives its arguments throughexecutor.mapwith two positional lists instead ofzip(*...). The call shape is equivalent for the fixed two-rank case.tensor_parallel_sizeparameter now drives the pool size. The existingskipiffor fewer than two GPUs still applies.QA Engineer Review
tests/unittest/_torch/multi_gpu/test_user_buffers.py.test_user_buffers_are_in_the_native_memory_ledger. It now parametrizestensor_parallel_sizedirectly and owns its MPI pool.run_single_rank_ledgerwith an 8 MiB user buffer, and every rank must returnTrue.test-db/,qa/): not available from this diff.Per-File QA Perspective
tests/unittest/_torch/multi_gpu/test_user_buffers.py: Verify that the ledger test passes on two GPUs in a fresh MPI pool. Confirm the test-list entry intest-db/covers it; that listing is not available from this diff.Description
The module-scoped MPI pool lets earlier RMSNorm tests initialize the user buffer allocator on both ranks. Initializing it again reuses the existing communicator, so the ledger count stays at four and the cold-start assertion fails.
Give the ledger test its own two-worker MPI pool. This preserves the count and byte assertions for both communicator initialization and tensor allocation.
Test Coverage
Ran the following sequence on two B200 GPUs:
python3 -m pytest -q tests/unittest/_torch/multi_gpu/test_user_buffers.py -k 'test_user_buffers_are_in_the_native_memory_ledger or (test_user_buffers_ar_rms_norm and not fp)'Before the fix, both RMSNorm cases passed and the ledger test failed with
AssertionError: (4, 4). After the fix, all three passed. The original H100 post-merge stage has not been rerun locally. Local pre-commit passed. The advisory Pyrefly check could not run because Pyrefly was unavailable.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.