convnet_benchmarks_test.py 839 B

1234567891011121314151617181920212223
  1. import unittest
  2. from caffe2.python import convnet_benchmarks as cb
  3. from caffe2.python import test_util, workspace
  4. # TODO: investigate why this randomly core dump in ROCM CI
  5. @unittest.skipIf(not workspace.has_cuda_support, "no cuda gpu")
  6. class TestConvnetBenchmarks(test_util.TestCase):
  7. def testConvnetBenchmarks(self):
  8. all_args = [
  9. '--batch_size 16 --order NCHW --iterations 1 '
  10. '--warmup_iterations 1',
  11. '--batch_size 16 --order NCHW --iterations 1 '
  12. '--warmup_iterations 1 --forward_only',
  13. ]
  14. for model in [cb.AlexNet, cb.OverFeat, cb.VGGA, cb.Inception]:
  15. for arg_str in all_args:
  16. args = cb.GetArgumentParser().parse_args(arg_str.split(' '))
  17. cb.Benchmark(model, args)
  18. if __name__ == '__main__':
  19. unittest.main()