Some tweaks to Python and e2e benchmarking docs (#4249)
diff --git a/docs/developing_iree/e2e_benchmarking.md b/docs/developing_iree/e2e_benchmarking.md
index 55450c8..d25ea4f 100644
--- a/docs/developing_iree/e2e_benchmarking.md
+++ b/docs/developing_iree/e2e_benchmarking.md
@@ -21,14 +21,27 @@
## 1. Run IREE's E2E TensorFlow tests to generate the benchmarking artifacts
```shell
-# Continuing from the "Running Python Tests" section of the doc linked above:
-$ cd ../iree-build/
+# Continuing from the "Running Python Tests" section of the doc linked above.
+# We need not only Python bindings, but also the TensorFlow compiler frontend.
+# Self-contained commands from that doc --- skip that if you have already
+# completed a build with Python bindings AND TensorFlow compiler frontend.
+$ cd iree-build/ # Make and cd into some build directory
+$ cmake ../iree -G Ninja \
+ -DCMAKE_C_COMPILER=clang \
+ -DCMAKE_CXX_COMPILER=clang++ \
+ -DIREE_BUILD_PYTHON_BINDINGS=ON \
+ -DIREE_BUILD_TENSORFLOW_COMPILER=ON
+$ cmake --build .
+# Also from the Python get-started doc, set this environment variable:
+$ export PYTHONPATH=$(pwd)/bindings/python
```
```shell
# --target_backends: All tests allow you to specify one or more backends to generate benchmarking artifacts for.
# --artifacts_dir: The default location for these artifacts is under /tmp/iree/modules
-$ python ../iree/integrations/tensorflow/e2e/matrix_ops_static.py \
+# This is a Python 3 program. On some systems, such as Debian derivatives,
+# use 'python3' instead of 'python'.
+$ python ../iree/integrations/tensorflow/e2e/matrix_ops_static_test.py \
--target_backends=iree_vmla
# View the generated artifacts:
$ tree /tmp/iree/modules/MatrixOpsStaticModule/
diff --git a/docs/get_started/getting_started_python.md b/docs/get_started/getting_started_python.md
index 14edbc2..aa8050d 100644
--- a/docs/get_started/getting_started_python.md
+++ b/docs/get_started/getting_started_python.md
@@ -62,22 +62,33 @@
## Building
+From the *parent* directory of the IREE git repository clone, create and enter
+a build directory, such as:
+
+```shell
+$ mkdir iree-build
+$ cd iree-build
+```
+
+Then build like this:
+
```shell
# Also include -DIREE_BUILD_TENSORFLOW_COMPILER=ON if you want the TF compiler.
-$ cmake -G Ninja -B ../iree-build/ \
+$ cmake ../iree -G Ninja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DIREE_BUILD_PYTHON_BINDINGS=ON .
-$ cd ../iree-build/
-$ ninja
+$ cmake --build .
```
## Running Python Tests
+We continue to assume that we are in the build directory where we made the
+build in the previous section.
+
To run tests for core Python bindings built with CMake:
```shell
-$ cd ../iree-build/
$ ctest -L bindings/python
```
@@ -85,12 +96,13 @@
comparison tests:
```shell
-$ cd ../iree-build/
# TODO: Revisit once more patches land.
$ ctest -L integrations/tensorflow/e2e
# Or run individually as:
-$ export PYTHONPATH=../iree-build/bindings/python
+$ export PYTHONPATH=$(pwd)/bindings/python
+# This is a Python 3 program. On some systems, such as Debian derivatives,
+# use 'python3' instead of 'python'.
$ python ../iree/integrations/tensorflow/e2e/simple_arithmetic_test.py \
--target_backends=iree_vmla --artifacts_dir=/tmp/artifacts
```
@@ -109,6 +121,7 @@
To install into your (hopefully isolated) virtual env:
```shell
+# See the above note about python3, and the above step setting PYTHONPATH.
python bindings/python/setup.py install
```