Add bazel targets for TorchOnnxToTorch conversion passes (#2596)

Adapts to the TorchOnnxToTorch changes from
https://github.com/llvm/torch-mlir/pull/2585.
Also restores bazel builds in post-merge CI that was disabled in
2148c4cd0d.

Bazel workflow:
https://github.com/sjain-stanford/torch-mlir/actions/runs/7023912962
pull/2597/head
Sambhav Jain 2023-11-28 13:06:35 -08:00 committed by GitHub
parent dc9ea08db5
commit 49fdc1a8a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 3 deletions

View File

@ -1,9 +1,8 @@
name: Bazel Build and Test
on:
# TODO: Fix bazel build after US holidays of 2023-Nov-23 and re-enable.
# push:
# branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
# Ensure that only a single job or workflow using the same

View File

@ -282,6 +282,31 @@ gentbl_cc_library(
],
)
td_library(
name = "TorchMLIRConversionTorchOnnxToTorchPassTdFiles",
srcs = [
"include/torch-mlir/Conversion/TorchOnnxToTorch/Passes.td",
],
includes = ["include"],
)
gentbl_cc_library(
name = "TorchMLIRConversionTorchOnnxToTorchPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-pass-decls"],
"include/torch-mlir/Conversion/TorchOnnxToTorch/Passes.h.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/Conversion/TorchOnnxToTorch/Passes.td",
deps = [
":TorchMLIRConversionTorchOnnxToTorchPassTdFiles",
"@llvm-project//mlir:PassBaseTdFiles",
],
)
# TorchConversion transforms
td_library(
name = "TorchMLIRTorchConversionPassesTdFiles",
@ -454,6 +479,22 @@ cc_library(
],
)
cc_library(
name = "TorchMLIRTorchOnnxToTorch",
srcs = glob([
"lib/Conversion/TorchOnnxToTorch/*.h",
"lib/Conversion/TorchOnnxToTorch/*.cpp",
]),
hdrs = glob(["include/torch-mlir/Conversion/TorchOnnxToTorch/*.h"]),
strip_include_prefix = "include",
deps = [
":TorchMLIRConversionTorchOnnxToTorchPassIncGen",
":TorchMLIRTorchDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
],
)
cc_library(
name = "TorchMLIRConversionPasses",
srcs = [
@ -468,6 +509,7 @@ cc_library(
strip_include_prefix = "include",
deps = [
":TorchMLIRTorchConversionToMLProgram",
":TorchMLIRTorchOnnxToTorch",
":TorchMLIRTorchToArith",
":TorchMLIRTorchToLinalg",
":TorchMLIRTorchToSCF",