Add benchmark configuration and scripts for convnets.#6056
Closed
qingqing01 wants to merge 4 commits intoPaddlePaddle:developfrom
Closed
Add benchmark configuration and scripts for convnets.#6056qingqing01 wants to merge 4 commits intoPaddlePaddle:developfrom
qingqing01 wants to merge 4 commits intoPaddlePaddle:developfrom
Conversation
chengduoZH
reviewed
Nov 30, 2017
| default='NCHW', | ||
| help='The data order: (NCHW, NHWC).') | ||
| parser.add_argument( | ||
| '--device', type=str, default='GPU', help='The data order: (GPU, CPU).') |
| '--order', | ||
| type=str, | ||
| default='NCHW', | ||
| help='The data order: (NCHW, NHWC).') |
Contributor
There was a problem hiding this comment.
Writing this into 'help'? "Only support NCHW order now."
| if args.device == 'CPU': | ||
| place = fluid.CPUPlace() | ||
| else: | ||
| place = fluid.GPUPlace(0) |
Contributor
There was a problem hiding this comment.
place = fluid.CPUPlace() if fluid.CPUPlace() else fluid.GPUPlace(0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #6008
For the convenience of profiling, we need to add benchmark mode and running scripts.
python benchmark_convnet_model.py, some time info will be printed out.The usage is:
optional arguments: -h, --help show this help message and exit --model MODEL The model architecture: (resnet). --batch_size BATCH_SIZE The minibatch size. --iterations ITERATIONS The number of minibatches. --pass_num PASS_NUM The number of minibatches. --order ORDER The data order: (NCHW, NHWC). --device DEVICE The data order: (GPU, CPU). --infer_only If set, run forward only. --use_cprof If set, use cProfile. --use_nvprof If set, use nvprof for CUDA.