Skip to content

[TRTLLM-13077][feat] Deocmpose post_load_weights()#14770

Draft
chienchunhung wants to merge 1 commit into
NVIDIA:mainfrom
chienchunhung:staged-post-load-hooks-prep-clean
Draft

[TRTLLM-13077][feat] Deocmpose post_load_weights()#14770
chienchunhung wants to merge 1 commit into
NVIDIA:mainfrom
chienchunhung:staged-post-load-hooks-prep-clean

Conversation

@chienchunhung
Copy link
Copy Markdown
Collaborator

@chienchunhung chienchunhung commented May 30, 2026

@coderabbitai summary

Summary

Add the prep layer for staged post-load hooks without migrating existing model implementations yet.

  • Add default setup_aliases(), transform_weights(), and cache_derived_state() hooks on DecoderModelForCausalLM, with post_load_weights() preserving the current full sequence.
  • Add duck-typed ModelLoader helpers for top-level alias setup, transform walks, cache-state walks, full post-load walks, and _weights_transformed reset.
  • Keep reload() behavior unchanged; reload remains weight-copy-only and does not run post-load hooks.
  • Add focused mock tests for staged-hook helper behavior.

Test Plan

  • python3 -m pytest tests/unittest/_torch/pyexecutor/test_model_loader_mx.py -q

Note: local run was blocked in this environment by missing built tensorrt_llm.bindings; should be run in the normal TRT-LLM build/test environment.

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-compatible or api-breaking. For api-breaking, include BREAKING in 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.

Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
@chienchunhung
Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #51131 [ run ] triggered by Bot. Commit: d93df17 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #51131 [ run ] completed with state SUCCESS. Commit: d93df17
/LLM/main/L0_MergeRequest_PR pipeline #40568 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants