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
tsoc
superbenchmark
Commits
b7d0ee32
Unverified
Commit
b7d0ee32
authored
May 19, 2021
by
Yuting Jiang
Committed by
GitHub
May 19, 2021
Browse files
expose interface of pin memory and modify cnn configuration (#75)
parent
7cfe7c16
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
examples/benchmarks/pytorch_cnn.py
examples/benchmarks/pytorch_cnn.py
+3
-1
superbench/benchmarks/model_benchmarks/model_base.py
superbench/benchmarks/model_benchmarks/model_base.py
+7
-0
superbench/benchmarks/model_benchmarks/pytorch_base.py
superbench/benchmarks/model_benchmarks/pytorch_base.py
+2
-1
tests/benchmarks/model_benchmarks/test_model_base.py
tests/benchmarks/model_benchmarks/test_model_base.py
+2
-0
No files found.
examples/benchmarks/pytorch_cnn.py
View file @
b7d0ee32
...
...
@@ -24,7 +24,9 @@
# Specify the model name and benchmark parameters.
# For example, resnet50, resnet101, resnet152, densenet169, densenet201, vgg11, vgg13, vgg16, vgg19.
model_name
=
'resnet101'
parameters
=
'--batch_size 32 --precision float32 float16 --num_warmup 64 --num_steps 2048 --sample_count 8192'
parameters
=
'--batch_size 192 --precision float32 float16 --num_warmup 64 --num_steps 512
\
--sample_count 8192 --pin_memory'
if
args
.
distributed
:
parameters
+=
' --distributed_impl ddp --distributed_backend nccl'
...
...
superbench/benchmarks/model_benchmarks/model_base.py
View file @
b7d0ee32
...
...
@@ -131,6 +131,13 @@ def add_parser_arguments(self):
help
=
'Disable GPU training.'
,
)
self
.
_parser
.
add_argument
(
'--pin_memory'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Enable option to pin memory in data loader.'
,
)
@
abstractmethod
def
_judge_gpu_availability
(
self
):
"""Judge GPUs' availability according to arguments and running environment."""
...
...
superbench/benchmarks/model_benchmarks/pytorch_base.py
View file @
b7d0ee32
...
...
@@ -115,7 +115,8 @@ def _init_dataloader(self):
shuffle
=
False
,
num_workers
=
8
,
sampler
=
train_sampler
,
drop_last
=
True
drop_last
=
True
,
pin_memory
=
self
.
_args
.
pin_memory
)
return
True
...
...
tests/benchmarks/model_benchmarks/test_model_base.py
View file @
b7d0ee32
...
...
@@ -160,6 +160,7 @@ def test_arguments_related_interfaces():
--distributed_backend DistributedBackend
Distributed backends. E.g. nccl mpi gloo.
--no_gpu Disable GPU training.
--pin_memory Enable option to pin memory in data loader.
--hidden_size int Hidden size.
--seq_len int Sequence length."""
)
...
...
@@ -192,6 +193,7 @@ def test_preprocess():
--distributed_backend DistributedBackend
Distributed backends. E.g. nccl mpi gloo.
--no_gpu Disable GPU training.
--pin_memory Enable option to pin memory in data loader.
--hidden_size int Hidden size.
--seq_len int Sequence length."""
)
...
...
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