Skip to content

Reduce entropy logging memory when entropy coef is zero#2127

Open
none0663 wants to merge 1 commit into
THUDM:mainfrom
none0663:fix-entropy-oom
Open

Reduce entropy logging memory when entropy coef is zero#2127
none0663 wants to merge 1 commit into
THUDM:mainfrom
none0663:fix-entropy-oom

Conversation

@none0663

Copy link
Copy Markdown
Contributor

Compute entropy under torch.no_grad() when entropy_coef is 0, since entropy is only used for logging in that case. This avoids retaining the entropy autograd graph and reduces memory pressure while preserving gradient behavior when entropy regularization is enabled.

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

Successfully merging this pull request may close these issues.

1 participant