Skip to content

Conversation

@pcastonguay
Copy link
Collaborator

@pcastonguay pcastonguay commented Oct 31, 2025

Summary by CodeRabbit

  • Tests
    • Reorganized disaggregated inference testing infrastructure with parameterized test framework for improved coverage and maintainability.
    • Added centralized test utility module for shared testing functions.
    • Removed legacy test configuration files and consolidated test organization.

Description

Test Coverage

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)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • 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

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

Signed-off-by: Patrice Castonguay <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 2025

📝 Walkthrough

Walkthrough

Refactors disaggregated test infrastructure by extracting shared utilities into disagg_test_utils.py, removing 40+ test configuration YAML files, replacing a monolithic test module with a parametrized test harness, and adding a dedicated benchmark test module. Updates test registry to reference parametrized test variants.

Changes

Cohort / File(s) Summary
New shared utilities
tests/integration/defs/disaggregated/disagg_test_utils.py
Introduces four shared functions: cleanup_output_files() for file cleanup, get_disagg_server_url_from_cfg() for YAML config parsing, validate_timing_metrics() for comprehensive timing assertion validation across server layers, and run_client_tests() for orchestrating multi-iteration client test execution with optional Ray workers, streaming/chat variants, and output validation.
Removed test configuration files
tests/integration/defs/disaggregated/test_configs/disagg_config_*.yaml (40+ files)
Deleted entire YAML test configuration library including cache-aware balance, cache reuse, conditional, context/generation parallelism variants, DeepSeek-V3-Lite configurations, TRT/NIXL/UCX/MPI backends, CUDA graph, overlap scheduler, metrics, mixed, n-gram, and load-balancing configs. All static test setup parameters are removed.
Replaced test module
tests/integration/defs/disaggregated/test_disaggregated.py
Removed comprehensive monolithic test module containing individual test functions for 40+ configuration scenarios, shared helper functions (cleanup, validation, YAML parsing, command generation, test orchestration), and fixtures.
New parametrized test module
tests/integration/defs/disaggregated/test_disaggregated_parametrized.py
Added extensive parametrized test harness introducing DisaggregatedTestConfig dataclass for test specification, dynamic YAML config generation, 100+ test configurations in TEST_CONFIGS list covering TinyLlama/DeepSeek variants with multiple backends (PyTorch/TRT/UCX/NIXL/MPI), parallelism patterns (TP/PP combinations), and optional validations. Implements pytest parameterization via pytest_generate_tests(), dynamic skip marking, and centralized test_disagg() entry point.
New benchmark test module
tests/integration/defs/disaggregated/test_disaggregated_benchmark.py
Adds run_disaggregated_benchmark() orchestration function, get_config_for_benchmark() config builder, and test_disaggregated_benchmark_on_diff_backends() parametrized benchmark test comparing NIXL vs. UCX performance (E2EL and TTFT metrics). Includes benchmark result parsing via regex and fixtures for model/data paths.
Updated test registries
tests/integration/test_lists/qa/llm_function_core.txt, llm_function_core_sanity.txt, test-db/l0_*.yml (7 files)
Replaced explicit disaggregated test entries (e.g., test_disaggregated_single_gpu_with_mpirun, test_disaggregated_cuda_graph) with parametrized equivalents (e.g., test_disagg[2_ranks], test_disagg[cuda_graph]) referencing new parametrized modules. Updated benchmark test paths to point to new test_disaggregated_benchmark.py.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Areas requiring extra attention:

  • DisaggregatedTestConfig.generate_yaml_config(): Dynamic YAML config generation merging global/context/generation configs with default values and URL lists; verify template logic, edge cases, and configuration ordering correctness across all 100+ test scenarios.
  • validate_timing_metrics(): Complex nested timing validation with ordering constraints (arrival < first_token < completion across disaggregated, context, and generation layers) and optional KV cache timing; ensure all assertion paths are tested and error messages are clear.
  • run_client_tests() orchestration: Multi-path execution (streaming/chat/long-prompts variants, optional Ray workers, extra endpoint tests); verify process lifecycle management, cleanup on errors, and output matching against expected strings.
  • Test configuration coverage: TEST_CONFIGS list spans 100+ configurations with conditional skips (device count, Hopper, ARM); verify that all skip conditions are correctly applied and no unintended tests are filtered out.
  • Backward compatibility: Verify that parametrized test naming and test IDs match expectations in CI/CD pipelines and don't break existing test result tracking or reporting.

