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

Accelerate accumulation context for multiple models not supported yet #22

Open
brian6091 opened this issue Dec 28, 2022 · 1 comment
Open

Comments

@brian6091
Copy link
Owner

brian6091 commented Dec 28, 2022

huggingface/accelerate#668

Do this manually?

@brian6091
Copy link
Owner Author

    for step, batch in enumerate(train_dataloader):
        # TODO: how to handle context setting when unet is not training?
        # https://stackoverflow.com/a/14029481
        #train_all = train_unet and train_text_encoder
        #with (accelerator.accumulate(unet), accelerator.accumulate(text_encoder)) if train_all else (accelerator.accumulate(unet) if train_unet else accelerator.accumulate(text_encoder))
        with accelerator.accumulate(unet):

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

1 participant