Repository navigation
Add support for handling aliased parameters - #21
Closed
suyoggupta wants to merge 4 commits into
Closed
suyoggupta wants to merge 4 commits into
suyoggupta wants to merge 4 commits into
Conversation
Signed-off-by: Suyog Gupta <[email protected]>
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for handling aliased parameters during model export by introducing a new load hook to ensure that all aliases receive the same parameter value when loading state dictionaries. It also removes an extra blank line in an existing function and integrates the new hook into the export pipeline.
- Introduced the function add_load_hook_for_aliased_params to manage aliased parameters.
- Updated torch_export_to_gm to invoke the new load hook.
- Minor formatting cleanup in the deduplication helper.
1 task
Fridah-nv
approved these changes
May 21, 2025
|
I think this commit is breaking |
Signed-off-by: Suyog Gupta <[email protected]>
Signed-off-by: Suyog Gupta <[email protected]>
Signed-off-by: Suyog Gupta <[email protected]>
Author
|
all tests in |
Merged
lucaslie
added a commit
that referenced
this pull request
May 22, 2025
Includes #17 , #18, #21 , #23 * move Phi PR for sprint Signed-off-by: Ubuntu <[email protected]> * remove Phi3 patch and unfuse_weight transformation Signed-off-by: Ubuntu <[email protected]> * update Phi3/4 patches Signed-off-by: Ubuntu <[email protected]> * minor Signed-off-by: Ubuntu <[email protected]> * minor Signed-off-by: Ubuntu <[email protected]> * Update the position id to int64 Signed-off-by: Chenghao Zhang <[email protected]> * Add support for handling aliased parameters Signed-off-by: Suyog Gupta <[email protected]> * update tests Signed-off-by: Suyog Gupta <[email protected]> * lint Signed-off-by: Suyog Gupta <[email protected]> * lint Signed-off-by: Suyog Gupta <[email protected]> * removed load state dict with assign context manager Signed-off-by: Suguna Velury <[email protected]> * formatting fix Signed-off-by: Suguna Velury <[email protected]> * Removed related unit tests Signed-off-by: Suguna Velury <[email protected]> * [AutoDeploy] correctly identifying how to load HF checkpoint weights Signed-off-by: Lucas Liebenwein <[email protected]> * [AutoDeploy] correctly load sharded weights Signed-off-by: Lucas Liebenwein <[email protected]> * skip sharding if num_users>1 Signed-off-by: Suyog Gupta <[email protected]> --------- Signed-off-by: Ubuntu <[email protected]> Signed-off-by: Chenghao Zhang <[email protected]> Signed-off-by: Suyog Gupta <[email protected]> Signed-off-by: Suguna Velury <[email protected]> Signed-off-by: Lucas Liebenwein <[email protected]> Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Chenghao Zhang <[email protected]> Co-authored-by: Suguna Velury <[email protected]> Co-authored-by: Lucas Liebenwein <[email protected]>
|
merged in #25 |
lucaslie
added a commit
that referenced
this pull request
May 27, 2025
Includes #17 , #18, #21 , #23 * move Phi PR for sprint Signed-off-by: Ubuntu <[email protected]> * remove Phi3 patch and unfuse_weight transformation Signed-off-by: Ubuntu <[email protected]> * update Phi3/4 patches Signed-off-by: Ubuntu <[email protected]> * minor Signed-off-by: Ubuntu <[email protected]> * minor Signed-off-by: Ubuntu <[email protected]> * Update the position id to int64 Signed-off-by: Chenghao Zhang <[email protected]> * Add support for handling aliased parameters Signed-off-by: Suyog Gupta <[email protected]> * update tests Signed-off-by: Suyog Gupta <[email protected]> * lint Signed-off-by: Suyog Gupta <[email protected]> * lint Signed-off-by: Suyog Gupta <[email protected]> * removed load state dict with assign context manager Signed-off-by: Suguna Velury <[email protected]> * formatting fix Signed-off-by: Suguna Velury <[email protected]> * Removed related unit tests Signed-off-by: Suguna Velury <[email protected]> * [AutoDeploy] correctly identifying how to load HF checkpoint weights Signed-off-by: Lucas Liebenwein <[email protected]> * [AutoDeploy] correctly load sharded weights Signed-off-by: Lucas Liebenwein <[email protected]> * skip sharding if num_users>1 Signed-off-by: Suyog Gupta <[email protected]> --------- Signed-off-by: Ubuntu <[email protected]> Signed-off-by: Chenghao Zhang <[email protected]> Signed-off-by: Suyog Gupta <[email protected]> Signed-off-by: Suguna Velury <[email protected]> Signed-off-by: Lucas Liebenwein <[email protected]> Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Chenghao Zhang <[email protected]> Co-authored-by: Suguna Velury <[email protected]> Co-authored-by: Lucas Liebenwein <[email protected]> Signed-off-by: Lucas Liebenwein <[email protected]>
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.
This PR adds support for handling aliased parameters during model export by introducing a new load hook to ensure that all aliases receive the same parameter value when loading state dictionaries.
Introduced the function add_load_hook_for_aliased_params to manage aliased parameters.
Updated torch_export_to_gm to invoke the new load hook.