Enable XLA MLIR GPU lit tests for open source.
PiperOrigin-RevId: 307342297 Change-Id: Ie2a577c701bdeda644a5ff1404e23bbfbb02decd
This commit is contained in:
parent
fcb485f663
commit
b53fc48adb
tensorflow/compiler
@ -26,7 +26,7 @@ _ALWAYS_EXCLUDE = [
|
||||
"**/* */**",
|
||||
]
|
||||
|
||||
def _run_lit_test(name, data, size, tags, driver, features):
|
||||
def _run_lit_test(name, data, size, tags, driver, features, exec_properties):
|
||||
"""Runs lit on all tests it can find in `data` under tensorflow/compiler/mlir.
|
||||
|
||||
Note that, due to Bazel's hermetic builds, lit only sees the tests that
|
||||
@ -64,6 +64,7 @@ def _run_lit_test(name, data, size, tags, driver, features):
|
||||
],
|
||||
size = size,
|
||||
main = "lit.py",
|
||||
exec_properties = exec_properties,
|
||||
)
|
||||
|
||||
def glob_lit_tests(
|
||||
@ -76,7 +77,8 @@ def glob_lit_tests(
|
||||
default_tags = _default_tags,
|
||||
tags_override = {},
|
||||
driver = _default_driver,
|
||||
features = []):
|
||||
features = [],
|
||||
exec_properties = {}):
|
||||
"""Creates all plausible Lit tests (and their inputs) under this directory.
|
||||
|
||||
Args:
|
||||
@ -92,6 +94,7 @@ def glob_lit_tests(
|
||||
Note: use of a custom driver is not currently supported
|
||||
and specifying a default driver will abort the tests.
|
||||
features: [str], list of extra features to enable.
|
||||
exec_properties: a dictionary of properties to pass on.
|
||||
"""
|
||||
|
||||
# Ignore some patterns by default for tests and input data.
|
||||
@ -115,6 +118,7 @@ def glob_lit_tests(
|
||||
tags = default_tags + tags_override.pop(curr_test, []),
|
||||
driver = driver,
|
||||
features = features,
|
||||
exec_properties = exec_properties,
|
||||
)
|
||||
|
||||
def lit_test(
|
||||
@ -123,7 +127,8 @@ def lit_test(
|
||||
size = _default_size,
|
||||
tags = _default_tags,
|
||||
driver = _default_driver,
|
||||
features = []):
|
||||
features = [],
|
||||
exec_properties = {}):
|
||||
"""Runs test files under lit.
|
||||
|
||||
Args:
|
||||
@ -136,4 +141,4 @@ def lit_test(
|
||||
and specifying a default driver will abort the tests.
|
||||
features: [str], list of extra features to enable.
|
||||
"""
|
||||
_run_lit_test(name + ".test", data + [name], size, tags, driver, features)
|
||||
_run_lit_test(name + ".test", data + [name], size, tags, driver, features, exec_properties)
|
||||
|
@ -1,6 +1,7 @@
|
||||
load(
|
||||
"//tensorflow/core/platform:build_config_root.bzl",
|
||||
"tf_cuda_tests_tags",
|
||||
"tf_exec_properties",
|
||||
)
|
||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
|
||||
|
||||
@ -18,9 +19,7 @@ package_group(
|
||||
|
||||
glob_lit_tests(
|
||||
data = [":test_utilities"],
|
||||
# TODO(141337082): Figure out why the tests do not run successfully in open
|
||||
# source.
|
||||
default_tags = ["no_oss"] + tf_cuda_tests_tags(),
|
||||
default_tags = tf_cuda_tests_tags() + ["config-cuda-only"],
|
||||
driver = "@llvm-project//mlir:run_lit.sh",
|
||||
exclude = [
|
||||
# TODO(b/149302060) Reenable once fusion is fixed.
|
||||
@ -28,6 +27,7 @@ glob_lit_tests(
|
||||
# TODO(b/137624192): Reenable once we can fuse reductions.
|
||||
"fused_reduce.hlo",
|
||||
],
|
||||
exec_properties = tf_exec_properties({"tags": tf_cuda_tests_tags()}),
|
||||
test_file_exts = ["hlo"],
|
||||
)
|
||||
|
||||
|
@ -80,8 +80,7 @@ int main(int argc, char **argv) {
|
||||
: opt.CompileAndOutputIr(file->getBuffer().str(),
|
||||
output->os(), lowering_stage);
|
||||
if (!status.ok()) {
|
||||
output->os() << status.error_message();
|
||||
output->keep();
|
||||
LOG(ERROR) << status.error_message();
|
||||
return 1;
|
||||
}
|
||||
output->keep();
|
||||
|
Loading…
Reference in New Issue
Block a user