Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Implement async compiler plugin #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ set(IREE_PACKAGE_ROOT_PREFIX "")
set(IREE_COMPILER_TABLEGEN_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")

add_subdirectory(openxla/compiler/nvgpu)
add_subdirectory(openxla/compiler/async)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move it under nvgpu folder (and namespace openxla::compiler::nvgpu::async), it's not quite accurate, but it will get it covered by CI jobs, and we'll find a better place later

38 changes: 38 additions & 0 deletions compiler/src/openxla/compiler/async/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2023 The OpenXLA Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("@iree_core//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_register_plugin")

package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)

cc_library(
name = "defs",
includes = ["../../.."],
)

cc_library(
name = "registration",
srcs = [
"PluginRegistration.cpp",
],
deps = [
":defs",
"//compiler/src/openxla/compiler/async/Dialect/Async/IR",
"//compiler/src/openxla/compiler/async/Dialect/Async/Transforms",
"@iree_core//compiler/src/iree/compiler/PluginAPI",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
],
)

iree_compiler_register_plugin(
plugin_id = "openxla_async",
target = ":registration",
)
44 changes: 44 additions & 0 deletions compiler/src/openxla/compiler/async/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
################################################################################
# Autogenerated by ../iree/build_tools/bazel_to_cmake/bazel_to_cmake.py from #
# compiler/src/openxla/compiler/async/BUILD.bazel #
# #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary #
# CMake-only content. #
# #
# To disable autogeneration for this file entirely, delete this header. #
################################################################################

iree_add_all_subdirs()

iree_cc_library(
NAME
defs
INCLUDES
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../..>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../../..>"
PUBLIC
)

iree_cc_library(
NAME
registration
SRCS
"PluginRegistration.cpp"
DEPS
::defs
MLIRIR
MLIRPass
iree::compiler::PluginAPI
openxla::compiler::async::Dialect::Async::IR
openxla::compiler::async::Dialect::Async::Transforms
PUBLIC
)

iree_compiler_register_plugin(
PLUGIN_ID
openxla_async
TARGET
::registration
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
11 changes: 11 additions & 0 deletions compiler/src/openxla/compiler/async/Dialect/Async/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2023 The OpenXLA Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)
13 changes: 13 additions & 0 deletions compiler/src/openxla/compiler/async/Dialect/Async/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
################################################################################
# Autogenerated by ../iree/build_tools/bazel_to_cmake/bazel_to_cmake.py from #
# compiler/src/openxla/compiler/async/Dialect/Async/BUILD.bazel #
# #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary #
# CMake-only content. #
# #
# To disable autogeneration for this file entirely, delete this header. #
################################################################################

iree_add_all_subdirs()

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2023 The OpenXLA Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library")

package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)

cc_library(
name = "AsyncToRuntime",
srcs = ["ConvertAsyncToRuntime.cpp"],
hdrs = ["ConvertAsyncToRuntime.h"],
deps = [
"//compiler/src/openxla/compiler/async/Dialect/Async/IR",
"@iree_core//compiler/src/iree/compiler/Dialect/Util/IR",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Transforms",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
################################################################################
# Autogenerated by ../iree/build_tools/bazel_to_cmake/bazel_to_cmake.py from #
# compiler/src/openxla/compiler/async/Dialect/Async/Conversion/BUILD.bazel #
# #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary #
# CMake-only content. #
# #
# To disable autogeneration for this file entirely, delete this header. #
################################################################################

iree_add_all_subdirs()

iree_cc_library(
NAME
AsyncToRuntime
HDRS
"ConvertAsyncToRuntime.h"
SRCS
"ConvertAsyncToRuntime.cpp"
DEPS
LLVMSupport
MLIRFuncDialect
MLIRIR
MLIRPass
MLIRTransforms
iree::compiler::Dialect::Util::IR
openxla::compiler::async::Dialect::Async::IR
PUBLIC
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
Loading