Repository navigation
[None][fix] Guard model_engine access in PyExecutor._handle_responses - #19559
Conversation
Minimal PyExecutor instances built by unit tests do not set model_engine, so the unguarded self.model_engine lookup in _handle_responses raises AttributeError. Guard it with the same getattr pattern already used at the other route_capture call sites. Signed-off-by: Brian Nguyen <[email protected]>
|
/bot run |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/TensorRT-LLM/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review. Walkthrough
ChangesResponse handling
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The response handler now tolerates minimal executors while preserving route capture when available. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
PR_Github #75103 [ run ] triggered by Bot. Commit: |
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
|
PR_Github #75103 [ run ] completed with state
|
|
/bot run |
|
PR_Github #75146 [ run ] triggered by Bot. Commit: |
|
/bot skip --comment "Urgent: unblocks L0 pre-merge breakage on main (two disagg-coordinator unit tests fail in CPU-Generic for every PR). Prior pipeline validated this commit: single-GPU run passed 190/190 including both affected tests; the only failure was an infra-level multi-GPU stage loss (SLURM job failure / offline nodes) with no product-code failures. The 4-line guard change is not exercised differently by multi-GPU stages." |
|
PR_Github #75153 [ skip ] triggered by Bot. Commit: |
|
PR_Github #75146 [ run ] completed with state |
|
PR_Github #75153 [ skip ] completed with state |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Bowen Fu <[email protected]>
Dev Engineer Review
_handle_responsesnow safely accessesmodel_engine.route_capturewith nestedgetattr. This preventsAttributeErrorfor minimalPyExecutorinstances while preserving route attachment when available. The file also contains broad import-formatting changes with no stated behavior change.QA Engineer Review
No test changes.
Per-File QA Perspective
tensorrt_llm/_torch/pyexecutor/py_executor.py: Verify response handling with and withoutmodel_engine, including completed requests with route capture enabled. Confirm route attachment remains unchanged for normal executors.Description
Commit 5982425 (#18397, Router Replay) added a
route_capture = getattr(self.model_engine, ...)lookup inPyExecutor._handle_responses. Unlike the otherroute_capturecall sites in the same commit, this one does not guard themodel_engineattribute itself. #19478 later merged unit tests that construct a minimalPyExecutor(viaobject.__new__) without amodel_engineattribute, so main now deterministically fails these two unit tests:unittest/_torch/disaggregation/test_disagg_coordinator_errors.py::test_refused_python_cancel_is_retried_and_settled_through_the_real_response_pathunittest/_torch/disaggregation/test_disagg_coordinator_errors.py::test_cancelling_part_of_a_saturated_receive_batch_settles_only_those_requestswith:
The fix mirrors the guarded pattern the same commit already uses elsewhere in this file:
getattr(getattr(self, "model_engine", None), "route_capture", None).Test Coverage
The two unit tests above (already in
l0CPU coverage) exercise this exact code path and fail on current main without this change.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.