fix(client): use canonical TRT-LLM transfer catalogs - #511
Conversation
WalkthroughTRT-LLM live weight transfer now canonicalizes aliased parameters, publishes ChangesTRT-LLM Catalog Validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
modelexpress_client/python/modelexpress/trtllm_live_transfer.py (1)
297-300: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winUse canonical parameter names in both catalogs.
publish_model_params()is canonicalized, but these paths still build catalogs from the defaultnamed_parameters(). That lets alias names likenext_attnsurvive into the published or target descriptor set, so the new exact-match check can reject a compatible transfer.
modelexpress_client/python/modelexpress/trtllm_live_transfer.py#L297-L300: build the worker descriptor catalog from_canonical_named_parameters(torch_model)before device filtering.modelexpress_client/python/modelexpress/trtllm_live_transfer.py#L399-L399: buildtarget_paramsfrom_canonical_named_parameters(model)so validation compares canonical catalogs.🤖 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 `@modelexpress_client/python/modelexpress/trtllm_live_transfer.py` around lines 297 - 300, Update the worker descriptor catalog construction near lines 297-300 to use _canonical_named_parameters(torch_model) before device filtering, and update target_params near line 399 to use _canonical_named_parameters(model). Apply both changes in trtllm_live_transfer.py so published and validation catalogs consistently use canonical parameter names.
🤖 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 `@modelexpress_client/python/modelexpress/trtllm_live_transfer.py`:
- Line 399: Update load_weights() so the remainder of its execution, including
_require_exact_catalog_match, is wrapped in a finally-based cleanup path that
removes fh from the modelexpress logger and closes it. Ensure cleanup runs on
both catalog-mismatch exceptions and normal completion, preventing retained file
descriptors and duplicate log output.
---
Outside diff comments:
In `@modelexpress_client/python/modelexpress/trtllm_live_transfer.py`:
- Around line 297-300: Update the worker descriptor catalog construction near
lines 297-300 to use _canonical_named_parameters(torch_model) before device
filtering, and update target_params near line 399 to use
_canonical_named_parameters(model). Apply both changes in
trtllm_live_transfer.py so published and validation catalogs consistently use
canonical parameter names.
🪄 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: 3cb4a2ec-d68f-4bcc-914f-281c0147aa8c
📒 Files selected for processing (2)
modelexpress_client/python/modelexpress/trtllm_live_transfer.pymodelexpress_client/python/tests/test_trtllm_live_transfer.py
|
/ok to test b4148e3 |
Exclude runtime-only alias paths from published tensor catalogs and reject non-exact source/target catalogs before NIXL writes to prevent partial model installation. Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
b4148e3 to
9d3bc31
Compare
|
/ok to test 9d3bc31 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Addressed the remaining CodeRabbit review findings in
Validation: focused tests |
Summary
next_attn/next_layer_layernormaliasesThis fixes partial post-transform installation observed while qualifying NVIDIA/TensorRT-LLM#15641: 64 of 135 Llama tensors were advertised under donor-only alias paths, leaving the receiver partially initialized.
Test plan
PYTHONPATH=modelexpress_client/python python3 -m pytest modelexpress_client/python/tests/test_trtllm_live_transfer.py -q(5 passed)Follow-ups
Summary by CodeRabbit
Bug Fixes
Tests