[bazel] fix bazel with stablehlo refbackend and fix some typo (#2911)

pull/2912/head
Yuanqiang Liu 2024-02-16 01:38:13 +08:00 committed by GitHub
parent f3e8199a6d
commit 5733c84443
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -25,7 +25,7 @@ STABLEHLO_TO_LINALG_FUNC_PIPELINE = ",".join([
class LinalgOnTensorsStablehloBackend(StablehloBackend):
"""Main entry-point for the linalg-on-tensors based TOSA backend.
"""Main entry-point for the linalg-on-tensors based Stablehlo backend.
This currently uses the linalg-on-tensors RefBackend for actual execution.
"""
@ -35,11 +35,10 @@ class LinalgOnTensorsStablehloBackend(StablehloBackend):
self.refbackend = RefBackendLinalgOnTensorsBackend()
def compile(self, imported_module: Module):
"""Compiles an imported module that satisfied the TOSA backend contract.
"""Compiles an imported module that satisfied the Stablehlo backend contract.
Args:
imported_module: The MLIR module consisting of funcs in the TOSA
dialect.
imported_module: The MLIR module consisting of funcs in the Stablehlo dialect.
Returns:
An opaque, backend specific compiled artifact object that can be
passed to `load`.

View File

@ -867,7 +867,10 @@ cc_library(
hdrs = [
"include/torch-mlir/InitAll.h",
],
copts = ["-DTORCH_MLIR_ENABLE_REFBACKEND"],
copts = [
"-DTORCH_MLIR_ENABLE_REFBACKEND",
"-DTORCH_MLIR_ENABLE_STABLEHLO",
],
strip_include_prefix = "include",
deps = [
":TorchMLIRConversionPasses",
@ -882,6 +885,8 @@ cc_library(
"@llvm-project//mlir:Dialect",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:IR",
"@stablehlo//:stablehlo_passes",
"@stablehlo//:linalg_passes",
],
)