Add a section about running the benchmarks with python. Also renamed so that https://www.tensorflow.org/community/benchmarks and https://www.tensorflow.org/performance/benchmarks have different titles
PiperOrigin-RevId: 181203841
This commit is contained in:
parent
1a1fb0b556
commit
314d400ad8
@ -1,4 +1,4 @@
|
||||
# Benchmarks
|
||||
# Defining and Running Benchmarks
|
||||
|
||||
This guide contains instructions for defining and running a TensorFlow benchmark. These benchmarks store output in [TestResults](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/util/test_log.proto) format. If these benchmarks are added to TensorFlow github repo, then we will run them daily with our continuous build and display a graph on our dashboard: https://benchmarks-dot-tensorflow-testing.appspot.com/.
|
||||
|
||||
@ -52,6 +52,19 @@ Key points to note in the example above:
|
||||
* Benchmark method calls `report_benchmark` to report the metric value.
|
||||
|
||||
|
||||
## Running with Python
|
||||
|
||||
Use the `--benchmarks` flag to run the benchmark with python. A [BenchmarkEntries](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/util/test_log.proto) proto will be printed.
|
||||
|
||||
```
|
||||
python sample_benchmark.py --benchmarks=SampleBenchmark
|
||||
```
|
||||
|
||||
Setting the flag as `--benchmarks=.` or `--benchmarks=all` would work as well.
|
||||
|
||||
(Please ensure that Tensorflow is installed to successfully import the package in the line `import tensorflow as tf`. For installation instructions, see [Installing TensorFlow](https://www.tensorflow.org/install/). This step is not necessary when running with bazel.)
|
||||
|
||||
|
||||
## Adding a `bazel` Target
|
||||
|
||||
We have a special target called `tf_py_logged_benchmark` for benchmarks defined under TensorFlow github repo. `tf_py_logged_benchmark` should wrap around a regular `py_test` target. Running a `tf_py_logged_benchmark` would print a [TestResults](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/util/test_log.proto) proto. Defining a `tf_py_logged_benchmark` also lets us run it with TensorFlow continuous build.
|
||||
|
Loading…
Reference in New Issue
Block a user