-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable compilation tests for microbenchmarks (#8904)
This creates a microbenchmark suite and the adds the compilation to CI bots.
- Loading branch information
Showing
9 changed files
with
170 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright 2022 The IREE 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 | ||
|
||
# iree_microbenchmark_suite() | ||
# | ||
# Generates microbenchmark suites for MLIR input modules. | ||
# Parameters: | ||
# NAME: Name of target. | ||
# SRCS: Source files to compile into a bytecode module (list of strings). | ||
# FLAGS: Flags to pass to the translation tool (list of strings). | ||
|
||
function(iree_microbenchmark_suite) | ||
if(NOT IREE_BUILD_MICROBENCHMARKS) | ||
return() | ||
endif() | ||
|
||
cmake_parse_arguments( | ||
_RULE | ||
"" | ||
"NAME" | ||
"SRCS;FLAGS" | ||
${ARGN} | ||
) | ||
|
||
iree_package_name(PACKAGE_NAME) | ||
|
||
foreach(_SRC IN LISTS _RULE_SRCS) | ||
set(_TRANSLATE_TOOL "iree-compile") | ||
set(_TRANSLATE_SRC "${_SRC}") | ||
set(_MODULE_FILE_NAME "${_RULE_NAME}_${_SRC}.vmfb") | ||
set(_TARGET_NAME "${PACKAGE_NAME}_${_MODULE_FILE_NAME}") | ||
iree_get_executable_path(_TRANSLATE_TOOL_EXECUTABLE "${_TRANSLATE_TOOL}") | ||
set(_ARGS "${_RULE_FLAGS}") | ||
get_filename_component(_TRANSLATE_SRC_PATH "${_TRANSLATE_SRC}" REALPATH) | ||
list(APPEND _ARGS "${_TRANSLATE_SRC_PATH}") | ||
list(APPEND _ARGS "-o") | ||
list(APPEND _ARGS "${_MODULE_FILE_NAME}") | ||
|
||
add_custom_command( | ||
OUTPUT | ||
"${_MODULE_FILE_NAME}" | ||
COMMAND | ||
"${_TRANSLATE_TOOL_EXECUTABLE}" | ||
${_ARGS} | ||
# Changes to either the translation tool or the input source should | ||
# trigger rebuilding. | ||
DEPENDS | ||
"${_TRANSLATE_TOOL_EXECUTABLE}" | ||
"${_TRANSLATE_SRC}" | ||
VERBATIM | ||
) | ||
add_custom_target("${_TARGET_NAME}" | ||
DEPENDS | ||
"${_MODULE_FILE_NAME}" | ||
) | ||
add_dependencies(iree-microbenchmark-suites "${_TARGET_NAME}") | ||
endforeach(_SRC IN LISTS _SRCS) | ||
endfunction(iree_microbenchmark_suite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
################################################################################ | ||
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # | ||
# iree/test/microbenchmarks/BUILD # | ||
# # | ||
# 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. # | ||
################################################################################ | ||
### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### | ||
|
||
iree_add_all_subdirs() | ||
|
||
iree_lit_test_suite( | ||
iree_microbenchmark_suite( | ||
NAME | ||
lit | ||
"microbenchmark" | ||
SRCS | ||
"linalg_mmt4d.mlir" | ||
"linalg_transpose.mlir" | ||
TOOLS | ||
iree::tools::iree-run-mlir | ||
LABELS | ||
"hostonly" | ||
"mhlo_conv.mlir" | ||
"mhlo_dot.mlir" | ||
"mhlo_dot_general.mlir" | ||
"mhlo_fft_abs.mlir" | ||
FLAGS | ||
"--iree-hal-target-backends=dylib-llvm-aot" | ||
"--iree-input-type=mhlo" | ||
"--iree-llvm-target-cpu-features=host" | ||
) | ||
|
||
### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.