mirror of https://github.com/llvm/torch-mlir
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
parent
dc9ea08db5
commit
49fdc1a8a6
|
@ -1,9 +1,8 @@
|
||||||
name: Bazel Build and Test
|
name: Bazel Build and Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# TODO: Fix bazel build after US holidays of 2023-Nov-23 and re-enable.
|
push:
|
||||||
# push:
|
branches: [ main ]
|
||||||
# branches: [ main ]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# Ensure that only a single job or workflow using the same
|
# Ensure that only a single job or workflow using the same
|
||||||
|
|
|
@ -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
|
# TorchConversion transforms
|
||||||
td_library(
|
td_library(
|
||||||
name = "TorchMLIRTorchConversionPassesTdFiles",
|
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(
|
cc_library(
|
||||||
name = "TorchMLIRConversionPasses",
|
name = "TorchMLIRConversionPasses",
|
||||||
srcs = [
|
srcs = [
|
||||||
|
@ -468,6 +509,7 @@ cc_library(
|
||||||
strip_include_prefix = "include",
|
strip_include_prefix = "include",
|
||||||
deps = [
|
deps = [
|
||||||
":TorchMLIRTorchConversionToMLProgram",
|
":TorchMLIRTorchConversionToMLProgram",
|
||||||
|
":TorchMLIRTorchOnnxToTorch",
|
||||||
":TorchMLIRTorchToArith",
|
":TorchMLIRTorchToArith",
|
||||||
":TorchMLIRTorchToLinalg",
|
":TorchMLIRTorchToLinalg",
|
||||||
":TorchMLIRTorchToSCF",
|
":TorchMLIRTorchToSCF",
|
||||||
|
|
Loading…
Reference in New Issue