fix: update weight initialization method in LinearLoRA class#896
Merged
hemildesai merged 1 commit intomainfrom Nov 27, 2025
Merged
fix: update weight initialization method in LinearLoRA class#896hemildesai merged 1 commit intomainfrom
hemildesai merged 1 commit intomainfrom
Conversation
Signed-off-by: ruit <[email protected]>
Contributor
|
/ok to test 7ae52ac |
hemildesai
approved these changes
Nov 27, 2025
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.
Summary
This PR fixes an incorrect weight initialization method in the
LinearLoRAclass. The xavier initialization was incorrectly usingtorch.nn.init.uniform_()instead of the properxavier_normal_()function.Problem
In the
LinearLoRAclass located innemo_automodel/components/_peft/lora.py, wheninit_method="xavier"is specified, the code was using a generic uniform distribution initialization instead of the Xavier initialization method. This semantic mismatch could lead to suboptimal initialization and potentially affect model convergence and fine-tuning performance.Solution
File:
nemo_automodel/components/_peft/lora.pyChanged the initialization of
lora_Aweights from:To the correct Xavier initialization:
Impact