rocm_jax/jaxlib/mlir/BUILD.bazel
2023-03-13 18:38:26 +00:00

159 lines
3.3 KiB
Python

# Copyright 2021 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("//jaxlib:symlink_files.bzl", "symlink_inputs")
package(
default_visibility = [
"//visibility:public",
],
)
symlink_inputs(
name = "core",
rule = py_library,
symlinked_inputs = {"srcs": {
"dialects": ["@llvm-project//mlir/python:DialectCorePyFiles"],
}},
)
symlink_inputs(
name = "ir",
rule = py_library,
symlinked_inputs = {"srcs": {
".": [
"@llvm-project//mlir/python:IRPyFiles",
],
}},
deps = [
":mlir",
],
)
py_library(
name = "mlir",
deps = [
"//jaxlib/mlir/_mlir_libs",
],
)
symlink_inputs(
name = "func_dialect",
rule = py_library,
symlinked_inputs = {"srcs": {"dialects": [
"@llvm-project//mlir/python:FuncPyFiles",
]}},
deps = [
":core",
":ir",
":mlir",
],
)
symlink_inputs(
name = "ml_program_dialect",
rule = py_library,
symlinked_inputs = {"srcs": {"dialects": [
"@llvm-project//mlir/python:MLProgramOpsPyFiles",
]}},
deps = [
":core",
":ir",
":mlir",
],
)
symlink_inputs(
name = "builtin_dialect",
rule = py_library,
symlinked_inputs = {"srcs": {"dialects": [
"@llvm-project//mlir/python:BuiltinOpsPyFiles",
]}},
deps = [
":core",
":ir",
":mlir",
],
)
symlink_inputs(
name = "chlo_dialect",
rule = py_library,
symlinked_inputs = {"srcs": {"dialects": [
"@stablehlo//:chlo_ops_py_files",
]}},
deps = [
":core",
":ir",
":mlir",
"//jaxlib/mlir/_mlir_libs:_chlo",
],
)
symlink_inputs(
name = "sparse_tensor_dialect",
rule = py_library,
symlinked_inputs = {"srcs": {"dialects": [
"@llvm-project//mlir/python:SparseTensorOpsPyFiles",
]}},
deps = [
":core",
":ir",
":mlir",
"//jaxlib/mlir/_mlir_libs:_mlirDialectsSparseTensor",
"//jaxlib/mlir/_mlir_libs:_mlirSparseTensorPasses",
],
)
symlink_inputs(
name = "mhlo_dialect",
rule = py_library,
symlinked_inputs = {"srcs": {"dialects": [
"@xla//xla/mlir_hlo:MhloOpsPyFiles",
]}},
deps = [
":core",
":ir",
":mlir",
"//jaxlib/mlir/_mlir_libs:_mlirHlo",
],
)
symlink_inputs(
name = "pass_manager",
rule = py_library,
symlinked_inputs = {"srcs": {
".": [
"@llvm-project//mlir/python:PassManagerPyFiles",
],
}},
deps = [
":mlir",
],
)
symlink_inputs(
name = "stablehlo_dialect",
rule = py_library,
symlinked_inputs = {"srcs": {"dialects": [
"@stablehlo//:stablehlo_ops_py_files",
]}},
deps = [
":core",
":ir",
":mlir",
"//jaxlib/mlir/_mlir_libs:_stablehlo",
],
)