[None][test] fix MPI pool fixture parametrization#15354
Conversation
Signed-off-by: Guiju Zhang <guijuz@nvidia.com>
📝 WalkthroughWalkthroughThe Changesmpi_pool_executor fixture update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unittest/conftest.py (1)
340-345: 💤 Low valueFixture change looks good; consider updating the docstring.
The change from
params=[2, 4, 8]to optionalrequest.paramwith a default of 2 correctly implements the intended behavior. Thegetattr(request, "param", 2)pattern properly handles both indirect parametrization and non-parametrized cases.However, the docstring still says "Start an MPIPoolExecutor with
request.paramworkers" without mentioning the default. Consider updating it for clarity.📝 Suggested docstring update
""" - Start an MPIPoolExecutor with `request.param` workers. + Start an MPIPoolExecutor with the number of workers specified via + indirect parametrization (default: 2 workers). """🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unittest/conftest.py` around lines 340 - 345, Update the docstring for the mpi_pool_executor fixture to reflect the new behavior. The current docstring states "Start an MPIPoolExecutor with `request.param` workers" but does not mention the default value. Modify the docstring to clarify that it starts an MPIPoolExecutor with the number of workers specified by request.param, defaulting to 2 if request.param is not provided (for non-parametrized usage).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unittest/conftest.py`:
- Around line 340-345: Update the docstring for the mpi_pool_executor fixture to
reflect the new behavior. The current docstring states "Start an MPIPoolExecutor
with `request.param` workers" but does not mention the default value. Modify the
docstring to clarify that it starts an MPIPoolExecutor with the number of
workers specified by request.param, defaulting to 2 if request.param is not
provided (for non-parametrized usage).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 996e2669-9b81-4581-852a-8b1b8dcc4d8c
📒 Files selected for processing (1)
tests/unittest/conftest.py
|
/bot run |
|
PR_Github #54151 [ run ] triggered by Bot. Commit: |
|
PR_Github #54151 [ run ] completed with state
|
|
/bot run |
|
PR_Github #54162 [ run ] triggered by Bot. Commit: |
Signed-off-by: Guiju Zhang <guijuz@nvidia.com>
Signed-off-by: Guiju Zhang <guijuz@nvidia.com>
|
/bot run |
Signed-off-by: Guiju Zhang <guijuz@nvidia.com>
|
PR_Github #54169 [ run ] triggered by Bot. Commit: |
|
PR_Github #54162 [ run ] completed with state |
|
/bot run |
|
PR_Github #54170 [ run ] triggered by Bot. Commit: |
|
PR_Github #54169 [ run ] completed with state |
|
PR_Github #54170 [ run ] completed with state
|
Signed-off-by: Guiju Zhang <guijuz@nvidia.com>
|
/bot run |
|
PR_Github #54175 [ run ] triggered by Bot. Commit: |
|
PR_Github #54175 [ run ] completed with state
|
|
/bot run |
|
PR_Github #54190 [ run ] triggered by Bot. Commit: |
Description
Fix the shared
mpi_pool_executorfixture so it no longer parametrizes worker counts at the fixture definition level. Tests that need a specific MPI pool size already pass it with indirect parametrization, and the fixture now defaults to 2 workers when no parameter is provided.Failed tests
GB10-PyTorch-1/test_unittests.py::test_unittests_v2[unittest/_torch/modeling -k "modeling_out_of_tree"]_torch/modeling/test_modeling_pixtral.py::test_tensor_parallelism: duplicate parametrization of 'mpi_pool_executor'Root cause
With newer pytest, collecting a directory that contains tests indirectly parametrizing
mpi_pool_executorfails because the fixture itself also declaresparams=[2, 4, 8]. This can break unrelated-kselections during collection, such as the out-of-tree modeling bridge.Validation
PYTHONPYCACHEPREFIX=/private/tmp/tensorrt-llm-pycache python3 -m py_compile tests/unittest/conftest.pygit diff --check -- tests/unittest/conftest.pyFull pytest was not run locally because this environment does not have the repo test dependencies/GPU setup.
Summary by CodeRabbit
Tests
Chores