Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
fairscale
Commits
c3fc3894
Unverified
Commit
c3fc3894
authored
Dec 21, 2021
by
Anupam Bhatnagar
Committed by
GitHub
Dec 21, 2021
Browse files
[Fix] - Finiteness check for all tensors (#890)
* Finiteness check for all tensors * [skip ci] updating changelog
parent
49eacf12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
fairscale/optim/grad_scaler.py
fairscale/optim/grad_scaler.py
+1
-1
No files found.
CHANGELOG.md
View file @
c3fc3894
...
...
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[
Semantic Versioning
](
https://semver.org/spec/v2.0.0.html
)
.
## [0.4.4] - TBD
### Fixed
-
inf/nan check on all gradient tensors in ShardedGradScaler [#890]
### Added
### Changed
...
...
fairscale/optim/grad_scaler.py
View file @
c3fc3894
...
...
@@ -156,7 +156,7 @@ class ShardedGradScaler(TorchGradScaler):
assert
found_inf
.
numel
()
==
1
,
"found_inf must be a 1-element tensor."
expected_device
=
grads
[
0
].
device
for
tensor
in
grads
[
0
]
:
for
tensor
in
grads
:
try
:
assert
tensor
.
device
==
expected_device
,
"grads must be on the same device"
except
AssertionError
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment