From 3bed35c0ee5ed3cef4ccc00264051dea5b2983a3 Mon Sep 17 00:00:00 2001 From: "Ahmed S. Taei" Date: Fri, 24 Feb 2023 15:07:34 -0800 Subject: [PATCH] [Bazel] Fix clang version, missing mhlo deps and add reqs files (#1898) * Fix clang version, missing mhlo deps and add reqs files --- utils/bazel/docker/Dockerfile | 6 ++++-- utils/bazel/torch-mlir-overlay/BUILD.bazel | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/bazel/docker/Dockerfile b/utils/bazel/docker/Dockerfile index 2382b6100..7f78226b4 100644 --- a/utils/bazel/docker/Dockerfile +++ b/utils/bazel/docker/Dockerfile @@ -13,12 +13,12 @@ RUN apt-get update && \ unzip # Install clang -ARG REPO_NAME="deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" +ARG REPO_NAME="deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" RUN echo $REPO_NAME >> /etc/apt/sources.list.d/llvm.list && \ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ apt-get update && \ apt-get install -y \ - clang + clang-16 # Install bazel ARG ARCH="x86_64" @@ -29,6 +29,8 @@ RUN wget -q https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSIO # Install torch-mlir requirements COPY requirements.txt /opt/app/requirements.txt COPY build-requirements.txt /opt/app/build-requirements.txt +COPY test-requirements.txt /opt/app/test-requirements.txt +COPY torchvision-requirements.txt /opt/app/torchvision-requirements.txt COPY pytorch-requirements.txt /opt/app/pytorch-requirements.txt WORKDIR /opt/app RUN python3 -m pip install --upgrade pip diff --git a/utils/bazel/torch-mlir-overlay/BUILD.bazel b/utils/bazel/torch-mlir-overlay/BUILD.bazel index d284e27b4..ec4d1cb90 100644 --- a/utils/bazel/torch-mlir-overlay/BUILD.bazel +++ b/utils/bazel/torch-mlir-overlay/BUILD.bazel @@ -449,6 +449,7 @@ cc_library( ":TorchMLIRTorchConversionDialect", "@llvm-project//mlir:Dialect", "@mlir-hlo//:mlir_hlo", + "@mlir-hlo//:transforms_passes", ], ) @@ -460,6 +461,9 @@ cc_library( hdrs = [ "include/torch-mlir/Conversion/Passes.h", ], + defines = [ + "TORCH_MLIR_ENABLE_STABLEHLO", + ], strip_include_prefix = "include", deps = [ ":TorchMLIRTorchConversionToMLProgram",