Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 254cad2

Browse files
Comprehensive imagenet example for the new API
1 parent 484292f commit 254cad2

40 files changed

Lines changed: 776 additions & 189 deletions

apex/amp/frontend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ def check_params_fp32(model):
170170
if param.type() != "torch.cuda.FloatTensor":
171171
print("Warning: Found param {} with type {}, expected torch.cuda.FloatTensor.\n"
172172
"When using amp.initialize, you do not need to call .half() on your model\n"
173-
"before passing it, no matter what optimization level you choose.",
174-
name, param.type())
173+
"before passing it, no matter what optimization level you choose.".format(
174+
name, param.type()))
175175

176176
for name, param in model.named_buffers():
177177
if param.type() != "torch.cuda.FloatTensor":
178178
print("Warning: Found buffer {} with type {}, expected torch.cuda.FloatTensor.\n"
179179
"When using amp.initialize, you do not need to call .half() on your model\n"
180-
"before passing it, no matter what optimization level you choose.",
181-
name, param.type())
180+
"before passing it, no matter what optimization level you choose.".format(
181+
name, param.type()))
182182

183183

184184
# allow user to directly pass Properties struct as well?

examples/FP16_Optimizer_simple/distributed_apex_legacy_launcher/README.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/FP16_Optimizer_simple/distributed_apex_legacy_launcher/distributed_data_parallel.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

examples/FP16_Optimizer_simple/distributed_apex_legacy_launcher/run.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
## Contents:
1+
This directory contains examples illustrating Apex mixed precision and distributed tools.
22

3-
**distributed**: Walkthrough of apex distributed data parallel utilities.
4-
5-
**FP16_Optimizer_simple**: Simple examples demonstrating various use cases of `FP16_Optimizer` to automatically manage master parameters and static or dynamic loss scaling.
6-
7-
**imagenet**: Example based on [https://github.com/pytorch/examples/tree/master/imagenet](https://github.com/pytorch/examples/tree/master/imagenet) showing the use of `FP16_Optimizer`, as well as manual management of master parameters and loss scaling for illustration/comparison.
8-
9-
**word_language_model**: Example based on [https://github.com/pytorch/examples/tree/master/word_language_model](https://github.com/pytorch/examples/tree/master/word_language_model) showing the use of `FP16_Optimizer`, as well as manual management of master parameters and loss scaling for illustration/comparison.
10-
11-
**docker**: Example of a minimal Dockerfile that installs Apex on top of an existing container.
3+
**Note for users of the pre-unification API**:
4+
`deprecated_api` contains examples illustrating the old (pre-unified) APIs. These APIs will be removed soon, and users are strongly encouraged to switch. The separate mixed precision tools called `Amp` and `FP16_Optimizer` in the old API are exposed via different flags/optimization levels in the new API.
File renamed without changes.
File renamed without changes.

examples/FP16_Optimizer_simple/distributed_apex/README.md renamed to examples/deprecated_api/FP16_Optimizer_simple/distributed_apex/README.md

File renamed without changes.

examples/FP16_Optimizer_simple/distributed_apex/distributed_data_parallel.py renamed to examples/deprecated_api/FP16_Optimizer_simple/distributed_apex/distributed_data_parallel.py

File renamed without changes.

examples/FP16_Optimizer_simple/distributed_apex/run.sh renamed to examples/deprecated_api/FP16_Optimizer_simple/distributed_apex/run.sh

File renamed without changes.

0 commit comments

Comments
 (0)