Fix loading of aliased weights - #85
Merged
Merged
Conversation
suyoggupta
commented
Jul 14, 2025
- Adds a test for small Qwen model that has aliased lm_head.weight and embed.weight
- Removes a conservative assert that required aliased weights to be present in the ckpt. In cases when ckpt is loaded in parts, this assert would misfire.
There was a problem hiding this comment.
Pull Request Overview
This PR updates test configurations to include the Qwen2.5-3B-Instruct model and relaxes loading aliases when checkpoint parts are missing.
- Added a new small-model entry for Qwen/Qwen2.5-3B-Instruct in two test files
- Removed a strict
assertinaliasing_load_pre_hookto allow missing aliased weights without failure
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_build_small_single.py | Added a get_small_model_config entry for Qwen2.5-3B-Instruct |
| tests/unittest/_torch/auto_deploy/_utils_test/_model_test_utils.py | Registered Qwen2.5-3B-Instruct in the small-model lookup table |
| tensorrt_llm/_torch/auto_deploy/transformations/export.py | Removed assert on missing alias load and wrapped aliasing in an if |
Comments suppressed due to low confidence (1)
suyoggupta
enabled auto-merge (squash)
July 14, 2025 19:16
lucaslie
pushed a commit
that referenced
this pull request
Jul 18, 2025
* remove assert, add qwen small to tests * lint Signed-off-by: Suyog Gupta <suyogg@nvidia.com> --------- Signed-off-by: Suyog Gupta <suyogg@nvidia.com>
lucaslie
pushed a commit
that referenced
this pull request
Jul 21, 2025
* remove assert, add qwen small to tests * lint Signed-off-by: Suyog Gupta <suyogg@nvidia.com> --------- Signed-off-by: Suyog Gupta <suyogg@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.