Add iree-cpuinfo to the python iree-runtime wheel. (#14209)

Fixes #14198
diff --git a/.github/workflows/validate_and_publish_release.yml b/.github/workflows/validate_and_publish_release.yml
index 9cad67b..eb4df98 100644
--- a/.github/workflows/validate_and_publish_release.yml
+++ b/.github/workflows/validate_and_publish_release.yml
@@ -42,12 +42,16 @@
         id: install_python_packages
         run: |
           python -m pip install -f file://$PWD/artifact/ iree-compiler iree-runtime iree-tools-tflite iree-tools-tf
+      # Binaries from the tarball
       - name: Run iree-benchmark-module
         id: run_iree_benchmark_module
         run: ./bin/iree-benchmark-module --help
       - name: Run iree-benchmark-trace
         id: run_iree_benchmark_trace
         run: ./bin/iree-benchmark-trace --help
+      - name: Run iree-cpuinfo
+        id: run_iree_cpuinfo
+        run: ./bin/iree-cpuinfo
       - name: Run iree-flatcc-cli
         id: run_iree_flatcc_cli
         run: ./bin/iree-flatcc-cli --help
@@ -69,6 +73,22 @@
       - name: Run iree-compile
         id: run_iree-compile
         run: ./bin/iree-compile --help
+      # Console scripts from the wheels.
+      - name: Py iree-run-module
+        id: py_iree-run-module
+        run: iree-run-module --help
+      - name: Py iree-run-trace
+        id: py_iree-run-trace
+        run: iree-run-trace --help
+      - name: Py iree-benchmark-module
+        id: py_iree_benchmark_module
+        run: iree-benchmark-module --help
+      - name: Py iree-benchmark-trace
+        id: py_iree_benchmark_trace
+        run: iree-benchmark-trace --help
+      - name: Py iree-cpuinfo
+        id: py_iree_cpuinfo
+        run: iree-cpuinfo
 
   publish_release:
     name: "Publish release"
diff --git a/runtime/bindings/python/CMakeLists.txt b/runtime/bindings/python/CMakeLists.txt
index c78fe5b..f0c3fd3 100644
--- a/runtime/bindings/python/CMakeLists.txt
+++ b/runtime/bindings/python/CMakeLists.txt
@@ -73,6 +73,7 @@
     "iree/runtime/tracing.py"
     "iree/runtime/scripts/iree_benchmark_trace/__main__.py"
     "iree/runtime/scripts/iree_benchmark_module/__main__.py"
+    "iree/runtime/scripts/iree_cpuinfo/__main__.py"
     "iree/runtime/scripts/iree_run_trace/__main__.py"
     "iree/runtime/scripts/iree_run_module/__main__.py"
     ${_PYTHON_EXTRA_SRCS}
@@ -94,6 +95,12 @@
 
 iree_symlink_tool(
   TARGET runtime
+  FROM_TOOL_TARGET iree-cpuinfo
+  TO_EXE_NAME iree/runtime/iree-cpuinfo
+)
+
+iree_symlink_tool(
+  TARGET runtime
   FROM_TOOL_TARGET iree-run-trace
   TO_EXE_NAME iree/runtime/iree-run-trace
 )
@@ -229,6 +236,7 @@
 cmake_language(DEFER DIRECTORY \"${IREE_SOURCE_DIR}\"
   CALL install
   TARGETS
+    iree-cpuinfo
     iree-benchmark-module
     iree-benchmark-trace
     iree-run-module
diff --git a/runtime/bindings/python/iree/runtime/scripts/iree_cpuinfo/__main__.py b/runtime/bindings/python/iree/runtime/scripts/iree_cpuinfo/__main__.py
new file mode 100644
index 0000000..948e2b5
--- /dev/null
+++ b/runtime/bindings/python/iree/runtime/scripts/iree_cpuinfo/__main__.py
@@ -0,0 +1,20 @@
+# Copyright 2023 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+import os
+import subprocess
+import sys
+
+
+def main(args=None):
+    if args is None:
+        args = sys.argv[1:]
+    exe = os.path.join(os.path.dirname(__file__), "..", "..", "iree-cpuinfo")
+    return subprocess.call(args=[exe] + args)
+
+
+if __name__ == "__main__":
+    sys.exit(main())
diff --git a/runtime/setup.py b/runtime/setup.py
index 9aee639..6cbd378 100644
--- a/runtime/setup.py
+++ b/runtime/setup.py
@@ -433,6 +433,7 @@
             "iree-run-trace = iree.runtime.scripts.iree_run_trace.__main__:main",
             "iree-benchmark-module = iree.runtime.scripts.iree_benchmark_module.__main__:main",
             "iree-benchmark-trace = iree.runtime.scripts.iree_benchmark_trace.__main__:main",
+            "iree-cpuinfo = iree.runtime.scripts.iree_cpuinfo.__main__:main",
             "iree-tracy-capture = iree.runtime.scripts.iree_tracy_capture.__main__:main",
         ],
     },