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
apex
Commits
9ce80178
Commit
9ce80178
authored
Jun 24, 2019
by
Michael Carilli
Browse files
Merge branch 'master' of
https://github.com/NVIDIA/apex
parents
f8557569
f17cd953
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
README.md
README.md
+2
-2
docs/source/advanced.rst
docs/source/advanced.rst
+5
-0
No files found.
README.md
View file @
9ce80178
...
@@ -80,12 +80,12 @@ CUDA and C++ extensions via
...
@@ -80,12 +80,12 @@ CUDA and C++ extensions via
```
```
$ git clone https://github.com/NVIDIA/apex
$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .
$ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" .
/
```
```
Apex also supports a Python-only build (required with Pytorch 0.4) via
Apex also supports a Python-only build (required with Pytorch 0.4) via
```
```
$ pip install -v --no-cache-dir .
$ pip install -v --no-cache-dir .
/
```
```
A Python-only build omits:
A Python-only build omits:
-
Fused kernels required to use
`apex.optimizers.FusedAdam`
.
-
Fused kernels required to use
`apex.optimizers.FusedAdam`
.
...
...
docs/source/advanced.rst
View file @
9ce80178
...
@@ -145,6 +145,11 @@ Gradient accumulation across iterations
...
@@ -145,6 +145,11 @@ Gradient accumulation across iterations
The
following
should
"just work,"
and
properly
accommodate
multiple
models
/
optimizers
/
losses
,
as
well
as
The
following
should
"just work,"
and
properly
accommodate
multiple
models
/
optimizers
/
losses
,
as
well
as
gradient
clipping
via
the
`
instructions
above
`
_
::
gradient
clipping
via
the
`
instructions
above
`
_
::
#
If
your
intent
is
to
simulate
a
larger
batch
size
using
gradient
accumulation
,
#
you
can
divide
the
loss
by
the
number
of
accumulation
iterations
(
so
that
gradients
#
will
be
averaged
over
that
many
iterations
):
loss
=
loss
/
iters_to_accumulate
if
iter
%
iters_to_accumulate
==
0
:
if
iter
%
iters_to_accumulate
==
0
:
#
Every
iters_to_accumulate
iterations
,
unscale
and
step
#
Every
iters_to_accumulate
iterations
,
unscale
and
step
with
amp
.
scale_loss
(
loss
,
optimizer
)
as
scaled_loss
:
with
amp
.
scale_loss
(
loss
,
optimizer
)
as
scaled_loss
:
...
...
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