Skip to content

Commit

Permalink
Enable TOSA conversions in bazel build rules (#4023)
Browse files Browse the repository at this point in the history
Follows #4021.

Also pushes a small pre-commit fix.

Bazel CI triggered here:
https://github.com/sjain-stanford/torch-mlir/actions/runs/13297425038/job/37132415527
  • Loading branch information
sjain-stanford authored Feb 13, 2025
1 parent aa74936 commit 7b8d0bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build_tools/autogen_ltc_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
try:
from yaml import CSafeLoader as Loader
except ImportError:
from yaml import SafeLoader as Loader #type:ignore[assignment, misc]
from yaml import SafeLoader as Loader # type:ignore[assignment, misc]


def reindent(text, prefix=""):
return indent(dedent(text), prefix)
Expand Down
8 changes: 8 additions & 0 deletions utils/bazel/torch-mlir-overlay/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ gentbl_cc_library(
[
"-gen-pass-decls",
"-DTORCH_MLIR_ENABLE_STABLEHLO",
"-DTORCH_MLIR_ENABLE_TOSA",
],
"include/torch-mlir/Conversion/Passes.h.inc",
),
Expand Down Expand Up @@ -334,6 +335,7 @@ gentbl_cc_library(
[
"-gen-pass-decls",
"-DTORCH_MLIR_ENABLE_STABLEHLO",
"-DTORCH_MLIR_ENABLE_TOSA",
],
"include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h.inc",
),
Expand Down Expand Up @@ -542,6 +544,7 @@ cc_library(
],
defines = [
"TORCH_MLIR_ENABLE_STABLEHLO",
"TORCH_MLIR_ENABLE_TOSA",
],
strip_include_prefix = "include",
deps = [
Expand All @@ -566,6 +569,7 @@ cc_library(
hdrs = glob(["include/torch-mlir/Dialect/TorchConversion/Transforms/*.h"]),
defines = [
"TORCH_MLIR_ENABLE_STABLEHLO",
"TORCH_MLIR_ENABLE_TOSA",
],
strip_include_prefix = "include",
deps = [
Expand Down Expand Up @@ -600,6 +604,9 @@ cc_library(
"lib/Conversion/TorchToTosa/*.cpp",
]),
hdrs = glob(["include/torch-mlir/Conversion/TorchToTosa/*.h"]),
defines = [
"TORCH_MLIR_ENABLE_TOSA",
],
strip_include_prefix = "include",
deps = [
":TorchMLIRConversionPassesIncGen",
Expand Down Expand Up @@ -887,6 +894,7 @@ cc_library(
copts = [
"-DTORCH_MLIR_ENABLE_REFBACKEND",
"-DTORCH_MLIR_ENABLE_STABLEHLO",
"-DTORCH_MLIR_ENABLE_TOSA",
],
strip_include_prefix = "include",
deps = [
Expand Down

0 comments on commit 7b8d0bd

Please sign in to comment.