Update docs to add `input_type` flag (#6122)
Reflect changes introduced in https://github.com/google/iree/pull/6030
Co-authored-by: CindyLiu <hcindyl@google.com>
Co-authored-by: Scott Todd <scotttodd@google.com>
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/riscv64/test.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/riscv64/test.sh
index bf1eef7..923d359 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/riscv64/test.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/riscv64/test.sh
@@ -44,9 +44,9 @@
-L "${RISCV_TOOLCHAIN_ROOT?}/sysroot" \
"${BUILD_RISCV_DIR?}/iree/tools/iree-run-module" --driver=dylib \
--module_file="${BUILD_RISCV_DIR?}/iree-run-module-llvm_aot.vmfb" \
- --entry_function=abs --function_input="i32=-10")
+ --entry_function=abs --function_input="f32=-10")
# Check the result of running abs(-10).
-if [[ "${IREE_RUN_OUT}" != *"i32=10" ]]; then
+if [[ "${IREE_RUN_OUT}" != *"f32=10" ]]; then
exit 1
fi
diff --git a/docs/developers/design_docs/cuda_backend.md b/docs/developers/design_docs/cuda_backend.md
index eb0cac4..ea4761a 100644
--- a/docs/developers/design_docs/cuda_backend.md
+++ b/docs/developers/design_docs/cuda_backend.md
@@ -78,6 +78,7 @@
```shell
# First translate into a VM bytecode module using linalg on tensors path.
$ ../iree-build/iree/tools/iree-translate \
+ -iree-input-type=mhlo \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=cuda \
-iree-flow-dispatch-linalg-on-tensors \
diff --git a/docs/developers/developing_iree/benchmarking.md b/docs/developers/developing_iree/benchmarking.md
index ff08628..3694cf1 100644
--- a/docs/developers/developing_iree/benchmarking.md
+++ b/docs/developers/developing_iree/benchmarking.md
@@ -22,7 +22,7 @@
$ bazel run //iree/tools:iree-translate -- \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=vmvx \
- $PWD/iree/tools/test/iree-benchmark-module.mlir \
+ $PWD/iree/samples/models/simple_abs.mlir \
-o /tmp/module.fb
```
@@ -33,7 +33,7 @@
--module_file=/tmp/module.fb \
--driver=vmvx \
--entry_function=abs \
- --function_input=i32=-2
+ --function_input=f32=-2
```
You'll see output like
@@ -80,7 +80,7 @@
--module_file=/tmp/module.fb \
--driver=vmvx \
--entry_function=abs \
- --function_input=i32=-2
+ --function_input=f32=-2
```
```shell
@@ -108,6 +108,7 @@
```shell
$ build/iree/tools/iree-translate \
+ -iree-input-type=mhlo \
-iree-mlir-to-vm-bytecode-module \
-iree-flow-export-benchmark-funcs \
-iree-hal-target-backends=vmvx \
diff --git a/docs/developers/developing_iree/developer_overview.md b/docs/developers/developing_iree/developer_overview.md
index eb7347a..64aad5d 100644
--- a/docs/developers/developing_iree/developer_overview.md
+++ b/docs/developers/developing_iree/developer_overview.md
@@ -88,7 +88,7 @@
```
For a more complex example, here's how to run IREE's complete transformation
-pipeline targeting the VMLA backend on the
+pipeline targeting the VMVX backend on the
[fullyconnected.mlir](https://github.com/google/iree/blob/main/iree/test/e2e/models/fullyconnected.mlir)
model file:
@@ -118,8 +118,8 @@
$ ../iree-build/iree/tools/iree-translate \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=vmvx \
- $PWD/iree/tools/test/iree-run-module.mlir \
- -o /tmp/simple.vmfb
+ $PWD/iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_vmvx.vmfb
```
Custom translations may also be layered on top of `iree-translate`, see
@@ -133,15 +133,15 @@
This program can be used in sequence with `iree-translate` to translate a
`.mlir` file to an IREE module and then execute it. Here is an example command
-that executes the simple `simple.vmfb` compiled from `simple.mlir` above on
-IREE's VMLA driver:
+that executes the simple `simple_abs_vmvx.vmfb` compiled from `simple_abs.mlir`
+above on IREE's VMVX driver:
```shell
$ ../iree-build/iree/tools/iree-run-module \
- --module_file=/tmp/simple.vmfb \
+ --module_file=/tmp/simple_abs_vmvx.vmfb \
--driver=vmvx \
--entry_function=abs \
- --function_input=i32=-2
+ --function_input=f32=-2
```
### iree-check-module
@@ -154,6 +154,7 @@
```shell
$ ../iree-build/iree/tools/iree-translate \
+ -iree-input-type=mhlo \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=vmvx \
$PWD/iree/test/e2e/xla_ops/abs.mlir \
@@ -176,12 +177,12 @@
function as exported by default and running all of them.
For example, to execute the contents of
-[iree/tools/test/iree-run-mlir.mlir](https://github.com/google/iree/blob/main/iree/tools/test/iree-run-mlir.mlir):
+[iree/samples/models/simple_abs.mlir](https://github.com/google/iree/blob/main/iree/samples/models/simple_abs.mlir):
```shell
$ ../iree-build/iree/tools/iree-run-mlir \
- $PWD/iree/tools/test/iree-run-mlir.mlir \
- -function-input="i32=-2" \
+ $PWD/iree/samples/models/simple_abs.mlir \
+ -function-input="f32=-2" \
-iree-hal-target-backends=vmvx
```
@@ -193,7 +194,7 @@
For example, to inspect the module translated above:
```shell
-$ ../iree-build/iree/tools/iree-dump-module /tmp/simple.vmfb
+$ ../iree-build/iree/tools/iree-dump-module /tmp/simple_abs_vmvx.vmfb
```
### Useful generic flags
diff --git a/docs/developers/developing_iree/profiling_vulkan_gpu.md b/docs/developers/developing_iree/profiling_vulkan_gpu.md
index 8fb76b5..3b4369e 100644
--- a/docs/developers/developing_iree/profiling_vulkan_gpu.md
+++ b/docs/developers/developing_iree/profiling_vulkan_gpu.md
@@ -37,8 +37,9 @@
```shell
# First translate into a VM bytecode module
$ /path/to/iree/build/iree/tools/iree-translate -- \
+ -iree-input-type=mhlo \
-iree-mlir-to-vm-bytecode-module \
- --iree-hal-target-backends=vulkan-spirv \
+ -iree-hal-target-backends=vulkan-spirv \
/path/to/mhlo-dot.mlir \
-o /tmp/mhlo-dot.vmfb
diff --git a/docs/developers/get_started/getting_started_android_cmake.md b/docs/developers/get_started/getting_started_android_cmake.md
index 5e4ab1b..4c9b5a0 100644
--- a/docs/developers/get_started/getting_started_android_cmake.md
+++ b/docs/developers/get_started/getting_started_android_cmake.md
@@ -146,8 +146,8 @@
$ ../iree-build-host/install/bin/iree-translate \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=vmvx \
- $PWD/iree/tools/test/iree-run-module.mlir \
- -o /tmp/simple-vmvx.vmfb
+ $PWD/iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_vmvx.vmfb
```
Then push the IREE runtime executable and module to the device:
@@ -155,7 +155,7 @@
```shell
$ adb push ../iree-build-android/iree/tools/iree-run-module /data/local/tmp/
$ adb shell chmod +x /data/local/tmp/iree-run-module
-$ adb push /tmp/simple-vmvx.vmfb /data/local/tmp/
+$ adb push /tmp/simple_abs_vmvx.vmfb /data/local/tmp/
```
Log into Android:
@@ -166,12 +166,12 @@
android $ cd /data/local/tmp/
android $ ./iree-run-module \
--driver=vmvx \
- --module_file=simple-vmvx.vmfb \
+ --module_file=simple_abs_vmvx.vmfb \
--entry_function=abs \
- --function_input=i32=-5
+ --function_input=f32=-5
EXEC @abs
-i32=5
+f32=5
```
### Vulkan HAL backend
@@ -185,8 +185,8 @@
$ ../iree-build-host/install/bin/iree-translate \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=vulkan-spirv \
- $PWD/iree/tools/test/iree-run-module.mlir \
- -o /tmp/simple-vulkan.vmfb
+ $PWD/iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_vulkan.vmfb
```
Then push the IREE runtime executable and module to the device:
@@ -194,7 +194,7 @@
```shell
$ adb push ../iree-build-android/iree/tools/iree-run-module /data/local/tmp/
$ adb shell chmod +x /data/local/tmp/iree-run-module
-$ adb push /tmp/simple-vulkan.vmfb /data/local/tmp/
+$ adb push /tmp/simple_abs_vulkan.vmfb /data/local/tmp/
```
Log into Android:
@@ -205,12 +205,12 @@
android $ cd /data/local/tmp/
android $ ./iree-run-module \
--driver=vulkan \
- --module_file=simple-vulkan.vmfb \
+ --module_file=simple_abs_vulkan.vmfb \
--entry_function=abs \
- --function_input=i32=-5
+ --function_input=f32=-5
EXEC @abs
-i32=5
+f32=5
```
#### Common issues
@@ -263,8 +263,8 @@
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=dylib-llvm-aot \
-iree-llvm-target-triple=aarch64-linux-android \
- $PWD/iree/tools/test/iree-run-module.mlir \
- -o /tmp/simple-llvm_aot.vmfb
+ $PWD/iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_dylib.vmfb
```
Then push the IREE runtime executable and module to the device:
@@ -272,7 +272,7 @@
```shell
$ adb push ../iree-build-android/iree/tools/iree-run-module /data/local/tmp/
$ adb shell chmod +x /data/local/tmp/iree-run-module
-$ adb push /tmp/simple-llvm_aot.vmfb /data/local/tmp/
+$ adb push /tmp/simple_abs_dylib.vmfb /data/local/tmp/
```
Log into Android:
@@ -283,10 +283,10 @@
android $ cd /data/local/tmp/
android $ ./iree-run-module \
--driver=dylib \
- --module_file=simple-llvm_aot.vmfb \
+ --module_file=simple_abs_dylib.vmfb \
--entry_function=abs \
- --function_input=i32=-5
+ --function_input=f32=-5
EXEC @abs
-i32=5
+f32=5
```
diff --git a/docs/developers/get_started/getting_started_linux_bazel.md b/docs/developers/get_started/getting_started_linux_bazel.md
index 3aa9c31..c010058 100644
--- a/docs/developers/get_started/getting_started_linux_bazel.md
+++ b/docs/developers/get_started/getting_started_linux_bazel.md
@@ -113,12 +113,12 @@
```
Translate a
-[MLIR file](https://github.com/google/iree/blob/main/iree/tools/test/iree-run-mlir.mlir)
+[MLIR file](https://github.com/google/iree/blob/main/iree/samples/models/simple_abs.mlir)
and execute a function in the compiled module:
```shell
-$ ./bazel-bin/iree/tools/iree-run-mlir ./iree/tools/test/iree-run-mlir.mlir \
- -function-input="i32=-2" -iree-hal-target-backends=vmvx -print-mlir
+$ ./bazel-bin/iree/tools/iree-run-mlir ./iree/samples/models/simple_abs.mlir \
+ -function-input="f32=-2" -iree-hal-target-backends=vmvx -print-mlir
```
### Further Reading
diff --git a/docs/developers/get_started/getting_started_linux_cmake.md b/docs/developers/get_started/getting_started_linux_cmake.md
index 4d40b24..7010b1e 100644
--- a/docs/developers/get_started/getting_started_linux_cmake.md
+++ b/docs/developers/get_started/getting_started_linux_cmake.md
@@ -99,12 +99,12 @@
```
Translate a
-[MLIR file](https://github.com/google/iree/blob/main/iree/tools/test/iree-run-module.mlir)
+[MLIR file](https://github.com/google/iree/blob/main/iree/samples/models/simple_abs.mlir)
and execute a function in the compiled module:
```shell
-$ ../iree-build/iree/tools/iree-run-mlir $PWD/iree/tools/test/iree-run-module.mlir \
- -function-input="i32=-2" -iree-hal-target-backends=vmvx -print-mlir
+$ ../iree-build/iree/tools/iree-run-mlir $PWD/iree/samples/models/simple_abs.mlir \
+ -function-input="f32=-2" -iree-hal-target-backends=vmvx -print-mlir
```
### LLVM Ahead-of-Time (AOT) backend
@@ -124,8 +124,8 @@
-iree-mlir-to-vm-bytecode-module \
-iree-llvm-target-triple=x86_64-linux-gnu \
-iree-hal-target-backends=dylib-llvm-aot \
- iree/tools/test/iree-run-module.mlir \
- -o /tmp/simple-llvm_aot.vmfb
+ iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_dylib.vmfb
```
Then run the compiled module using the `dylib` HAL driver:
@@ -133,12 +133,12 @@
```shell
$ ../iree-build/iree/tools/iree-run-module \
--driver=dylib \
- --module_file=/tmp/simple-llvm_aot.vmfb \
+ --module_file=/tmp/simple_abs_dylib.vmfb \
--entry_function=abs \
- --function_input=i32=-5
+ --function_input=f32=-5
EXEC @abs
-i32=5
+f32=5
```
diff --git a/docs/developers/get_started/getting_started_linux_vulkan.md b/docs/developers/get_started/getting_started_linux_vulkan.md
index 1264297..85903c0 100644
--- a/docs/developers/get_started/getting_started_linux_vulkan.md
+++ b/docs/developers/get_started/getting_started_linux_vulkan.md
@@ -117,10 +117,10 @@
```shell
# -- CMake --
$ cmake --build ../iree-build/ --target iree_tools_iree-translate
-$ ../iree-build/iree/tools/iree-translate -iree-mlir-to-vm-bytecode-module -iree-hal-target-backends=vulkan-spirv ./iree/tools/test/iree-run-module.mlir -o /tmp/module.vmfb
+$ ../iree-build/iree/tools/iree-translate -iree-mlir-to-vm-bytecode-module -iree-hal-target-backends=vulkan-spirv ./iree/samples/models/simple_abs.mlir -o /tmp/module.vmfb
# -- Bazel --
-$ bazel run iree/tools:iree-translate -- -iree-mlir-to-vm-bytecode-module -iree-hal-target-backends=vulkan-spirv $PWD/iree/tools/test/iree-run-module.mlir -o /tmp/module.vmfb
+$ bazel run iree/tools:iree-translate -- -iree-mlir-to-vm-bytecode-module -iree-hal-target-backends=vulkan-spirv $PWD/iree/samples/models/simple_abs.mlir -o /tmp/module.vmfb
```
> Tip:<br>
@@ -138,14 +138,14 @@
--driver=vulkan \
--module_file=/tmp/module.vmfb \
--entry_function=abs \
- --function_input=i32=-2
+ --function_input=f32=-2
# -- Bazel --
$ bazel run iree/tools:iree-run-module -- \
--driver=vulkan \
--module_file=/tmp/module.vmfb \
--entry_function=abs \
- --function_input=i32=-2
+ --function_input=f32=-2
```
## Running IREE's Vulkan Samples
diff --git a/docs/developers/get_started/getting_started_macos_bazel.md b/docs/developers/get_started/getting_started_macos_bazel.md
index ae39ec9..4b3eece 100644
--- a/docs/developers/get_started/getting_started_macos_bazel.md
+++ b/docs/developers/get_started/getting_started_macos_bazel.md
@@ -116,12 +116,12 @@
```
Translate a
-[MLIR file](https://github.com/google/iree/blob/main/iree/tools/test/iree-run-mlir.mlir)
+[MLIR file](https://github.com/google/iree/blob/main/iree/samples/models/simple_abs.mlir)
and execute a function in the compiled module:
```shell
-$ ./bazel-bin/iree/tools/iree-run-mlir ./iree/tools/test/iree-run-mlir.mlir \
- -function-input="i32=-2" -iree-hal-target-backends=vmvx -print-mlir
+$ ./bazel-bin/iree/tools/iree-run-mlir ./iree/samples/models/simple_abs.mlir \
+ -function-input="f32=-2" -iree-hal-target-backends=vmvx -print-mlir
```
### Further Reading
diff --git a/docs/developers/get_started/getting_started_macos_cmake.md b/docs/developers/get_started/getting_started_macos_cmake.md
index cc9b662..ef7aef3 100644
--- a/docs/developers/get_started/getting_started_macos_cmake.md
+++ b/docs/developers/get_started/getting_started_macos_cmake.md
@@ -99,12 +99,12 @@
```
Translate a
-[MLIR file](https://github.com/google/iree/blob/main/iree/tools/test/iree-run-mlir.mlir)
+[MLIR file](https://github.com/google/iree/blob/main/iree/samples/models/simple_abs.mlir)
and execute a function in the compiled module:
```shell
-$ ../iree-build/iree/tools/iree-run-mlir $PWD/iree/tools/test/iree-run-mlir.mlir \
- -function-input="i32=-2" -iree-hal-target-backends=vmvx -print-mlir
+$ ../iree-build/iree/tools/iree-run-mlir $PWD/iree/samples/models/simple_abs.mlir \
+ -function-input="f32=-2" -iree-hal-target-backends=vmvx -print-mlir
```
### Further Reading
diff --git a/docs/developers/get_started/getting_started_riscv_cmake.md b/docs/developers/get_started/getting_started_riscv_cmake.md
index d0e4e37..5eb4453 100644
--- a/docs/developers/get_started/getting_started_riscv_cmake.md
+++ b/docs/developers/get_started/getting_started_riscv_cmake.md
@@ -94,8 +94,8 @@
$ ../iree-build-host/install/bin/iree-translate \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=vmvx \
- $PWD/iree/tools/test/iree-run-module.mlir \
- -o /tmp/iree-run-module-vmvx.vmfb
+ $PWD/iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_vmvx.vmfb
```
Then run on the RISC-V QEMU:
@@ -106,9 +106,9 @@
-L $HOME/riscv/toolchain/clang/linux/RISCV/sysroot/ \
../iree-build-riscv/iree/tools/iree-run-module \
--driver=vmvx \
- --module_file=/tmp/iree-run-module-vmvx.vmfb \
+ --module_file=/tmp/simple_abs_vmvx.vmfb \
--entry_function=abs \
- --function_input=i32=-5
+ --function_input=f32=-5
```
Output:
@@ -116,8 +116,7 @@
```
I ../iree/tools/utils/vm_util.cc:227] Creating driver and device for 'vmvx'...
EXEC @abs
-I ../iree/tools/utils/vm_util.cc:172] result[0]: Buffer<sint32[]>
-i32=5
+f32=5
```
### Dylib LLVM AOT backend
@@ -138,8 +137,8 @@
-iree-llvm-target-triple=riscv64 \
-iree-llvm-target-cpu=sifive-u74 \
-iree-llvm-target-abi=lp64d \
- $PWD/iree/tools/test/iree-run-module.mlir \
- -o /tmp/iree-run-module-llvm_aot.vmfb
+ $PWD/iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_dylib.vmfb
```
Then run on the RISC-V QEMU:
@@ -150,9 +149,9 @@
-L $HOME/riscv/toolchain/clang/linux/RISCV/sysroot/ \
../iree-build-riscv/iree/tools/iree-run-module \
--driver=dylib \
- --module_file=/tmp/iree-run-module-llvm_aot.vmfb \
+ --module_file=/tmp/simple_abs_dylib.vmfb \
--entry_function=abs \
- --function_input=i32=-5
+ --function_input=f32=-5
```
Output:
@@ -160,8 +159,7 @@
```
I ../iree/tools/utils/vm_util.cc:227] Creating driver and device for 'dylib'...
EXEC @abs
-I ../iree/tools/utils/vm_util.cc:172] result[0]: Buffer<sint32[]>
-i32=5
+f32=5
```
#### Enable RVV code-gen [Experimental]
diff --git a/docs/developers/get_started/getting_started_windows_bazel.md b/docs/developers/get_started/getting_started_windows_bazel.md
index 5fbd9a2..3c2e69e 100644
--- a/docs/developers/get_started/getting_started_windows_bazel.md
+++ b/docs/developers/get_started/getting_started_windows_bazel.md
@@ -118,11 +118,11 @@
```
Translate a
-[MLIR file](https://github.com/google/iree/blob/main/iree/tools/test/iree-run-mlir.mlir)
+[MLIR file](https://github.com/google/iree/blob/main/iree/samples/models/simple_abs.mlir)
and execute a function in the compiled module:
```powershell
-> .\bazel-bin\iree\tools\iree-run-mlir.exe .\iree\tools\test\iree-run-mlir.mlir -function-input="i32=-2" -iree-hal-target-backends=vmvx -print-mlir
+> .\bazel-bin\iree\tools\iree-run-mlir.exe .\iree\samples\models\simple_abs.mlir -function-input="f32=-2" -iree-hal-target-backends=vmvx -print-mlir
```
### Further Reading
diff --git a/docs/developers/get_started/getting_started_windows_cmake.md b/docs/developers/get_started/getting_started_windows_cmake.md
index bf7241a..e405456 100644
--- a/docs/developers/get_started/getting_started_windows_cmake.md
+++ b/docs/developers/get_started/getting_started_windows_cmake.md
@@ -115,7 +115,7 @@
> ..\iree-build\iree\tools\iree-translate.exe \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=dylib-llvm-aot \
- iree/tools/test/iree-run-module.mlir \
+ iree/samples/models/simple_abs.mlir \
-o %TMP%/simple-llvm_aot.vmfb
```
@@ -130,7 +130,7 @@
-iree-llvm-target-triple=x86_64-pc-windows-msvc \
-iree-llvm-target-cpu=host \
-iree-llvm-target-cpu-features=host \
- iree/tools/test/iree-run-module.mlir \
+ iree/samples/models/simple_abs.mlir \
-o %TMP%/simple-llvm_aot.vmfb
```
@@ -146,11 +146,11 @@
```
Translate a
-[MLIR file](https://github.com/google/iree/blob/main/iree/tools/test/iree-run-mlir.mlir)
+[MLIR file](https://github.com/google/iree/blob/main/iree/samples/models/simple_abs.mlir)
and execute a function in the compiled module:
```powershell
-> ..\iree-build\iree\tools\iree-run-mlir.exe .\iree\tools\test\iree-run-mlir.mlir -function-input="i32=-2" -iree-hal-target-backends=vmvx -print-mlir
+> ..\iree-build\iree\tools\iree-run-mlir.exe .\iree\samples\models\simple_abs.mlir -function-input="f32=-2" -iree-hal-target-backends=vmvx -print-mlir
```
### Further Reading
diff --git a/docs/developers/get_started/getting_started_windows_vulkan.md b/docs/developers/get_started/getting_started_windows_vulkan.md
index 4b37faa..d5f43aa 100644
--- a/docs/developers/get_started/getting_started_windows_vulkan.md
+++ b/docs/developers/get_started/getting_started_windows_vulkan.md
@@ -136,14 +136,14 @@
--driver=vulkan \
--module_file=.\build\module.vmfb \
--entry_function=abs \
- --function_input=i32=-2
+ --function_input=f32=-2
# -- Bazel --
> bazel run iree/tools:iree-run-module -- \
--driver=vulkan \
--module_file=.\build\module.vmfb \
--entry_function=abs \
- --function_input=i32=-2
+ --function_input=f32=-2
```
## Running IREE's Vulkan Samples
diff --git a/docs/website/docs/building-from-source/android.md b/docs/website/docs/building-from-source/android.md
index 2437901..a2efc28 100644
--- a/docs/website/docs/building-from-source/android.md
+++ b/docs/website/docs/building-from-source/android.md
@@ -113,8 +113,8 @@
../iree-build/install/bin/iree-translate \
-iree-mlir-to-vm-bytecode-module \
-iree-hal-target-backends=vmvx \
- iree/tools/test/iree-run-module.mlir \
- -o /tmp/iree-run-module-vmvx.vmfb
+ iree/samples/models/simple_abs.mlir \
+ -o /tmp/simple_abs_vmvx.vmfb
```
Push the Android runtime tools to the device, along with any input files:
@@ -122,14 +122,14 @@
``` shell
adb push ../iree-build-android/iree/tools/iree-run-module /data/local/tmp/
adb shell chmod +x /data/local/tmp/iree-run-module
-adb push /tmp/iree-run-module-vmvx.vmfb /data/local/tmp/
+adb push /tmp/simple_abs_vmvx.vmfb /data/local/tmp/
```
Run the tool:
``` shell
adb shell /data/local/tmp/iree-run-module -driver=vmvx \
- -module_file=/data/local/tmp/iree-run-module-vmvx.vmfb \
+ -module_file=/data/local/tmp/simple_abs_vmvx.vmfb \
-entry_function=abs \
- -function_inputs="i32=-5"
+ -function_inputs="f32=-5"
```
diff --git a/iree/samples/models/simple_abs.mlir b/iree/samples/models/simple_abs.mlir
new file mode 100644
index 0000000..646f807
--- /dev/null
+++ b/iree/samples/models/simple_abs.mlir
@@ -0,0 +1,4 @@
+func @abs(%input : tensor<f32>) -> (tensor<f32>) attributes { iree.module.export } {
+ %result = absf %input : tensor<f32>
+ return %result : tensor<f32>
+}
diff --git a/iree/tools/test/iree-benchmark-module.mlir b/iree/tools/test/iree-benchmark-module.mlir
index 6a6713a..5bf7b58 100644
--- a/iree/tools/test/iree-benchmark-module.mlir
+++ b/iree/tools/test/iree-benchmark-module.mlir
@@ -1,9 +1,9 @@
-// RUN: iree-translate --iree-input-type=mhlo --iree-hal-target-backends=vmvx -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=vmvx --entry_function=abs --function_input=i32=-2 | IreeFileCheck %s
-// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-translate --iree-input-type=mhlo --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=vulkan --entry_function=abs --function_input=i32=-2 | IreeFileCheck %s)
-// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-translate --iree-input-type=mhlo --iree-hal-target-backends=dylib-llvm-aot -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=dylib --entry_function=abs --function_input=i32=-2 | IreeFileCheck %s)
+// RUN: iree-translate --iree-hal-target-backends=vmvx -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=vmvx --entry_function=abs --function_input=f32=-2 | IreeFileCheck %s
+// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=vulkan --entry_function=abs --function_input=f32=-2 | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-translate --iree-hal-target-backends=dylib-llvm-aot -iree-mlir-to-vm-bytecode-module %s | iree-benchmark-module --driver=dylib --entry_function=abs --function_input=f32=-2 | IreeFileCheck %s)
// CHECK-LABEL: BM_abs
-func @abs(%input : tensor<i32>) -> (tensor<i32>) attributes { iree.module.export } {
- %result = "mhlo.abs"(%input) : (tensor<i32>) -> tensor<i32>
- return %result : tensor<i32>
+func @abs(%input : tensor<f32>) -> (tensor<f32>) attributes { iree.module.export } {
+ %result = absf %input : tensor<f32>
+ return %result : tensor<f32>
}
diff --git a/iree/tools/test/iree-run-mlir.mlir b/iree/tools/test/iree-run-mlir.mlir
index b85522c..92fa70d 100644
--- a/iree/tools/test/iree-run-mlir.mlir
+++ b/iree/tools/test/iree-run-mlir.mlir
@@ -1,10 +1,10 @@
-// RUN: (iree-run-mlir --iree-input-type=mhlo --iree-hal-target-backends=vmvx --function-input="i32=-2" %s) | IreeFileCheck %s
-// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir --iree-input-type=mhlo -iree-hal-target-backends=vulkan-spirv --function-input="i32=-2" %s | IreeFileCheck %s)
-// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir --iree-input-type=mhlo -iree-hal-target-backends=dylib-llvm-aot --function-input="i32=-2" %s | IreeFileCheck %s)
+// RUN: (iree-run-mlir --iree-hal-target-backends=vmvx --function-input="f32=-2" %s) | IreeFileCheck %s
+// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir -iree-hal-target-backends=vulkan-spirv --function-input="f32=-2" %s | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || (iree-run-mlir -iree-hal-target-backends=dylib-llvm-aot --function-input="f32=-2" %s | IreeFileCheck %s)
// CHECK-LABEL: EXEC @abs
-func @abs(%input : tensor<i32>) -> (tensor<i32>) attributes { iree.module.export } {
- %result = "mhlo.abs"(%input) : (tensor<i32>) -> tensor<i32>
- return %result : tensor<i32>
+func @abs(%input : tensor<f32>) -> (tensor<f32>) attributes { iree.module.export } {
+ %result = absf %input : tensor<f32>
+ return %result : tensor<f32>
}
-// CHECK: i32=2
+// CHECK: f32=2
diff --git a/iree/tools/test/iree-run-module.mlir b/iree/tools/test/iree-run-module.mlir
index 5306a1a..62dee4d 100644
--- a/iree/tools/test/iree-run-module.mlir
+++ b/iree/tools/test/iree-run-module.mlir
@@ -1,10 +1,10 @@
-// RUN: (iree-translate --iree-input-type=mhlo --iree-hal-target-backends=vmvx -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=vmvx --entry_function=abs --function_input=i32=-2) | IreeFileCheck %s
-// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || ((iree-translate --iree-input-type=mhlo --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=vulkan --entry_function=abs --function_input=i32=-2) | IreeFileCheck %s)
-// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || ((iree-translate --iree-input-type=mhlo --iree-hal-target-backends=dylib-llvm-aot -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=dylib --entry_function=abs --function_input=i32=-2) | IreeFileCheck %s)
+// RUN: (iree-translate --iree-hal-target-backends=vmvx -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=vmvx --entry_function=abs --function_input=f32=-2) | IreeFileCheck %s
+// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || ((iree-translate --iree-hal-target-backends=vulkan-spirv -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=vulkan --entry_function=abs --function_input=f32=-2) | IreeFileCheck %s)
+// RUN: [[ $IREE_LLVMAOT_DISABLE == 1 ]] || ((iree-translate --iree-hal-target-backends=dylib-llvm-aot -iree-mlir-to-vm-bytecode-module %s | iree-run-module --driver=dylib --entry_function=abs --function_input=f32=-2) | IreeFileCheck %s)
// CHECK-LABEL: EXEC @abs
-func @abs(%input : tensor<i32>) -> (tensor<i32>) attributes { iree.module.export } {
- %result = "mhlo.abs"(%input) : (tensor<i32>) -> tensor<i32>
- return %result : tensor<i32>
+func @abs(%input : tensor<f32>) -> (tensor<f32>) attributes { iree.module.export } {
+ %result = absf %input : tensor<f32>
+ return %result : tensor<f32>
}
-// CHECK: i32=2
+// CHECK: f32=2