KEMBAR78
[TRTLLM-6741][fix] Add heuristics for lm head tp size when `enable_lm_head_tp_in_adp=True` by Njuapp · Pull Request #7891 · NVIDIA/TensorRT-LLM · GitHub
Skip to content

Conversation

@Njuapp
Copy link
Collaborator

@Njuapp Njuapp commented Sep 22, 2025

Add heuristics for lm head tp size, and changed llm flags of enable_lm_head_tp_in_adp to prototype

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.

Summary by CodeRabbit

  • Documentation
    • Updated configuration option labels: enable_lm_head_tp_in_adp is now marked “Prototype” (was “Beta”); cp_config now explicitly marked “Prototype.” Improves clarity on feature maturity in help text and docs.
  • Chores
    • Standardized public metadata for configuration fields to ensure consistent status display across CLI/help outputs and tooling.

@Njuapp Njuapp requested a review from a team as a code owner September 22, 2025 02:50
@Njuapp Njuapp requested a review from syuoni September 22, 2025 02:50
@Njuapp Njuapp changed the title Change llm_arg flags of enable_lm_head_tp_in_adp to prototype [None][fix]Change llm_arg flags of enable_lm_head_tp_in_adp to prototype Sep 22, 2025
@Njuapp Njuapp changed the title [None][fix]Change llm_arg flags of enable_lm_head_tp_in_adp to prototype [TRTLLM-6741][fix]Change llm_arg flags of enable_lm_head_tp_in_adp to prototype Sep 22, 2025
@Njuapp Njuapp changed the title [TRTLLM-6741][fix]Change llm_arg flags of enable_lm_head_tp_in_adp to prototype [TRTLLM-6741][fix] Change llm_arg flags of enable_lm_head_tp_in_adp to prototype Sep 22, 2025
@Njuapp Njuapp requested review from kaiyux and removed request for syuoni September 22, 2025 03:02
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 22, 2025

📝 Walkthrough

Walkthrough

Updated metadata in BaseLlmArgs within tensorrt_llm/llmapi/llm_args.py: changed enable_lm_head_tp_in_adp field status from "beta" to "prototype" and added "prototype" status to the cp_config field.

Changes

Cohort / File(s) Summary of Changes
Args metadata updates
tensorrt_llm/llmapi/llm_args.py
Updated public field metadata: enable_lm_head_tp_in_adp status "beta" → "prototype"; added status "prototype" to cp_config. No method additions or signature changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The PR title claims to "Add heuristics for lm head tp size when enable_lm_head_tp_in_adp=True", but the provided raw_summary shows only metadata updates in tensorrt_llm/llmapi/llm_args.py (changing the status of enable_lm_head_tp_in_adp and cp_config to "prototype") and the PR objectives/description include no heuristic implementation or tests, so the title misrepresents the actual changes. Either update the title to accurately describe the change (for example, "Mark enable_lm_head_tp_in_adp and cp_config as prototype in BaseLlmArgs") and adjust the PR description accordingly, or add the missing heuristic implementation and tests so the current title is accurate.
Description Check ⚠️ Warning The PR includes the repository template and a one-line summary but lacks a template-compliant title and leaves the Description and Test Coverage sections effectively empty, providing no implementation details or list of changed files (raw summary shows only metadata updates in tensorrt_llm/llmapi/llm_args.py). The short note about heuristics and the flag status change is too terse to satisfy the template's required fields and does not explain rationale, scope, or testing. Therefore the PR description does not meet the repository's template requirements. Please update the PR with a title that follows the repository template (e.g., [TRTLLM-1234][type] Summary), expand the Description to explain what changed and why and include a list of modified files and code-level notes, and populate the Test Coverage section with relevant automated tests or manual validation steps. Also complete the PR Checklist items, add links to related issues or design docs if any, and note any necessary documentation or CODEOWNERS updates so reviewers can properly assess the change.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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: 0

🧹 Nitpick comments (1)
tensorrt_llm/llmapi/llm_args.py (1)

1283-1286: Mark cp_config as prototype — fix Optional vs {} semantics.

