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

Regarding the Reference Attention Issue #211

Open
ShowLo opened this issue Dec 26, 2024 · 2 comments
Open

Regarding the Reference Attention Issue #211

ShowLo opened this issue Dec 26, 2024 · 2 comments

Comments

@ShowLo
Copy link

ShowLo commented Dec 26, 2024

Why comment out the self.bank.clear() inside the if MODE == "read": block in mutual_self_attention.py, and then perform the clear operation within the if accelerator.sync_gradients: block in train_stage1.py?

Won’t this lead to the bank accumulating multiple states in the interim? For instance, when the gradient accumulation steps are set to 3:
During the second forward pass, the bank would use the first hidden state.
During the third forward pass, the bank would use the first two hidden states.

@xumingw
Copy link
Contributor

xumingw commented Dec 30, 2024

We only test on gradient accumulation = 1

@ShowLo
Copy link
Author

ShowLo commented Dec 30, 2024

We only test on gradient accumulation = 1

I have tested it, and when gradient accumulation > 1, it causes errors. It is necessary to perform the clear operation before each iteration begins.

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