Operator-level performance microbenchmarks (#18740)
authorMingzhe Li <mingzhe0908@fb.com>
Wed, 3 Apr 2019 00:03:23 +0000 (17:03 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Apr 2019 00:06:19 +0000 (17:06 -0700)
commit5f5a2aaab9d0b847df09e0a7f367e603ef6bcb2a
treee0c8f2dc6c4e829b241d47e3bf31064981ba4052
parentb832b99afb241a8b6ea9fc34698d1f3bfd451f00
Operator-level performance microbenchmarks (#18740)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18740

Test utilities for writing Caffe2/PyTorch performance microbenchmarks. Brief description of the file structure

* benchmark_core.py : core utiltiites for running microbenchmark tests
* benchmark_caffe2.py : Caffe2 specific benchmark utilitites
* benchmark_pytorch.py: PyTorch specific benchmark utilities
* benchmark_runner.py : Main function. Currently it can run the microbenchmark tests in a stand-alone mode. The next step is to have this integrate with AI-PEP.

The utilities are located at https://github.com/pytorch/pytorch/tree/master/test to have access to both Caffe2/PyTorch Python's frontend.

Include two operator microbenchmarks; support both Caffe2/PyTorch:
* MatMul
* Add

Reference: PyTorch benchmarks : https://github.com/pytorch/benchmark/tree/master/timing/python. In this work, we start with two example binary operators MatMul and Add, but eventually we should to cover unary operators like in the PyTorch benchmark repo.

Reviewed By: zheng-xq

Differential Revision: D13887111

fbshipit-source-id: b7a56b95448c9ec3e674b0de0ffb96af4439bfce
benchmarks/operator_benchmark/__init__.py [new file with mode: 0644]
benchmarks/operator_benchmark/benchmark_caffe2.py [new file with mode: 0644]
benchmarks/operator_benchmark/benchmark_core.py [new file with mode: 0644]
benchmarks/operator_benchmark/benchmark_pytorch.py [new file with mode: 0644]
benchmarks/operator_benchmark/benchmark_runner.py [new file with mode: 0644]
benchmarks/operator_benchmark/benchmark_utils.py [new file with mode: 0644]
benchmarks/operator_benchmark/ops/__init__.py [new file with mode: 0644]
benchmarks/operator_benchmark/ops/add.py [new file with mode: 0644]
benchmarks/operator_benchmark/ops/matmul.py [new file with mode: 0644]
caffe2/python/pybind_state.cc
caffe2/python/workspace.py