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

Use non-persistent buffers #3059

Open
Thylane opened this issue Feb 14, 2023 · 6 comments · May be fixed by #3849
Open

Use non-persistent buffers #3059

Thylane opened this issue Feb 14, 2023 · 6 comments · May be fixed by #3849

Comments

@Thylane
Copy link

Thylane commented Feb 14, 2023

🚀 The feature

Suggest using register_buffer() with persistent=False, so the buffer (e.g. window of spectrogram) will not be included in module's state dict.

Motivation, pitch

When I add new transforms to my model and load a pre-existing checkpoint, a missing key error will be raised, e.g. missing resample kernel in transforms.Resample. It can be solved by specifying strict=False at load time, however, I don't see any reason to save the buffers. They can be recomputed on construction time and that won't affect model's behavior.

Alternatives

No response

Additional context

Same motivation as pytorch/pytorch#18056.

@mthrok
Copy link
Collaborator

mthrok commented Feb 14, 2023

This sounds reasonable to me. @pytorch/team-audio-core any objection?

@mthrok
Copy link
Collaborator

mthrok commented Feb 21, 2023

The team thinks this is a good change, and we look for contributor to make the change. Feel free to open a PR.

@ashikshafi08
Copy link

Hello,

Is anyone working on this? I'm planning to give it a shot and possibly submit a PR.

@mthrok
Copy link
Collaborator

mthrok commented May 2, 2023

HIi @ashikshafi08

Thanks for the interest. No one is working on it, so feel free to do so.

@francislata
Copy link

@mthrok I don’t see recent updates on this issue. I can take a look at this issue if there are no conflicts with others?

@mthrok
Copy link
Collaborator

mthrok commented Nov 7, 2023

@mthrok I don’t see recent updates on this issue. I can take a look at this issue if there are no conflicts with others?

@francislata Thanks for the suggestion. I don't think anyone is working on it, so feel free to send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants