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

[Feature] nn.LazyLinear #1484

Open
holdjun opened this issue Feb 2, 2024 · 2 comments
Open

[Feature] nn.LazyLinear #1484

holdjun opened this issue Feb 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@holdjun
Copy link

holdjun commented Feb 2, 2024

What is the feature?

The use of nn.LazyLinear will result in an error in the _dump_init_info function of the BaseModule. The main reason is that _dump_init_info writes the model's weights to the saved info, and if nn.LazyLinear is used, the weights are not initialized before the forward pass, leading to an error.
It is hoped that support for the use of nn.LazyLinear can be provided.

Any other context?

https://pytorch.org/docs/stable/generated/torch.nn.modules.lazy.LazyModuleMixin.html#torch.nn.modules.lazy.LazyModuleMixin
https://pytorch.org/docs/stable/generated/torch.nn.LazyLinear.html#torch.nn.LazyLinear

@zhouzaida zhouzaida added the bug Something isn't working label Feb 4, 2024
@zhouzaida
Copy link
Member

Hi @holdjun , thanks for your feedback. We will fix it ASAP.

@zhouzaida
Copy link
Member

zhouzaida commented Feb 7, 2024

Hi @holdjun , if you use lazy modules, what is your expected behavior (skip or other action) when loading checkpoints?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants