From c7d7d7f00494b588c31ac617e91354b12709009d Mon Sep 17 00:00:00 2001 From: Sambhav Jain Date: Wed, 31 Jan 2024 22:07:06 -0800 Subject: [PATCH] [Bazel] Add TorchToTensor dep to TorchMLIRTorchConversionPasses (#2847) Fixes bazel build error: ``` ERROR: /root/.cache/bazel/_bazel_root/b89349c08f7224396763d14fe35cba11/external/torch-mlir/BUILD.bazel:547:11: Compiling lib/Dialect/TorchConversion/Transforms/Passes.cpp failed: (Exit 1): clang failed: error executing command /usr/lib/llvm-16/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer ... (remaining 224 arguments skipped) Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging external/torch-mlir/lib/Dialect/TorchConversion/Transforms/Passes.cpp:23:10: fatal error: 'torch-mlir/Conversion/TorchToTensor/TorchToTensor.h' file not found #include "torch-mlir/Conversion/TorchToTensor/TorchToTensor.h" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Target @torch-mlir//:torch-mlir-opt failed to build ``` Bazel CI: https://github.com/sjain-stanford/torch-mlir/actions/runs/7735724133/job/21091865352 --- utils/bazel/torch-mlir-overlay/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/bazel/torch-mlir-overlay/BUILD.bazel b/utils/bazel/torch-mlir-overlay/BUILD.bazel index 493383cf9..c37023c5e 100644 --- a/utils/bazel/torch-mlir-overlay/BUILD.bazel +++ b/utils/bazel/torch-mlir-overlay/BUILD.bazel @@ -564,6 +564,7 @@ cc_library( ":TorchMLIRTorchToSCF", ":TorchMLIRTorchToStablehlo", ":TorchMLIRTorchToTMTensor", + ":TorchMLIRTorchToTensor", ":TorchMLIRTorchToTosa", "@llvm-project//mlir:ConversionPasses", "@llvm-project//mlir:FuncDialect",