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
fecb665b
Unverified
Commit
fecb665b
authored
Sep 21, 2021
by
anj-s
Committed by
GitHub
Sep 21, 2021
Browse files
Update offload_model.rst (#806)
parent
1b9be421
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
docs/source/tutorials/offload_model.rst
docs/source/tutorials/offload_model.rst
+1
-1
No files found.
docs/source/tutorials/offload_model.rst
View file @
fecb665b
...
@@ -75,7 +75,7 @@ of slices that the model should be sharded into. By default activation checkpoin
...
@@ -75,7 +75,7 @@ of slices that the model should be sharded into. By default activation checkpoin
optimizer
.
zero_grad
()
optimizer
.
zero_grad
()
inputs
=
batch_inputs
.
reshape
(-
1
,
num_inputs
*
num_inputs
)
inputs
=
batch_inputs
.
reshape
(-
1
,
num_inputs
*
num_inputs
)
with
torch
.
cuda
.
amp
.
autocast
():
with
torch
.
cuda
.
amp
.
autocast
():
output
=
model
(
inputs
)
output
=
offload_
model
(
inputs
)
loss
=
criterion
(
output
,
target
=
batch_outputs
)
loss
=
criterion
(
output
,
target
=
batch_outputs
)
loss
.
backward
()
loss
.
backward
()
optimizer
.
step
()
optimizer
.
step
()
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