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

the grad calculation takes up a lot of memory #14

Open
PanXiebit opened this issue May 10, 2024 · 1 comment
Open

the grad calculation takes up a lot of memory #14

PanXiebit opened this issue May 10, 2024 · 1 comment

Comments

@PanXiebit
Copy link

grad, = autograd.grad(

grad, = autograd.grad(
        outputs=(fake_img * noise).sum(), inputs=latents, create_graph=True
    )

The calculation of gradients is memory inefficient and lacks support for flast-attention. Consequently, when training with the reg_loss, it becomes necessary to reduce the batch_size.

@Pakase
Copy link

Pakase commented Aug 9, 2024

Hi, I wander how much the extra memory cost may be? Could you give me a rough number?

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