[None][fix] Make SleepConfig picklable by replacing closure lambda in defaultdict#13918
Conversation
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
📝 WalkthroughWalkthroughThis PR introduces pickling support for ChangesSleepConfig Pickling Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
…managed deployment Append a new section to §06 distinguishing two failover models: - Shadow failover (existing): pre-warmed standby, sub-5s activation, requires §07 compile cache + new executor state machine. - Restart-after-death (new section): no standby, external supervisor restarts trtllm-serve, replacement zero-copy materializes from surviving GMS daemon via PR NVIDIA#13926's RO branch. Works on main today (no new TRT-LLM code). Document the supporting gaps: - TRT-LLM has no built-in worker restart machinery; restart-after-death requires an external supervisor (systemd / K8s / Dynamo). - GMS daemon must be a node-level service, not a worker subprocess. - Daemon commit-survival on writer disconnect is the load-bearing upstream assumption (GMS-7 open question). - Sleep/wake (NVIDIA#13918 + NVIDIA#14052) doesn't compose with GMS weights — three implementation tiers documented; Tier-A validator recommended for NVIDIA#13926. Add a self-managed deployment recipe: systemd unit for the GMS daemon, trtllm-serve unit with --gms-mode=auto for the worker, verification steps, and caveats (single-rank only, daemon lifetime discipline, no auto sleep/wake for weights, compile-cache cold-restart cost pre-§07). README TOC entry updated to point at the new section. Signed-off-by: Chien-Chun Hung <chienchunh@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #48023 [ run ] triggered by Bot. Commit: |
3a2498d to
76b368f
Compare
|
PR_Github #48023 [ run ] completed with state
|
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #48214 [ run ] triggered by Bot. Commit: |
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
|
PR_Github #48214 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #48410 [ run ] triggered by Bot. Commit: |
|
PR_Github #48410 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #48606 [ run ] triggered by Bot. Commit: |
|
PR_Github #48606 [ run ] completed with state |
Summary by CodeRabbit
Bug Fixes
SleepConfigserialization to properly support pickle-based object persistence and restoration.Tests
SleepConfigcan be successfully pickled and unpickled while maintaining configuration integrity, including default values and custom overrides.Description
SleepConfig._make_defaulted_restore_modes()returns adefaultdictwhosedefault_factoryis a closure lambda (lambda: default_mode). Becausedefaultdictstoresdefault_factoryas an instance attribute, it is serialised whenllm_argsis pickled during MPI worker initialisation (mpi_session.py distributes configuration to each rank via pickle). A closure lambda has no module-level name and raisesAttributeErrorat pickle time, making any SleepConfig-enabled multi-rank deployment fail before the engine starts.Fix: introduce
_SleepConfigDefaultFactory, a private @DataClass that holds the concrete RestoreMode value and returns it via__call__. It is a drop-in replacement for the lambda and is fully picklable. No behaviour change —_validate_restore_modescallsv.default_factory()and continues to work correctly.Test Coverage
test_SleepConfig_is_picklable: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
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.