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

with_cp=True的使用 #111

Open
Rogersljs opened this issue Jul 23, 2024 · 0 comments
Open

with_cp=True的使用 #111

Rogersljs opened this issue Jul 23, 2024 · 0 comments

Comments

@Rogersljs
Copy link

您好同学!我在使用ith_cp=True, # using checkpoint to save GPU memory发生

RuntimeError: Expected to mark a variable ready only once. This error is caused by one of the following reasons: 1) Use of a module parameter outside the forward function. Please make sure model parameters are not shared across multiple concurrent forward-backward passes. or try to use _set_static_graph() as a workaround if this module graph does not change during training loop.2) Reused parameters in multiple reentrant backward passes. For example, if you use multiple checkpoint functions to wrap the same part of your model, it would result in the same set of parameters been used by different reentrant backward passes multiple times, and hence marking a variable ready multiple times. DDP does not support such use cases in default. You can try to use _set_static_graph() as a workaround if your module graph does not change over iterations. Parameter at index 410 with name img_backbone.layer4.2.conv3.weight has been marked as ready twice. This means that multiple autograd engine hooks have fired for this particular parameter during this iteration. ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 397718) of binary: /home/bailiangliang/anaconda3/envs/surroundocc/bin/python

请问我该如何修改代码?

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