Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
superbenchmark
Commits
65292ae5
Unverified
Commit
65292ae5
authored
Apr 26, 2021
by
guoshzhao
Committed by
GitHub
Apr 26, 2021
Browse files
Benchmarks: Code Revision - Revise the settings of CNN example models. (#65)
* revise example settings of cnn models.
parent
a7184da3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
examples/benchmarks/pytorch_cnn.py
examples/benchmarks/pytorch_cnn.py
+6
-5
No files found.
examples/benchmarks/pytorch_cnn
_resnet101
.py
→
examples/benchmarks/pytorch_cnn.py
View file @
65292ae5
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""Model benchmark example for
resnet101
.
"""Model benchmark example for
CNN models
.
Commands to run:
python3 examples/benchmarks/pytorch_cnn
_resnet101
.py (Single GPU)
python3 -m torch.distributed.launch --use_env --nproc_per_node=8 examples/benchmarks/pytorch_cnn
_resnet101
.py
\
python3 examples/benchmarks/pytorch_cnn.py (Single GPU)
python3 -m torch.distributed.launch --use_env --nproc_per_node=8 examples/benchmarks/pytorch_cnn.py
\
--distributed (Distributed)
"""
...
...
@@ -22,12 +22,13 @@ if __name__ == '__main__':
args
=
parser
.
parse_args
()
# Specify the model name and benchmark parameters.
# For example, resnet50, resnet101, resnet152, densenet169, densenet201, vgg11, vgg13, vgg16, vgg19.
model_name
=
'resnet101'
parameters
=
'--batch_size
1 --image_size 224
--precision float32 --num_warmup
8
--num_steps
64 --run
_count 2'
parameters
=
'--batch_size
32
--precision float32
float16
--num_warmup
64
--num_steps
2048 --sample
_count
819
2'
if
args
.
distributed
:
parameters
+=
' --distributed_impl ddp --distributed_backend nccl'
# Create context for resnet101 benchmark and run it for
64
steps.
# Create context for resnet101 benchmark and run it for
2048
steps.
context
=
BenchmarkRegistry
.
create_benchmark_context
(
model_name
,
platform
=
Platform
.
CUDA
,
parameters
=
parameters
,
framework
=
Framework
.
PYTORCH
)
...
...
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