Skip to content

Conversation

amitz-nv
Copy link
Collaborator

@amitz-nv amitz-nv commented Sep 30, 2025

Description

  • Fix head_size handling in ModelConfig.get_bindings_model_config when the head_size or head_dim are set to None in pretrained_config.
  • Unskip and do some minor configuration fixes in tests/unittest/llmapi/test_llm_pytorch.py::test_bielik_11b_v2_2_instruct_multi_lora that failed because of the bad head_size handling.

Test Coverage

  • tests/unittest/llmapi/test_llm_pytorch.py::test_bielik_11b_v2_2_instruct_multi_lora

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

  • New Features
    • Simplified LoRA setup: LoraConfig no longer requires a directory path; specify target modules directly.
    • Added a parameter to control CUDA graph usage when initializing LLM (can be disabled as needed).
  • Refactor
    • Streamlined internal handling of attention head size with no expected user-visible impact.
  • Tests
    • Re-enabled a previously skipped multi-LoRA test and updated tests to use the new LoRA configuration and CUDA graph parameter.

…ip and do minor configuration fixes in test_bielik_11b_v2_2_instruct_multi_lora that failed because of the bad head_size handling

Signed-off-by: Ubuntu <ubuntu@viking-dvt-151.nvidia.com>
@amitz-nv amitz-nv self-assigned this Sep 30, 2025
@amitz-nv amitz-nv requested a review from a team as a code owner September 30, 2025 12:33
@amitz-nv
Copy link
Collaborator Author

/bot run

@amitz-nv amitz-nv requested review from qixiang-99 and removed request for yilin-void and leslie-fang25 September 30, 2025 12:35
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

📝 Walkthrough

Walkthrough

Refactors head_size fallback selection in get_bindings_model_config and updates tests to reflect API changes for LoRA configuration and CUDA graph usage, including unskipping a specific LoRA test.

Changes

Cohort / File(s) Summary
Model config fallback refactor
tensorrt_llm/_torch/model_config.py
Replaces for-else fallback with explicit None-check for head_size after iterating head_dim candidates; sets default head_size to hidden_size // num_heads with same warning behavior.
Tests and API usage updates
tests/unittest/llmapi/test_llm_pytorch.py
Unskips bielik_11b_v2_2_instruct_multi_lora test. Updates LoRA usage: instantiate LoraConfig with lora_target_modules only (no lora_dir). Passes cuda_graph_config=None to LLM for LoRA runs. Reflects public API signature changes in tests.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller as get_bindings_model_config
  participant Cfg as ModelConfig
  participant Heads as HeadDimCandidates

  Caller->>Heads: Iterate head_dim_name candidates
  alt Found matching head_dim
    Heads-->>Caller: head_size value
    Note over Caller: Use discovered head_size
  else No match
    Note over Caller: head_size is None
    Caller->>Cfg: Compute hidden_size // num_heads
    Cfg-->>Caller: default head_size
    Note over Caller: Emit warning and apply default
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title precisely describes the core change by identifying the NVBugs ID, the fix type, and the specific functionality altered (“head_size handling in ModelConfig.get_bindings_model_config”), making it clear, concise, and directly aligned with the primary change in the pull request.
Description Check ✅ Passed The pull request description follows the repository’s template by including clear “## Description”, “## Test Coverage”, and “## PR Checklist” sections; it concisely explains the problem and solution for the head_size handling, identifies the specific test covering the change, and lists the required review and verification steps.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20378 [ run ] triggered by Bot

@amitz-nv amitz-nv removed the request for review from qixiang-99 September 30, 2025 12:49
@tensorrt-cicd
Copy link
Collaborator

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

@amitz-nv
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20379 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

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.

2 participants