Status addition is fine. The Field is annotated Optional[dict] but uses default_factory=dict (runtime default {}); repo call sites mostly treat cp_config as a dict (many .get / 'in' uses). mapping(...) still accepts None and checks cp_config is None (tensorrt_llm/mapping.py:135) but mapping.init normalizes None -> {} (tensorrt_llm/mapping.py:218). Change tensorrt_llm/llmapi/llm_args.py (Field at ~1283) to a non-optional dict (e.g. dict[str, Any]) to match runtime behavior — or make the Field default None and audit callers if you need distinct None semantics.

📜 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 9dc7316 and f8c04fa.

📒 Files selected for processing (1)
  • tensorrt_llm/llmapi/llm_args.py (1 hunks)
🧰 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:

  • tensorrt_llm/llmapi/llm_args.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:

  • tensorrt_llm/llmapi/llm_args.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:

  • tensorrt_llm/llmapi/llm_args.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: venkywonka
PR: NVIDIA/TensorRT-LLM#6029
File: .github/pull_request_template.md:45-53
Timestamp: 2025-08-27T17:50:13.264Z
Learning: For PR templates in TensorRT-LLM, avoid suggesting changes that would increase developer overhead, such as converting plain bullets to mandatory checkboxes. The team prefers guidance-style bullets that don't require explicit interaction to reduce friction in the PR creation process.
🔇 Additional comments (1)
tensorrt_llm/llmapi/llm_args.py (1)

1278-1282: Approve — enable_lm_head_tp_in_adp downgraded to prototype; docs/tests synced.
Status is "prototype" in tensorrt_llm/llmapi/llm_args.py and in tests/unittest/api_stability/references/llm.yaml; no remaining "beta" mentions for this knob found.

@Njuapp Njuapp requested review from a team as code owners September 23, 2025 03:26
@Njuapp Njuapp requested review from brb-nv, hlu1 and nv-yilinf September 23, 2025 03:26
@Njuapp Njuapp changed the title [TRTLLM-6741][fix] Change llm_arg flags of enable_lm_head_tp_in_adp to prototype [TRTLLM-6741][fix] Add heuristics for lm head tp size when enable_lm_head_tp_in_adp=True Sep 23, 2025
@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 26, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20097 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20097 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #15143 completed with status: 'FAILURE'

Signed-off-by: Cheng Hang <chang@nvidia.com>
@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 27, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20134 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20134 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15177 completed with status: 'FAILURE'

@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 27, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20145 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20217 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20206 [ run ] completed with state ABORTED
LLM/main/L0_MergeRequest_PR #15239 (Blue Ocean) completed with status: ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20218 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20217 [ run ] completed with state ABORTED
LLM/main/L0_MergeRequest_PR #15249 (Blue Ocean) completed with status: ABORTED

Co-authored-by: Yanchao Lu <yanchaol@nvidia.com>
Signed-off-by: Cheng Hang <chang@nvidia.com>
@tensorrt-cicd
Copy link
Collaborator

PR_Github #20218 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15250 completed with status: 'FAILURE'

@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 29, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20228 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20228 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #15256 completed with status: 'FAILURE'

@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 29, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20238 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20238 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #15260 completed with status: 'FAILURE'

@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 29, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20245 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20245 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #15266 completed with status: 'FAILURE'

Signed-off-by: Cheng Hang <chang@nvidia.com>
@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 29, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20255 [ run ] triggered by Bot

@kaiyux kaiyux dismissed their stale review September 29, 2025 09:26

Updating reviewer group.

@kaiyux kaiyux enabled auto-merge (squash) September 29, 2025 09:32
@tensorrt-cicd
Copy link
Collaborator

PR_Github #20255 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15272 completed with status: 'FAILURE'

Signed-off-by: Cheng Hang <chang@nvidia.com>
auto-merge was automatically disabled September 29, 2025 15:03

Head branch was pushed to by a user without write access

@Njuapp
Copy link
Collaborator Author

Njuapp commented Sep 29, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20278 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20278 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15290 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@kaiyux kaiyux merged commit cdce68c into NVIDIA:main Sep 30, 2025
5 checks passed
faradawn pushed a commit to faradawn/TensorRT-LLM that referenced this pull request Oct 2, 2025
…_head_tp_in_adp=True` (NVIDIA#7891)

Signed-off-by: Cheng Hang <chang@nvidia.com>
Co-authored-by: Yanchao Lu <yanchaol@nvidia.com>
Signed-off-by: Faradawn Yang <faradawny@gmail.com>
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.

8 participants