[None][fix] Handle None attention_dp_relax in ADP router sort key - #14343
[None][fix] Handle None attention_dp_relax in ADP router sort key#14343Wanli-Jiang wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR refactors attention distribution policy (ADP) router sorting logic to safely handle ChangesADP Router Optional Attention Relax Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 (2)
tensorrt_llm/_torch/pyexecutor/scheduler/adp_router.py (1)
160-163: ⚡ Quick winUpdate stale type wording in the helper comment.
The note says the field is annotated
bool, but this PR updates it toOptional[bool].✏️ Suggested edit
- # treated as relaxed (True). The field is annotated bool but callers + # treated as relaxed (True). The field is annotated Optional[bool], and callers🤖 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 `@tensorrt_llm/_torch/pyexecutor/scheduler/adp_router.py` around lines 160 - 163, Update the helper comment in adp_router.py to reflect that py_scheduling_params.attention_dp_relax is now Optional[bool] (not plain bool) and clarify that both missing py_scheduling_params or attention_dp_relax=None are treated as relaxed (True) to avoid TypeError when calling sorted(); reference the py_scheduling_params and attention_dp_relax symbols and adjust the sentence "The field is annotated bool" to "The field is annotated Optional[bool]" (or equivalent) so the comment matches the code behavior.tests/unittest/_torch/executor/test_adp_router.py (1)
207-219: QA list update is unnecessary for this PR scope.These are unit regression tests under
tests/unittest/..., so notests/integration/test_lists/qa/entry update is required.As per coding guidelines, "If the PR only touches unittest/ or narrow unit scope, say explicitly whether QA list updates are unnecessary or optional."
Also applies to: 960-973
🤖 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/_torch/executor/test_adp_router.py` around lines 207 - 219, This PR only touches unit tests (tests/unittest/_torch/executor/test_adp_router.py) so explicitly state in the PR description that QA list updates are unnecessary for this change; update the PR body to add a short line like "QA list update unnecessary — only unit tests changed" and, if you want local clarity, add a one-line comment above the test_attention_dp_relax_none_is_sortable test noting that QA list updates are not required for unit-scope changes.
🤖 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 `@tensorrt_llm/_torch/pyexecutor/scheduler/adp_router.py`:
- Around line 160-163: Update the helper comment in adp_router.py to reflect
that py_scheduling_params.attention_dp_relax is now Optional[bool] (not plain
bool) and clarify that both missing py_scheduling_params or
attention_dp_relax=None are treated as relaxed (True) to avoid TypeError when
calling sorted(); reference the py_scheduling_params and attention_dp_relax
symbols and adjust the sentence "The field is annotated bool" to "The field is
annotated Optional[bool]" (or equivalent) so the comment matches the code
behavior.
In `@tests/unittest/_torch/executor/test_adp_router.py`:
- Around line 207-219: This PR only touches unit tests
(tests/unittest/_torch/executor/test_adp_router.py) so explicitly state in the
PR description that QA list updates are unnecessary for this change; update the
PR body to add a short line like "QA list update unnecessary — only unit tests
changed" and, if you want local clarity, add a one-line comment above the
test_attention_dp_relax_none_is_sortable test noting that QA list updates are
not required for unit-scope changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: bf4a92b7-f4c1-4b38-9be7-af8b605bd9fc
📒 Files selected for processing (3)
tensorrt_llm/_torch/pyexecutor/scheduler/adp_router.pytensorrt_llm/scheduling_params.pytests/unittest/_torch/executor/test_adp_router.py
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
10bbf48 to
52aab1a
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #49373 [ run ] triggered by Bot. Commit: |
|
I also encountered this issue #14267 |
good, let me close my pr. |
|
same PR from #14267 |
|
PR_Github #49373 [ run ] completed with state
|
Summary by CodeRabbit
Bug Fixes
Tests
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)
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.