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

Fix musigen app memory issue #298

Merged
merged 3 commits into from
Nov 23, 2023
Merged

Conversation

Harushii18
Copy link
Contributor

@Harushii18 Harushii18 commented Oct 5, 2023

Fixes 2 issues:

  • There was a memory issue where models stayed in memory when models were changed. To replicate the issue: when the model was changed from melody to the medium model, the melody model would remain in memory whilst the medium model was also loaded into memory, consuming large amounts of RAM.

  • Once someone clicked the submit button, the old temp files were not removed and stayed on disk (until lifetime was reached). Added another function in the filecleaner to remove these files since they cannot be accessed from the UI anyway once someone regenerates their samples.

Fixed memory issue of models staying in memory when model is changed
@facebook-github-bot
Copy link

Hi @Harushii18!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@Harushii18 Harushii18 changed the title Update musicgen_app.py Fix musigen app memory issue Oct 5, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 5, 2023
@adefossez
Copy link
Contributor

I dont think you can call this delete_all in the context of the public demo so we will not accept this PR as is. We can accept the deletion of the previous model prior to loading the new one though.

I'm not sure why the delete_all would help compared with the previous mechanism that delete the files after some time ?

@Harushii18
Copy link
Contributor Author

I dont think you can call this delete_all in the context of the public demo so we will not accept this PR as is. We can accept the deletion of the previous model prior to loading the new one though.

I'm not sure why the delete_all would help compared with the previous mechanism that delete the files after some time ?

Thank you for responding! I added that as once someone clicks the submit button again, the temp files can't be accessed from the UI: only unless someone navigates to that directory manually. So just seemed better to remove it.
However you are right, as it does seem like that part would conflict on the public demo since it might remove other peoples' temp files that they are still accessing.

Will remove those parts.

@felixkreuk felixkreuk merged commit 95f2747 into facebookresearch:main Nov 23, 2023
3 checks passed
@felixkreuk
Copy link
Contributor

LGTM! Thanks for contributing @Harushii18!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants