2016-05-13 21:43:48 +00:00
|
|
|
import unittest
|
|
|
|
|
from caffe2.python import convnet_benchmarks as cb
|
2016-07-21 17:16:42 +00:00
|
|
|
from caffe2.python import test_util, workspace
|
2016-05-13 21:43:48 +00:00
|
|
|
|
|
|
|
|
|
2019-02-21 05:05:59 +00:00
|
|
|
# TODO: investigate why this randomly core dump in ROCM CI
|
|
|
|
|
@unittest.skipIf(not workspace.has_cuda_support, "no cuda gpu")
|
2016-05-13 21:43:48 +00:00
|
|
|
class TestConvnetBenchmarks(test_util.TestCase):
|
|
|
|
|
def testConvnetBenchmarks(self):
|
|
|
|
|
all_args = [
|
|
|
|
|
'--batch_size 16 --order NCHW --iterations 1 '
|
|
|
|
|
'--warmup_iterations 1',
|
|
|
|
|
'--batch_size 16 --order NCHW --iterations 1 '
|
|
|
|
|
'--warmup_iterations 1 --forward_only',
|
|
|
|
|
]
|
|
|
|
|
for model in [cb.AlexNet, cb.OverFeat, cb.VGGA, cb.Inception]:
|
|
|
|
|
for arg_str in all_args:
|
|
|
|
|
args = cb.GetArgumentParser().parse_args(arg_str.split(' '))
|
|
|
|
|
cb.Benchmark(model, args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
unittest.main()
|