Skip to content

Refactor _batch_cal_norm and remove #pyre-ignore #3200

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

Closed
wants to merge 2 commits into from

Conversation

wz337
Copy link
Contributor

@wz337 wz337 commented Jul 16, 2025

Summary: As title. Remove repeated total_grad_norm calculation and fix #pyre errors.

Differential Revision: D78398248

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 16, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78398248

wz337 added 2 commits July 21, 2025 17:26
… L2 norm (pytorch#3220)

Summary: Pull Request resolved: pytorch#3220

Differential Revision: D78706038
Summary:

As title. 
1. Parse `norm_type` by `self._norm_type = float(norm_type)` at  GradientClippingOptimizer `__init__()` immediately and only use `self._norm_type` later on so it's not susceptible to the error in D78326114. 
2. Remove repeated `total_grad_norm` calculation
3. Fix #pyre errors.

Reviewed By: aliafzal

Differential Revision: D78398248
@wz337 wz337 force-pushed the export-D78398248 branch from cd8e0aa to 837ff80 Compare July 22, 2025 00:26
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78398248

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by a32caed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants