Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for LoRAConfig. #2212

Open
brynhayder opened this issue Nov 12, 2024 · 1 comment
Open

Documentation for LoRAConfig. #2212

brynhayder opened this issue Nov 12, 2024 · 1 comment

Comments

@brynhayder
Copy link

brynhayder commented Nov 12, 2024

initialization scaled by the LoRA rank for linear and layers. Setting the initialization to False leads to
completely random initialization and is discouraged. Pass `'loftq'` to use LoftQ initialization. Pass

Documentation for False is not clear. Presumably 'completely random' means the arrays will be uninitialized and hence contain whatever the contents of the relevant memory locations are?

@BenjaminBossan
Copy link
Member

To explain further: The default implementation initializes the LoRA A parameter randomly and the LoRA B parameter to zeros. This results in LoRA being an identity transform at initialization, which can help with training. When setting init_lora_weights=False, the LoRA B weight is instead also randomly initialized, resulting in a non-identity transform.

For real LoRA training, you almost never want that, which is why we discourage it. However, the weights are not initialized as random memory as in torch.empty, which seems to be what you suspected.

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

No branches or pull requests

2 participants