Possibly related PRs

Suggested reviewers

  • Tabrizian
  • Shixiaowei02
  • SimengLiu-nv
  • omera-nv

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is essentially unfilled. The provided text is the template structure with comment placeholders, but all substantive sections are empty: the "Description" section contains only the comment prompt, the "Test Coverage" section contains only the comment prompt, and the PR Checklist shows an unchecked status. No actual explanation of what is being changed, why it is being changed, or what tests safeguard these changes has been provided. This represents a largely incomplete description that does not meet the repository's requirements for PR documentation. Please fill out the PR description with concrete information: explain in the "Description" section what the refactoring accomplishes and why it improves the test structure, list the relevant tests in the "Test Coverage" section that validate these changes (the raw summary indicates parametrized tests have been added), and complete the PR Checklist items as applicable. Reference the summary provided in the raw_summary to help inform your description of the consolidation from discrete test functions into parametrized test cases.
Docstring Coverage ⚠️ Warning Docstring coverage is 79.17% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "Draft: [None][chore] Refactor disagg integration tests" is directly related to the changeset. The raw summary shows removal of multiple disaggregated test configuration files, deletion of the original test_disaggregated.py file, and introduction of new utility modules (disagg_test_utils.py) and refactored test modules (test_disaggregated_parametrized.py, test_disaggregated_benchmark.py). This represents a consolidation of discrete test functions into a parametrized test harness, which aligns perfectly with the title's message of refactoring disaggregated integration tests. The title is concise, specific, and clearly summarizes the primary change without unnecessary noise.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0edba5a and ecea030.

