[None][refactor] Organize SMG gRPC adapter by protocol - #17179
Conversation
Signed-off-by: junq <22017000+QiJune@users.noreply.github.com>
|
/bot run |
WalkthroughChangesSMG gRPC integration
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ServeCommand
participant launch_smg_server
participant RequestManager
participant SMGServicer
participant grpcServer
participant LLMEngine
ServeCommand->>launch_smg_server: Pass server configuration
launch_smg_server->>LLMEngine: Construct selected backend
launch_smg_server->>RequestManager: Create request manager
launch_smg_server->>SMGServicer: Register servicer
launch_smg_server->>grpcServer: Bind and start server
grpcServer-->>launch_smg_server: Signal shutdown
launch_smg_server->>grpcServer: Stop gracefully
launch_smg_server->>LLMEngine: Shut down engine
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tensorrt_llm/grpc/smg/server.py (1)
117-120: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDead
except KeyboardInterruptbranch.
loop.add_signal_handler(signal.SIGINT, signal_handler)at Line 115 replaces the defaultSIGINThandling for this event loop. Once registered,SIGINTno longer raisesKeyboardInterruptinside the coroutine; it invokessignal_handler, which setsstop_event. Theexcept KeyboardInterruptat Line 119 therefore does not trigger during normal operation after Line 115 runs.🤖 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/grpc/smg/server.py` around lines 117 - 120, Remove the unreachable KeyboardInterrupt handler around stop_event.wait in the server startup flow. Keep loop.add_signal_handler(signal.SIGINT, signal_handler) and the existing stop_event-based shutdown behavior unchanged.
🤖 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.
Inline comments:
In `@tensorrt_llm/grpc/smg/server.py`:
- Around line 62-129: Widen the cleanup scope in the server lifecycle so the
existing shutdown logic covering llm.shutdown() also handles failures from
server.add_insecure_port(), server.start(), and subsequent startup or serving
operations after LLM construction. Ensure cleanup runs exactly once for any
post-construction exception while preserving the current graceful server.stop()
behavior.
---
Nitpick comments:
In `@tensorrt_llm/grpc/smg/server.py`:
- Around line 117-120: Remove the unreachable KeyboardInterrupt handler around
stop_event.wait in the server startup flow. Keep
loop.add_signal_handler(signal.SIGINT, signal_handler) and the existing
stop_event-based shutdown behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 822a751f-5f58-42a0-9edd-1f2f2d73f128
📒 Files selected for processing (8)
tensorrt_llm/commands/serve.pytensorrt_llm/grpc/__init__.pytensorrt_llm/grpc/smg/__init__.pytensorrt_llm/grpc/smg/bindings.pytensorrt_llm/grpc/smg/request_manager.pytensorrt_llm/grpc/smg/server.pytensorrt_llm/grpc/smg/servicer.pytests/unittest/grpc/smg/test_smg.py
|
PR_Github #63353 [ run ] triggered by Bot. Commit: |
|
Reviewed the move itself: Three things worth settling before merge:
The |
|
PR_Github #63353 [ run ] completed with state
|
|
/bot run |
|
PR_Github #63365 [ run ] triggered by Bot. Commit: |
|
PR_Github #63365 [ run ] completed with state
|
|
On the two red runs — neither looks like your refactor. Build 51350 (#63365) ran 27211 passing tests, 0 test-level failures; the only FAILED entries are That is also why I wouldn't read the earlier build 51341 as signal either — it only got 81 tests in before dying. Nothing new from me on the diff itself; my earlier notes stand (the |
Dev Engineer Review
tensorrt_llm.grpc.smg.serve.pynow delegates gRPC startup tolaunch_smg_server.QA Engineer Review
tests/unittest/grpc/smg/test_smg.py.test-db/orqa/coverage entry was identified.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.