Unverified Commit b7d0ee32 authored by Yuting Jiang's avatar Yuting Jiang Committed by GitHub
Browse files

expose interface of pin memory and modify cnn configuration (#75)

parent 7cfe7c16
......@@ -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'
......
......@@ -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."""
......
......@@ -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
......
......@@ -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."""
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment