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
ColossalAI
Commits
14a0b183
Unverified
Commit
14a0b183
authored
Nov 11, 2022
by
Junming Wu
Committed by
GitHub
Nov 11, 2022
Browse files
[NFC] polish colossalai/amp/naive_amp/__init__.py code style (#1905)
parent
c13c22c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
colossalai/amp/naive_amp/__init__.py
colossalai/amp/naive_amp/__init__.py
+5
-2
No files found.
colossalai/amp/naive_amp/__init__.py
View file @
14a0b183
import
inspect
import
torch.nn
as
nn
from
torch.optim
import
Optimizer
from
colossalai.utils
import
is_no_pp_or_last_stage
from
.naive_amp
import
NaiveAMPOptimizer
,
NaiveAMPModel
from
.grad_scaler
import
DynamicGradScaler
,
ConstantGradScaler
from
._fp16_optimizer
import
FP16Optimizer
from
.grad_scaler
import
ConstantGradScaler
,
DynamicGradScaler
from
.naive_amp
import
NaiveAMPModel
,
NaiveAMPOptimizer
def
convert_to_naive_amp
(
model
:
nn
.
Module
,
optimizer
:
Optimizer
,
amp_config
):
...
...
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