Merge google -> main (#6133)
* Merge pull request #6132 from NatashaKnk:main-to-google
* Synchronize submodules with LLVM at llvm/llvm-project@b109172
* Integrate LLVM at llvm/llvm-project@7ed7d4c
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py b/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
index 48f9639..8223f10 100644
--- a/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
@@ -20,6 +20,7 @@
"@llvm-project//mlir:AllPassesAndDialects": ["MLIRAllDialects"],
"@llvm-project//mlir:AffineToStandardTransforms": ["MLIRAffineToStandard"],
"@llvm-project//mlir:CFGTransforms": ["MLIRSCFToStandard"],
+ "@llvm-project//mlir:ComplexDialect": ["MLIRComplex"],
"@llvm-project//mlir:DialectUtils": [""],
"@llvm-project//mlir:ExecutionEngineUtils": ["MLIRExecutionEngine"],
"@llvm-project//mlir:GPUDialect": ["MLIRGPU"],
diff --git a/build_tools/buildkite/cmake/android/arm64-v8a/benchmark.yml b/build_tools/buildkite/cmake/android/arm64-v8a/benchmark.yml
index 25bd579..35181d8 100644
--- a/build_tools/buildkite/cmake/android/arm64-v8a/benchmark.yml
+++ b/build_tools/buildkite/cmake/android/arm64-v8a/benchmark.yml
@@ -7,9 +7,9 @@
steps:
- label: "build"
commands:
- - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:eb72a4864f30ba53868cf23caf44e60aca35a36682ed1b1a5fa37cd9fda8855c build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh arm64-v8a"
+ - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:a152f0d006e237105f8ed9a7e041a6a235c1a69dc1e209383c81087c574b39bf build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh arm64-v8a"
- "python3 build_tools/mako/prepare_benchmark_files.py"
- - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:eb72a4864f30ba53868cf23caf44e60aca35a36682ed1b1a5fa37cd9fda8855c python3 build_tools/mako/compile_android_modules.py"
+ - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:a152f0d006e237105f8ed9a7e041a6a235c1a69dc1e209383c81087c574b39bf python3 build_tools/mako/compile_android_modules.py"
- "tar -czvf model-Pixel4-artifacts.tgz build-android/iree/tools/iree-benchmark-module *Pixel4*.vmfb"
- "tar -czvf model-S20-artifacts.tgz build-android/iree/tools/iree-benchmark-module *S20*.vmfb"
- "tar -czvf flagfiles.tgz *_flagfile"
diff --git a/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml b/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml
index 418d054..98808a2 100644
--- a/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml
+++ b/build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml
@@ -7,7 +7,7 @@
steps:
- label: "build"
commands:
- - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:eb72a4864f30ba53868cf23caf44e60aca35a36682ed1b1a5fa37cd9fda8855c build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh arm64-v8a"
+ - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:a152f0d006e237105f8ed9a7e041a6a235c1a69dc1e209383c81087c574b39bf build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh arm64-v8a"
- "tar --exclude='*.o' --exclude='*.a' -czvf build-artifacts.tgz build-android"
agents:
- "queue=build"
diff --git a/build_tools/docker/cmake-android/Dockerfile b/build_tools/docker/cmake-android/Dockerfile
index a1346ab..605903e 100644
--- a/build_tools/docker/cmake-android/Dockerfile
+++ b/build_tools/docker/cmake-android/Dockerfile
@@ -16,7 +16,7 @@
RUN unzip "android-ndk-${NDK_VERSION?}-linux-x86_64.zip" -d /usr/src/
-FROM gcr.io/iree-oss/cmake-python@sha256:c2cb0153124bcb1d7777ae134eba3db5ba3b9701c076456235c237c209fc31fd AS final
+FROM gcr.io/iree-oss/cmake-python@sha256:24892ba1d23b8aaf6e4b9c700f524e7de1f19cff903fa6a5dc87579d97077453 AS final
ARG NDK_VERSION
COPY --from=install-ndk "/usr/src/android-ndk-${NDK_VERSION}" "/usr/src/android-ndk-${NDK_VERSION}"
ENV ANDROID_NDK "/usr/src/android-ndk-${NDK_VERSION}"
diff --git a/build_tools/docker/cmake-bazel-frontends-android/Dockerfile b/build_tools/docker/cmake-bazel-frontends-android/Dockerfile
index 0449f2c..3e67f03 100644
--- a/build_tools/docker/cmake-bazel-frontends-android/Dockerfile
+++ b/build_tools/docker/cmake-bazel-frontends-android/Dockerfile
@@ -4,12 +4,12 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-FROM gcr.io/iree-oss/cmake-bazel-frontends@sha256:f8a911a4c6f8f2733f8fe9264992dcff192b01f4f5883a5cde1452fccc2fce5e AS final
+FROM gcr.io/iree-oss/cmake-bazel-frontends@sha256:8974ee20d855ecfc8b9e511f4fb4a25d67888952738d2c457d9fd91116b6b67f AS final
# Note that NDK_VERSION should be kept in sync with the one in cmake-android.
# That actually means this isn't really an ARG because we cannot build this
# image with a different NDK version.
ARG NDK_VERSION=r21d
-COPY --from=gcr.io/iree-oss/cmake-android@sha256:eb72a4864f30ba53868cf23caf44e60aca35a36682ed1b1a5fa37cd9fda8855c "/usr/src/android-ndk-${NDK_VERSION}" "/usr/src/android-ndk-${NDK_VERSION}"
+COPY --from=gcr.io/iree-oss/cmake-android@sha256:a152f0d006e237105f8ed9a7e041a6a235c1a69dc1e209383c81087c574b39bf "/usr/src/android-ndk-${NDK_VERSION}" "/usr/src/android-ndk-${NDK_VERSION}"
ENV ANDROID_NDK "/usr/src/android-ndk-${NDK_VERSION}"
diff --git a/build_tools/docker/cmake-bazel-frontends-nvidia/Dockerfile b/build_tools/docker/cmake-bazel-frontends-nvidia/Dockerfile
index 096e532..eb7de03 100644
--- a/build_tools/docker/cmake-bazel-frontends-nvidia/Dockerfile
+++ b/build_tools/docker/cmake-bazel-frontends-nvidia/Dockerfile
@@ -33,7 +33,7 @@
# does not support Ubuntu 18.04.
# This allows to share configuration with base CMake, but it also means we need
# to MATCH the driver version between the host machine and the docker image.
-FROM gcr.io/iree-oss/cmake-bazel-frontends-vulkan@sha256:de4862ad6704309bb1a7e64e14be6790d2957aea394859dad47171874cb2b221 AS final
+FROM gcr.io/iree-oss/cmake-bazel-frontends-vulkan@sha256:e99fd07a48e2b1a00200b3b600ff00878d413045cb7809fe73dac4c36fa4825a AS final
ARG NVIDIA_COMMON_DEB
ARG NVIDIA_GL_DEB
ARG NVIDIA_COMPUTE_DEB
diff --git a/build_tools/docker/cmake-bazel-frontends-swiftshader/Dockerfile b/build_tools/docker/cmake-bazel-frontends-swiftshader/Dockerfile
index 42dc7ba..44f8c08 100644
--- a/build_tools/docker/cmake-bazel-frontends-swiftshader/Dockerfile
+++ b/build_tools/docker/cmake-bazel-frontends-swiftshader/Dockerfile
@@ -4,7 +4,7 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-FROM gcr.io/iree-oss/cmake-bazel-frontends-vulkan@sha256:de4862ad6704309bb1a7e64e14be6790d2957aea394859dad47171874cb2b221 AS final
+FROM gcr.io/iree-oss/cmake-bazel-frontends-vulkan@sha256:e99fd07a48e2b1a00200b3b600ff00878d413045cb7809fe73dac4c36fa4825a AS final
COPY --from=gcr.io/iree-oss/swiftshader@sha256:ccae32c83c89a31e8fc5542e480c29f28bbf4a3b3b80198c06b687a92c6813f3 \
/swiftshader /swiftshader
diff --git a/build_tools/docker/cmake-bazel-frontends-vulkan/Dockerfile b/build_tools/docker/cmake-bazel-frontends-vulkan/Dockerfile
index 51f5b72..03ce51d 100644
--- a/build_tools/docker/cmake-bazel-frontends-vulkan/Dockerfile
+++ b/build_tools/docker/cmake-bazel-frontends-vulkan/Dockerfile
@@ -7,7 +7,7 @@
# This image provides the Vulkan SDK. Requires a child image to provide
# a Vulkan ICD.
-FROM gcr.io/iree-oss/cmake-bazel-frontends@sha256:f8a911a4c6f8f2733f8fe9264992dcff192b01f4f5883a5cde1452fccc2fce5e AS final
+FROM gcr.io/iree-oss/cmake-bazel-frontends@sha256:8974ee20d855ecfc8b9e511f4fb4a25d67888952738d2c457d9fd91116b6b67f AS final
ARG VULKAN_SDK_VERSION=1.2.154.0
diff --git a/build_tools/docker/cmake-bazel-frontends/Dockerfile b/build_tools/docker/cmake-bazel-frontends/Dockerfile
index 3cb7b41..411ed20 100644
--- a/build_tools/docker/cmake-bazel-frontends/Dockerfile
+++ b/build_tools/docker/cmake-bazel-frontends/Dockerfile
@@ -12,7 +12,7 @@
&& tar --extract --gzip --file=google-research.tar.gz \
--wildcards */kws_streaming --strip-components=1
-FROM gcr.io/iree-oss/cmake-python@sha256:c2cb0153124bcb1d7777ae134eba3db5ba3b9701c076456235c237c209fc31fd AS final
+FROM gcr.io/iree-oss/cmake-python@sha256:24892ba1d23b8aaf6e4b9c700f524e7de1f19cff903fa6a5dc87579d97077453 AS final
# Install bazel.
COPY --from=gcr.io/iree-oss/bazel@sha256:5e52c7d43b6fdff35d884b8b8b92b1b6e2151d675019edc92f09018e558e0f94 \
diff --git a/build_tools/docker/cmake-python-nvidia/Dockerfile b/build_tools/docker/cmake-python-nvidia/Dockerfile
index 2674cfa..8716d17 100644
--- a/build_tools/docker/cmake-python-nvidia/Dockerfile
+++ b/build_tools/docker/cmake-python-nvidia/Dockerfile
@@ -36,7 +36,7 @@
# does not support Ubuntu 18.04.
# This allows to share configuration with base CMake, but it also means we need
# to MATCH the driver version between the host machine and the docker image.
-FROM gcr.io/iree-oss/cmake-python-vulkan@sha256:b1101d7c049aec0add21c94de37780657ac7f6e5b3370d16e86f06040a660582 AS final
+FROM gcr.io/iree-oss/cmake-python-vulkan@sha256:899262e823b2d73a3ca9709d2ba3be7b21a9ffe41203e72a621a61844763f6b9 AS final
ARG NVIDIA_COMMON_DEB
ARG NVIDIA_GL_DEB
ARG NVIDIA_COMPUTE_DEB
diff --git a/build_tools/docker/cmake-python-swiftshader/Dockerfile b/build_tools/docker/cmake-python-swiftshader/Dockerfile
index a5521bc..c4d444f 100644
--- a/build_tools/docker/cmake-python-swiftshader/Dockerfile
+++ b/build_tools/docker/cmake-python-swiftshader/Dockerfile
@@ -7,7 +7,7 @@
# An image for building IREE using CMake and testing IREE with SwiftShader
# Vulkan implementation.
-FROM gcr.io/iree-oss/cmake-python-vulkan@sha256:b1101d7c049aec0add21c94de37780657ac7f6e5b3370d16e86f06040a660582 AS final
+FROM gcr.io/iree-oss/cmake-python-vulkan@sha256:899262e823b2d73a3ca9709d2ba3be7b21a9ffe41203e72a621a61844763f6b9 AS final
COPY --from=gcr.io/iree-oss/swiftshader@sha256:ccae32c83c89a31e8fc5542e480c29f28bbf4a3b3b80198c06b687a92c6813f3 \
/swiftshader /swiftshader
diff --git a/build_tools/docker/cmake-python-vulkan/Dockerfile b/build_tools/docker/cmake-python-vulkan/Dockerfile
index 92ddfe9..a7ff93d 100644
--- a/build_tools/docker/cmake-python-vulkan/Dockerfile
+++ b/build_tools/docker/cmake-python-vulkan/Dockerfile
@@ -8,7 +8,7 @@
# This image provides the Vulkan SDK. Requires a child image to provide
# a Vulkan ICD.
-FROM gcr.io/iree-oss/cmake-python@sha256:c2cb0153124bcb1d7777ae134eba3db5ba3b9701c076456235c237c209fc31fd AS final
+FROM gcr.io/iree-oss/cmake-python@sha256:24892ba1d23b8aaf6e4b9c700f524e7de1f19cff903fa6a5dc87579d97077453 AS final
ARG VULKAN_SDK_VERSION=1.2.154.0
diff --git a/build_tools/docker/cmake-python/Dockerfile b/build_tools/docker/cmake-python/Dockerfile
index 11a8554..a0a1a60 100644
--- a/build_tools/docker/cmake-python/Dockerfile
+++ b/build_tools/docker/cmake-python/Dockerfile
@@ -14,6 +14,8 @@
python3-pip \
python3-setuptools \
&& python3 -m pip install --upgrade pip \
- && python3 -m pip install numpy==1.19.4 absl-py requests
+ && python3 -m pip install \
+ numpy==1.19.4 absl-py==0.12.0 requests PyYAML==5.4.1 wheel==0.36.2 \
+ pybind11==2.6.1
ENV PYTHON_BIN /usr/bin/python3
diff --git a/build_tools/docker/prod_digests.txt b/build_tools/docker/prod_digests.txt
index 89ff8d6..529372a 100644
--- a/build_tools/docker/prod_digests.txt
+++ b/build_tools/docker/prod_digests.txt
@@ -2,17 +2,17 @@
gcr.io/iree-oss/util@sha256:40846b4aea5886af3250399d6adfdb3e1195a8b0177706bb0375e812d62dc49c
gcr.io/iree-oss/cmake@sha256:9d9953acf5ca0cf1ff3e8de32f10f24dfab1c4e8ec5d1fc047f556024ee4bed6
gcr.io/iree-oss/swiftshader@sha256:ccae32c83c89a31e8fc5542e480c29f28bbf4a3b3b80198c06b687a92c6813f3
-gcr.io/iree-oss/cmake-python@sha256:c2cb0153124bcb1d7777ae134eba3db5ba3b9701c076456235c237c209fc31fd
-gcr.io/iree-oss/cmake-android@sha256:eb72a4864f30ba53868cf23caf44e60aca35a36682ed1b1a5fa37cd9fda8855c
+gcr.io/iree-oss/cmake-python@sha256:24892ba1d23b8aaf6e4b9c700f524e7de1f19cff903fa6a5dc87579d97077453
+gcr.io/iree-oss/cmake-android@sha256:a152f0d006e237105f8ed9a7e041a6a235c1a69dc1e209383c81087c574b39bf
gcr.io/iree-oss/bazel@sha256:5e52c7d43b6fdff35d884b8b8b92b1b6e2151d675019edc92f09018e558e0f94
gcr.io/iree-oss/vulkan@sha256:5812ee64806a7f3df0739ccf0930c27cabce346901488eceb1ee66c9c0a5ae96
gcr.io/iree-oss/rbe-toolchain@sha256:d69c260b98a97ad430d34c4591fb2399e00888750f5d47ede00c1e6f3e774e5a
-gcr.io/iree-oss/cmake-python-vulkan@sha256:b1101d7c049aec0add21c94de37780657ac7f6e5b3370d16e86f06040a660582
-gcr.io/iree-oss/cmake-python-swiftshader@sha256:12dacbbf207aaee3db978d793ffbf5e4165a7117256757c81b7fbe88abbc75f1
-gcr.io/iree-oss/cmake-python-nvidia@sha256:cccaa78c8c1bb7194dd70ce109a5ecbcf1069dde65fdfdb6d43c6f774a7c3d78
-gcr.io/iree-oss/cmake-bazel-frontends@sha256:f8a911a4c6f8f2733f8fe9264992dcff192b01f4f5883a5cde1452fccc2fce5e
-gcr.io/iree-oss/cmake-bazel-frontends-vulkan@sha256:de4862ad6704309bb1a7e64e14be6790d2957aea394859dad47171874cb2b221
-gcr.io/iree-oss/cmake-bazel-frontends-nvidia@sha256:e5f15252212cda1c1952c23c7d0a31aa487d4ca56236b98054fcb5cb4f59cb88
-gcr.io/iree-oss/cmake-bazel-frontends-swiftshader@sha256:2c121d7c82795ae2d47bab77b641d42f9591ffec7b3b2fc30f90bbd6cdb98018
+gcr.io/iree-oss/cmake-python-vulkan@sha256:899262e823b2d73a3ca9709d2ba3be7b21a9ffe41203e72a621a61844763f6b9
+gcr.io/iree-oss/cmake-python-swiftshader@sha256:75ad1156a486aa4bf3f93d45f9a7e0f052345fa103171dfc742f8c92d4a7ea0f
+gcr.io/iree-oss/cmake-python-nvidia@sha256:f05191ba4fa3ccc392a4a1be0b0a49ea2a9c61b397f429430b6f1a2c6d7c8f59
+gcr.io/iree-oss/cmake-bazel-frontends@sha256:8974ee20d855ecfc8b9e511f4fb4a25d67888952738d2c457d9fd91116b6b67f
+gcr.io/iree-oss/cmake-bazel-frontends-vulkan@sha256:e99fd07a48e2b1a00200b3b600ff00878d413045cb7809fe73dac4c36fa4825a
+gcr.io/iree-oss/cmake-bazel-frontends-nvidia@sha256:71eeb44ba014ee043ae2adeeb6458bc281444ee6f295b5ba7e4337a69a95f7df
+gcr.io/iree-oss/cmake-bazel-frontends-swiftshader@sha256:4e018bd74c630f89f86b700a47b6a6792c8f97e337870af69a000e578a3ca688
gcr.io/iree-oss/cmake-riscv@sha256:a09ff1e6ab65a436822894acf58ef6c4cbc523581960e918a07ddf4a46c8af95
-gcr.io/iree-oss/cmake-bazel-frontends-android@sha256:e7d1239d10a1b281893dd3db4d92eeeb8d6ba50fe314db953f6382e862051a33
+gcr.io/iree-oss/cmake-bazel-frontends-android@sha256:1392e3a27cddbdc597817168fb61e125bbdcbfd9076eff9d70bd8012b0a0c5ba
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-swiftshader/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-swiftshader/build_kokoro.sh
index e2dcc5d..37554c3 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-swiftshader/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-swiftshader/build_kokoro.sh
@@ -24,7 +24,7 @@
docker_setup
docker run "${DOCKER_RUN_ARGS[@]?}" \
- gcr.io/iree-oss/cmake-bazel-frontends-swiftshader@sha256:2c121d7c82795ae2d47bab77b641d42f9591ffec7b3b2fc30f90bbd6cdb98018 \
+ gcr.io/iree-oss/cmake-bazel-frontends-swiftshader@sha256:4e018bd74c630f89f86b700a47b6a6792c8f97e337870af69a000e578a3ca688 \
build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-swiftshader/build.sh
# Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-turing/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-turing/build_kokoro.sh
index e655ac4..513ac72 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-turing/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-turing/build_kokoro.sh
@@ -30,7 +30,7 @@
docker run "${DOCKER_RUN_ARGS[@]?}" \
--gpus all \
- gcr.io/iree-oss/cmake-bazel-frontends-nvidia@sha256:e5f15252212cda1c1952c23c7d0a31aa487d4ca56236b98054fcb5cb4f59cb88 \
+ gcr.io/iree-oss/cmake-bazel-frontends-nvidia@sha256:71eeb44ba014ee043ae2adeeb6458bc281444ee6f295b5ba7e4337a69a95f7df \
build_tools/kokoro/gcp_ubuntu/cmake-bazel/linux/x86-turing/build.sh
# Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh
index e8c7189..dba5305 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/android/arm64-v8a/build_kokoro.sh
@@ -24,7 +24,7 @@
docker_setup
docker run "${DOCKER_RUN_ARGS[@]?}" \
- gcr.io/iree-oss/cmake-android@sha256:eb72a4864f30ba53868cf23caf44e60aca35a36682ed1b1a5fa37cd9fda8855c \
+ gcr.io/iree-oss/cmake-android@sha256:a152f0d006e237105f8ed9a7e041a6a235c1a69dc1e209383c81087c574b39bf \
build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh arm64-v8a
# Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader-asan/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader-asan/build_kokoro.sh
index 2809fd5..9228bdb 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader-asan/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader-asan/build_kokoro.sh
@@ -24,7 +24,7 @@
docker_setup
docker run "${DOCKER_RUN_ARGS[@]?}" \
- gcr.io/iree-oss/cmake-python-swiftshader@sha256:12dacbbf207aaee3db978d793ffbf5e4165a7117256757c81b7fbe88abbc75f1 \
+ gcr.io/iree-oss/cmake-python-swiftshader@sha256:75ad1156a486aa4bf3f93d45f9a7e0f052345fa103171dfc742f8c92d4a7ea0f \
build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh
# Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh
index 2809fd5..9228bdb 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build_kokoro.sh
@@ -24,7 +24,7 @@
docker_setup
docker run "${DOCKER_RUN_ARGS[@]?}" \
- gcr.io/iree-oss/cmake-python-swiftshader@sha256:12dacbbf207aaee3db978d793ffbf5e4165a7117256757c81b7fbe88abbc75f1 \
+ gcr.io/iree-oss/cmake-python-swiftshader@sha256:75ad1156a486aa4bf3f93d45f9a7e0f052345fa103171dfc742f8c92d4a7ea0f \
build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-swiftshader/build.sh
# Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh
index 8b706e3..ee3ffde 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build_kokoro.sh
@@ -30,7 +30,7 @@
docker run "${DOCKER_RUN_ARGS[@]?}" \
--gpus all \
- gcr.io/iree-oss/cmake-python-nvidia@sha256:cccaa78c8c1bb7194dd70ce109a5ecbcf1069dde65fdfdb6d43c6f774a7c3d78 \
+ gcr.io/iree-oss/cmake-python-nvidia@sha256:f05191ba4fa3ccc392a4a1be0b0a49ea2a9c61b397f429430b6f1a2c6d7c8f59 \
build_tools/kokoro/gcp_ubuntu/cmake/linux/x86-turing/build.sh
# Kokoro will rsync this entire directory back to the executor orchestrating the
diff --git a/experimental/rocm/direct_command_buffer.c b/experimental/rocm/direct_command_buffer.c
index 7dca043..9d56001 100644
--- a/experimental/rocm/direct_command_buffer.c
+++ b/experimental/rocm/direct_command_buffer.c
@@ -27,7 +27,7 @@
void *current_descriptor[];
} iree_hal_rocm_direct_command_buffer_t;
-static const size_t max_binding_count = 64;
+#define IREE_HAL_ROCM_MAX_BINDING_COUNT 64
extern const iree_hal_command_buffer_vtable_t
iree_hal_rocm_direct_command_buffer_vtable;
@@ -51,8 +51,8 @@
iree_hal_rocm_direct_command_buffer_t *command_buffer = NULL;
size_t total_size = sizeof(*command_buffer) +
- max_binding_count * sizeof(void *) +
- max_binding_count * sizeof(hipDeviceptr_t);
+ IREE_HAL_ROCM_MAX_BINDING_COUNT * sizeof(void *) +
+ IREE_HAL_ROCM_MAX_BINDING_COUNT * sizeof(hipDeviceptr_t);
iree_status_t status = iree_allocator_malloc(
context->host_allocator, total_size, (void **)&command_buffer);
if (iree_status_is_ok(status)) {
@@ -64,8 +64,8 @@
command_buffer->queue_affinity = queue_affinity;
hipDeviceptr_t *device_ptrs =
(hipDeviceptr_t *)(command_buffer->current_descriptor +
- max_binding_count);
- for (size_t i = 0; i < max_binding_count; i++) {
+ IREE_HAL_ROCM_MAX_BINDING_COUNT);
+ for (size_t i = 0; i < IREE_HAL_ROCM_MAX_BINDING_COUNT; i++) {
command_buffer->current_descriptor[i] = &device_ptrs[i];
}
command_buffer->total_size = total_size;
@@ -244,6 +244,21 @@
"need rocm implementation");
}
+// Tie together the binding index and its index in |bindings| array.
+typedef struct {
+ uint32_t index;
+ uint32_t binding;
+} iree_hal_rocm_binding_mapping_t;
+
+// Helper to sort the binding based on their binding index.
+static int compare_binding_index(const void *a, const void *b) {
+ const iree_hal_rocm_binding_mapping_t buffer_a =
+ *(const iree_hal_rocm_binding_mapping_t *)a;
+ const iree_hal_rocm_binding_mapping_t buffer_b =
+ *(const iree_hal_rocm_binding_mapping_t *)b;
+ return buffer_a.binding < buffer_b.binding ? -1 : 1;
+}
+
static iree_status_t iree_hal_rocm_direct_command_buffer_push_descriptor_set(
iree_hal_command_buffer_t *base_command_buffer,
iree_hal_executable_layout_t *executable_layout, uint32_t set,
@@ -251,16 +266,27 @@
const iree_hal_descriptor_set_binding_t *bindings) {
iree_hal_rocm_direct_command_buffer_t *command_buffer =
iree_hal_rocm_direct_command_buffer_cast(base_command_buffer);
+ // Convention with the compiler side. We map bindings to kernel argument.
+ // We compact the bindings to get a dense set of arguments and keep them order
+ // based on the binding index.
+ // Sort the binding based on the binding index and map the array index to the
+ // argument index.
+ iree_hal_rocm_binding_mapping_t binding_used[IREE_HAL_ROCM_MAX_BINDING_COUNT];
for (iree_host_size_t i = 0; i < binding_count; i++) {
- uint32_t arg_index = bindings[i].binding;
- assert(arg_index < max_binding_count &&
- "binding index larger than the max expected.");
+ iree_hal_rocm_binding_mapping_t buffer = {i, bindings[i].binding};
+ binding_used[i] = buffer;
+ }
+ qsort(binding_used, binding_count, sizeof(iree_hal_rocm_binding_mapping_t),
+ compare_binding_index);
+ assert(binding_count < IREE_HAL_ROCM_MAX_BINDING_COUNT &&
+ "binding count larger than the max expected.");
+ for (iree_host_size_t i = 0; i < binding_count; i++) {
+ iree_hal_descriptor_set_binding_t binding = bindings[binding_used[i].index];
hipDeviceptr_t device_ptr =
iree_hal_rocm_buffer_device_pointer(
- iree_hal_buffer_allocated_buffer(bindings[i].buffer)) +
- iree_hal_buffer_byte_offset(bindings[i].buffer) + bindings[i].offset;
- *((hipDeviceptr_t *)command_buffer->current_descriptor[arg_index]) =
- device_ptr;
+ iree_hal_buffer_allocated_buffer(binding.buffer)) +
+ iree_hal_buffer_byte_offset(binding.buffer) + binding.offset;
+ *((hipDeviceptr_t *)command_buffer->current_descriptor[i]) = device_ptr;
}
return iree_ok_status();
}
diff --git a/iree/compiler/Conversion/HLOToLinalg/BUILD b/iree/compiler/Conversion/HLOToLinalg/BUILD
index 7a4a159..49c178d 100644
--- a/iree/compiler/Conversion/HLOToLinalg/BUILD
+++ b/iree/compiler/Conversion/HLOToLinalg/BUILD
@@ -28,6 +28,7 @@
"//iree/compiler/Dialect/IREE/IR",
"//iree/compiler/Dialect/Shape/IR",
"@llvm-project//mlir:Affine",
+ "@llvm-project//mlir:ComplexDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LinalgOps",
"@llvm-project//mlir:LinalgTransforms",
diff --git a/iree/compiler/Conversion/HLOToLinalg/CMakeLists.txt b/iree/compiler/Conversion/HLOToLinalg/CMakeLists.txt
index ac7e004..82eb17f 100644
--- a/iree/compiler/Conversion/HLOToLinalg/CMakeLists.txt
+++ b/iree/compiler/Conversion/HLOToLinalg/CMakeLists.txt
@@ -21,6 +21,7 @@
"ResolveShapeOps.cpp"
DEPS
MLIRAffine
+ MLIRComplex
MLIRIR
MLIRLinalg
MLIRLinalgTransforms
diff --git a/iree/compiler/Conversion/HLOToLinalg/HLOToLinalgOnTensors.cpp b/iree/compiler/Conversion/HLOToLinalg/HLOToLinalgOnTensors.cpp
index d834cae..fea3d1a 100644
--- a/iree/compiler/Conversion/HLOToLinalg/HLOToLinalgOnTensors.cpp
+++ b/iree/compiler/Conversion/HLOToLinalg/HLOToLinalgOnTensors.cpp
@@ -23,6 +23,7 @@
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h"
#include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h"
#include "mlir-hlo/Dialect/mhlo/transforms/rewriters.h"
+#include "mlir/Dialect/Complex/IR/Complex.h"
#include "mlir/Dialect/Linalg/IR/LinalgOps.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
@@ -213,7 +214,7 @@
void getDependentDialects(DialectRegistry ®istry) const override {
registry.insert<IREE::Flow::FlowDialect, linalg::LinalgDialect,
mhlo::MhloDialect, ShapeDialect, math::MathDialect,
- memref::MemRefDialect>();
+ memref::MemRefDialect, complex::ComplexDialect>();
}
void runOnOperation() override {