📒 Files selected for processing (53)
  • tests/integration/defs/disaggregated/disagg_test_utils.py (1 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_aware_balance.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_aware_balance_deepseek_v3.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_reuse.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_reuse_deepseek_v3.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_conditional.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_conditional_deepseek_v3.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp2_genpp2.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp2_gentp2.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp4_genpp4.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp4_gentp4.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_one_mtp.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_one_mtp_attention_dp_overlap.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_one_mtp_ctxpp2_gentp2.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_two_mtp.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_genpp2.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp1.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp1_trt_backend.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_one.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_one_mtp.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_overlap.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_overlap_cuda_graph.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_mpi.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_nixl.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_overlap_cuda_graph.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_ucx.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2pp2_gentp2pp2.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cuda_graph_padding.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_diff_max_tokens.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_gen_only.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_gen_only_bs1.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_gen_only_trt_backend.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_load_balance.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_metrics.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_mixed.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ngram.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_overlap.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_trt_backend.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_trtllm_sampler.yaml (0 hunks)
  • tests/integration/defs/disaggregated/test_disaggregated.py (0 hunks)
  • tests/integration/defs/disaggregated/test_disaggregated_benchmark.py (1 hunks)
  • tests/integration/defs/disaggregated/test_disaggregated_parametrized.py (1 hunks)
  • tests/integration/test_lists/qa/llm_function_core.txt (1 hunks)
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt (1 hunks)
  • tests/integration/test_lists/test-db/l0_a10.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml (3 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_b300.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml (2 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_h200.yml (2 hunks)
  • tests/integration/test_lists/test-db/l0_h100.yml (1 hunks)
💤 Files with no reviewable changes (42)
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp4_gentp4.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp1.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_gen_only_trt_backend.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_mixed.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_aware_balance.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_load_balance.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_overlap.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_one_mtp_ctxpp2_gentp2.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_diff_max_tokens.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_metrics.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_reuse_deepseek_v3.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2pp2_gentp2pp2.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_one_mtp.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_one_mtp.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_nixl.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_trtllm_sampler.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_trt_backend.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_one_mtp_attention_dp_overlap.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_overlap_cuda_graph.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp4_genpp4.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_attention_dp_one.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ngram.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_genpp2.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_gen_only_bs1.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_reuse.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_ucx.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cuda_graph_padding.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_overlap.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_gen_only.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_cache_aware_balance_deepseek_v3.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp2_genpp2.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_overlap_cuda_graph.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxpp2_gentp2.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp2_deepseek_v3_lite_mpi.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp1_gentp1_deepseek_v3_lite_two_mtp.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_conditional_deepseek_v3.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_conditional.yaml
  • tests/integration/defs/disaggregated/test_configs/disagg_config_ctxtp2_gentp1_trt_backend.yaml
  • tests/integration/defs/disaggregated/test_disaggregated.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use only spaces, no tabs; indent with 4 spaces.

Files:

  • tests/integration/defs/disaggregated/disagg_test_utils.py
  • tests/integration/defs/disaggregated/test_disaggregated_benchmark.py
  • tests/integration/defs/disaggregated/test_disaggregated_parametrized.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.

Files:

  • tests/integration/defs/disaggregated/disagg_test_utils.py
  • tests/integration/defs/disaggregated/test_disaggregated_benchmark.py
  • tests/integration/defs/disaggregated/test_disaggregated_parametrized.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).

Files:

  • tests/integration/defs/disaggregated/disagg_test_utils.py
  • tests/integration/defs/disaggregated/test_disaggregated_benchmark.py
  • tests/integration/defs/disaggregated/test_disaggregated_parametrized.py
🧠 Learnings (9)
📚 Learning: 2025-09-09T09:40:45.658Z
Learnt from: fredricz-20070104
Repo: NVIDIA/TensorRT-LLM PR: 7645
File: tests/integration/test_lists/qa/llm_function_core.txt:648-648
Timestamp: 2025-09-09T09:40:45.658Z
Learning: In TensorRT-LLM test lists, it's common and intentional for the same test to appear in multiple test list files when they serve different purposes (e.g., llm_function_core.txt for comprehensive core functionality testing and llm_function_core_sanity.txt for quick sanity checks). This duplication allows tests to be run in different testing contexts.

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_dgx_b300.yml
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_h200.yml
  • tests/integration/test_lists/test-db/l0_a10.yml
📚 Learning: 2025-09-17T02:48:52.732Z
Learnt from: tongyuantongyu
Repo: NVIDIA/TensorRT-LLM PR: 7781
File: tests/integration/test_lists/waives.txt:313-313
Timestamp: 2025-09-17T02:48:52.732Z
Learning: In TensorRT-LLM, `tests/integration/test_lists/waives.txt` is specifically for waiving/skipping tests, while other test list files like those in `test-db/` and `qa/` directories are for different test execution contexts (pre-merge, post-merge, QA tests). The same test appearing in both waives.txt and execution list files is intentional - the test is part of test suites but will be skipped due to the waiver.

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_dgx_b300.yml
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_a10.yml
📚 Learning: 2025-08-26T09:49:04.956Z
Learnt from: pengbowang-nv
Repo: NVIDIA/TensorRT-LLM PR: 7192
File: tests/integration/test_lists/test-db/l0_dgx_b200.yml:56-72
Timestamp: 2025-08-26T09:49:04.956Z
Learning: In TensorRT-LLM test configuration files, the test scheduling system handles wildcard matching with special rules that prevent duplicate test execution even when the same tests appear in multiple yaml files with overlapping GPU wildcards (e.g., "*b200*" and "*gb200*").

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_dgx_b300.yml
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_h200.yml
  • tests/integration/defs/disaggregated/test_disaggregated_parametrized.py
  • tests/integration/test_lists/test-db/l0_a10.yml
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
Repo: NVIDIA/TensorRT-LLM PR: 6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_dgx_b300.yml
  • tests/integration/test_lists/qa/llm_function_core_sanity.txt
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml
  • tests/integration/test_lists/qa/llm_function_core.txt
  • tests/integration/defs/disaggregated/test_disaggregated_benchmark.py
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_h200.yml
📚 Learning: 2025-08-14T06:36:40.701Z
Learnt from: timlee0212
Repo: NVIDIA/TensorRT-LLM PR: 6886
File: tensorrt_llm/_torch/models/modeling_deepseekv3.py:0-0
Timestamp: 2025-08-14T06:36:40.701Z
Learning: In DeepSeek V3 model (tensorrt_llm/_torch/models/modeling_deepseekv3.py), the disagreement between AllReduce.__init__ guard and _compute_mlp_tp_size logic for MNNVL usage is expected by design. The AllReduce component and MLP TP-size computation intentionally use different criteria for MNNVL availability decisions.

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
📚 Learning: 2025-08-29T14:07:45.863Z
Learnt from: EmmaQiaoCh
Repo: NVIDIA/TensorRT-LLM PR: 7370
File: tests/unittest/trt/model_api/test_model_quantization.py:24-27
Timestamp: 2025-08-29T14:07:45.863Z
Learning: In TensorRT-LLM's CI infrastructure, pytest skip markers (pytest.mark.skip) are properly honored even when test files have __main__ blocks that call test functions directly. The testing system correctly skips tests without requiring modifications to the __main__ block execution pattern.

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/integration/test_lists/test-db/l0_dgx_h200.yml
📚 Learning: 2025-08-06T13:58:07.506Z
Learnt from: galagam
Repo: NVIDIA/TensorRT-LLM PR: 6487
File: tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py:1-12
Timestamp: 2025-08-06T13:58:07.506Z
Learning: In TensorRT-LLM, test files (files under tests/ directories) do not require NVIDIA copyright headers, unlike production source code files. Test files typically start directly with imports, docstrings, or code.

Applied to files:

  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
📚 Learning: 2025-09-17T06:01:01.836Z
Learnt from: fredricz-20070104
Repo: NVIDIA/TensorRT-LLM PR: 7785
File: tests/integration/defs/perf/utils.py:321-333
Timestamp: 2025-09-17T06:01:01.836Z
Learning: In test infrastructure code for disaggregated serving tests, prefer logging errors and continuing execution rather than raising exceptions on timeout, to avoid disrupting test cleanup and causing cascading failures.

Applied to files:

  • tests/integration/defs/disaggregated/disagg_test_utils.py
📚 Learning: 2025-10-13T19:45:03.518Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: tests/unittest/_torch/multi_gpu/test_nccl_device.py:138-149
Timestamp: 2025-10-13T19:45:03.518Z
Learning: In test_nccl_device.py, the NCCL device AllReduce implementation compares the entire residual tensor on each rank, unlike the UB implementation which compares per-rank chunks. The residual chunking calculations in the test are intentionally overridden to reflect this design difference.

Applied to files:

  • tests/integration/test_lists/qa/llm_function_core.txt
🧬 Code graph analysis (3)
tests/integration/defs/disaggregated/disagg_test_utils.py (3)
tests/integration/defs/trt_test_alternative.py (1)
  • check_call (250-258)
tests/integration/defs/disaggregated/test_disaggregated_parametrized.py (2)
  • validate_timing_metrics (52-152)
  • extra_endpoints_test (1487-1499)
tests/unittest/llmapi/apps/_test_disagg_serving_multi_nodes.py (1)
  • env (61-68)
tests/integration/defs/disaggregated/test_disaggregated_benchmark.py (5)
tests/integration/defs/trt_test_alternative.py (2)
  • check_call (250-258)
  • popen (199-218)
tests/integration/defs/conftest.py (4)
  • llm_root (192-193)
  • disaggregated_test_root (2527-2532)
  • disaggregated_example_root (285-290)
  • llm_venv (702-719)
tests/integration/defs/triton_server/conftest.py (1)
  • models_root (280-284)
tensorrt_llm/logger.py (1)
  • error (126-127)
tests/integration/defs/local_venv.py (1)
  • get_working_directory (43-49)
tests/integration/defs/disaggregated/test_disaggregated_parametrized.py (5)
tests/integration/defs/trt_test_alternative.py (2)
  • check_call (250-258)
  • popen (199-218)
tensorrt_llm/_utils.py (1)
  • mpi_disabled (522-524)
tensorrt_llm/logger.py (1)
  • error (126-127)
tests/integration/defs/conftest.py (3)
  • llm_venv (702-719)
  • disaggregated_test_root (2527-2532)
  • disaggregated_example_root (285-290)
tensorrt_llm/serve/openai_disagg_server.py (1)
  • perf_metrics (247-298)
🪛 Ruff (0.14.2)
tests/integration/defs/disaggregated/disagg_test_utils.py

204-204: Consider [*worker_processes, server_proc] instead of concatenation

Replace with [*worker_processes, server_proc]

(RUF005)


208-210: Consider iterable unpacking instead of concatenation

Replace with iterable unpacking

(RUF005)


215-217: Consider iterable unpacking instead of concatenation

Replace with iterable unpacking

(RUF005)


220-222: Consider iterable unpacking instead of concatenation

Replace with iterable unpacking

(RUF005)

tests/integration/defs/disaggregated/test_disaggregated_benchmark.py

56-56: Avoid specifying long messages outside the exception class

(TRY003)


155-155: Abstract raise to an inner function

(TRY301)


155-155: Avoid specifying long messages outside the exception class

(TRY003)


218-218: Unused function argument: disaggregated_test_root

(ARG001)

tests/integration/defs/disaggregated/test_disaggregated_parametrized.py

203-203: Consider [*worker_processes, server_proc] instead of concatenation

Replace with [*worker_processes, server_proc]

(RUF005)


207-209: Consider iterable unpacking instead of concatenation

Replace with iterable unpacking

(RUF005)


214-216: Consider iterable unpacking instead of concatenation

Replace with iterable unpacking

(RUF005)


219-221: Consider iterable unpacking instead of concatenation

Replace with iterable unpacking

(RUF005)


1305-1305: Unused function argument: suffix

(ARG001)


1427-1427: Starting a process with a partial executable path

(S607)


1444-1444: Unused function argument: request

(ARG001)


1463-1463: Unused function argument: disaggregated_test_root

(ARG001)


1466-1466: Unused function argument: model_root_fixture

(ARG001)


1491-1492: Audit URL open for permitted schemes. Allowing use of file: or custom schemes is often unexpected.

(S310)

Comment on lines +82 to +171
try:
with ( # Start workers
open('output_workers.log', 'w') as output_workers,
popen(workers_cmd,
stdout=output_workers,
stderr=subprocess.STDOUT,
env=run_env,
cwd=cwd) as workers_proc,
# Start server
open('output_disagg.log', 'w') as output_disagg,
popen(server_cmd,
stdout=output_disagg,
stderr=subprocess.STDOUT,
env=run_env,
cwd=cwd) as server_proc):
# Ensure the server has started
client_dir = f"{example_dir}/clients"
client_cmd = [
'python3', f'{client_dir}/disagg_client.py', '-c',
f'{example_dir}/disagg_config.yaml', '-p',
f'{client_dir}/prompts.json', '--ignore-eos',
'--server-start-timeout',
str(server_start_timeout)
]
# Warm up
check_call(client_cmd,
env=env,
poll_procs=[workers_proc, server_proc])
# Start Benchmark
benchmark_script = os.path.join(benchmark_root,
"benchmark_serving.py")
benchmark_cmd = [
'python3',
benchmark_script,
'--model',
benchmark_model_root,
'--tokenizer',
benchmark_model_root,
'--dataset-name',
'random',
'--dataset-path',
shared_gpt_path,
'--random-input-len',
'256',
'--random-output-len',
'64',
'--random-prefix-len',
'0',
'--num-prompts',
'320',
'--max-concurrency',
'32',
'--host',
'localhost',
'--port',
'8000',
'--ignore-eos',
'--no-test-input',
'--percentile-metrics',
'e2el,ttft',
]
# warm up
check_call(benchmark_cmd, env=env)
output = check_output(benchmark_cmd, env=env)
e2el_pattern = r"Median E2EL \(ms\):\s*(\d+\.?\d*)"
ttft_pattern = r"Median TTFT \(ms\):\s*(\d+\.?\d*)"
e2el_match = re.search(e2el_pattern, output)
ttft_match = re.search(ttft_pattern, output)
if e2el_match and ttft_match:
median_e2el = float(e2el_match.group(1))
median_ttft = float(ttft_match.group(1))
return median_e2el, median_ttft
else:
raise ValueError("No benchmark result found")

except Exception:
# Print outputs on error
logger.error("-------- Workers output --------")
with open('output_workers.log', 'r') as f:
logger.error(f.read())

logger.error("-------- Disagg server output --------")
with open('output_disagg.log', 'r') as f:
logger.error(f.read())
raise
finally:
server_proc.terminate()
workers_proc.terminate()
server_proc.wait()
workers_proc.wait()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Guard process cleanup when startup fails.

If either popen(...) call raises before the context assigns workers_proc / server_proc (e.g., mpirun missing, bad config), the finally block triggers an UnboundLocalError, masking the real failure and skipping cleanup. Initialize both variables to None before the try and check for truthiness before calling terminate() / wait() so we only touch handles that really exist.

Apply this diff:

 def run_disaggregated_benchmark(...):
-    try:
+    workers_proc = None
+    server_proc = None
+    try:
         with (
             open('output_workers.log', 'w') as output_workers,
             popen(workers_cmd,
@@
         raise
     finally:
-        server_proc.terminate()
-        workers_proc.terminate()
-        server_proc.wait()
-        workers_proc.wait()
+        if server_proc:
+            server_proc.terminate()
+            server_proc.wait()
+        if workers_proc:
+            workers_proc.terminate()
+            workers_proc.wait()
🧰 Tools
🪛 Ruff (0.14.2)

155-155: Abstract raise to an inner function

(TRY301)


155-155: Avoid specifying long messages outside the exception class

(TRY003)

🤖 Prompt for AI Agents
In tests/integration/defs/disaggregated/test_disaggregated_benchmark.py around
lines 82 to 171, the finally block assumes workers_proc and server_proc were
assigned by the with-context, which can raise UnboundLocalError if popen(...)
fails during startup; initialize workers_proc and server_proc to None before the
try, and in the finally check each variable for truthiness (if not None) before
calling terminate() and wait() so cleanup only touches existing subprocess
handles (optionally wrap terminate/wait in try/except to ignore errors during
shutdown).

Comment on lines +1432 to +1436
if 'server_proc' in locals() and 'workers_proc' in locals():
server_proc.terminate()
workers_proc.terminate()
server_proc.wait()
workers_proc.wait()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Drop the redundant terminate/wait cleanup.

After the with popen(...) blocks exit, the context managers have already torn down the worker and server trees. Calling terminate()/wait() again in the finally block races against already-dead PIDs and raises ProcessLookupError, turning every successful run into a hard failure. Please rely on the context managers (or guard the calls with a poll() is None check) instead of forcibly terminating here.

-            else:
-                if 'server_proc' in locals() and 'workers_proc' in locals():
-                    server_proc.terminate()
-                    workers_proc.terminate()
-                    server_proc.wait()
-                    workers_proc.wait()
+            else:
+                pass  # popen contexts already handle cleanup
🤖 Prompt for AI Agents
In tests/integration/defs/disaggregated/test_disaggregated_parametrized.py
around lines 1432-1436, the finally block calls
server_proc.terminate()/workers_proc.terminate() and wait() even though the
processes were already cleaned up by the with popen(...) context managers; this
races with dead PIDs and causes ProcessLookupError. Remove the redundant
terminate()/wait() calls (preferred) or, if you must keep them, guard each call
with an alive check like if proc.poll() is None: proc.terminate(); proc.wait()
so you only act on running processes.

Comment on lines +767 to +769
- disaggregated/test_disaggregated_parametrized.py::test_disagg[2_ranks_perf_metrics]
- disaggregated/test_disaggregated_parametrized.py::test_disagg[2_ranks_kv_cache_time]
disaggregated/test_disaggregated_parametrized.py::test_disagg[4_ranks]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove the stray leading hyphen in the test entry.

The new list item is prefixed with " - ", so the test runner will literally look for a test named - disaggregated/..., which will never resolve and causes scheduling failures. Please drop the extra hyphen so the path starts directly with disaggregated/….

🤖 Prompt for AI Agents
tests/integration/test_lists/qa/llm_function_core.txt around lines 767 to 769: a
test list entry has a stray leading hyphen causing the test runner to interpret
the literal name "- disaggregated/..." which fails to resolve; remove the extra
leading hyphen and any leading space so the line begins with
"disaggregated/test_disaggregated_parametrized.py::test_disagg[4_ranks]" (no
preceding "-" or extra whitespace), and save the file.

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