Harden how ConstEval uses llvm-cpu and the runtime libraries. (#17075)
* Fixed https://github.com/openxla/iree/issues/17070 by updating the
CMake options needed for ConstEval
* Replaced `IREE_CHECK_OK` usage with error handling
* Refactored `test/jit_globals.mlir`, adding coverage for llvm-cpu
(since that is actually running by default)
* I tried to keep all test cases in one file, but `--verify-diagnostics`
isn't compatible with that style of lit testing AFAICT
* This uncovered some bugs in https://github.com/openxla/iree/pull/16321
/ missing support for i4 types
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c099e17..93e5bae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -329,9 +329,11 @@
option(IREE_HAL_EXECUTABLE_PLUGIN_SYSTEM_LIBRARY "Enables the system dynamic library plugin mechanism for local HAL drivers" ${IREE_HAL_EXECUTABLE_PLUGIN_SYSTEM_LIBRARY_DEFAULT})
if(IREE_BUILD_COMPILER)
- # The compiler requires the local task driver with the VMVX loader.
+ # The compiler minimally requires the local task driver with the default
+ # (embedded elf) executable loader. This is used by the ConstEval component,
+ # which can also be used with VMVX or other loaders/devices. See issue#17070.
set(IREE_HAL_DRIVER_LOCAL_TASK ON)
- set(IREE_HAL_EXECUTABLE_LOADER_VMVX_MODULE ON)
+ set(IREE_HAL_EXECUTABLE_LOADER_EMBEDDED_ELF ON)
endif()
message(STATUS "IREE HAL drivers:")
diff --git a/compiler/src/iree/compiler/ConstEval/BUILD.bazel b/compiler/src/iree/compiler/ConstEval/BUILD.bazel
index 53a9967..5bc28d3 100644
--- a/compiler/src/iree/compiler/ConstEval/BUILD.bazel
+++ b/compiler/src/iree/compiler/ConstEval/BUILD.bazel
@@ -78,6 +78,7 @@
deps = [
"//compiler/src/iree/compiler/Dialect/Util/IR",
"//compiler/src/iree/compiler/Dialect/VM/Target/Bytecode",
+ "//runtime/src/iree/base",
"//runtime/src/iree/hal",
"//runtime/src/iree/hal/drivers/local_task/registration",
"//runtime/src/iree/modules/hal",
diff --git a/compiler/src/iree/compiler/ConstEval/CMakeLists.txt b/compiler/src/iree/compiler/ConstEval/CMakeLists.txt
index 051e15c..4492119 100644
--- a/compiler/src/iree/compiler/ConstEval/CMakeLists.txt
+++ b/compiler/src/iree/compiler/ConstEval/CMakeLists.txt
@@ -68,6 +68,7 @@
DEPS
LLVMSupport
MLIRIR
+ iree::base
iree::compiler::Dialect::Util::IR
iree::compiler::Dialect::VM::Target::Bytecode
iree::hal
diff --git a/compiler/src/iree/compiler/ConstEval/JitGlobals.cpp b/compiler/src/iree/compiler/ConstEval/JitGlobals.cpp
index f512a36..9df3295 100644
--- a/compiler/src/iree/compiler/ConstEval/JitGlobals.cpp
+++ b/compiler/src/iree/compiler/ConstEval/JitGlobals.cpp
@@ -603,12 +603,6 @@
SupportedFeatures s;
Builder b(context);
- // Exclude vmvx backend since there is no i4 support there causing
- // the `eval_i4_tensor` test in `jit_globals.mlir` to fail.
- // TODO(#16321): Enable on other backends once this has been tested
- // outside llvm-cpu.
- if (requestedTargetDevice == "llvm-cpu" && hasRequestedTargetDevice)
- s.addScalarType(b.getIntegerType(4));
s.addScalarType(b.getIntegerType(8));
s.addScalarType(b.getIntegerType(16));
s.addScalarType(b.getIntegerType(32));
@@ -617,10 +611,6 @@
s.addElementType(b.getIntegerType(1));
- // TODO(#16321): Enable on other backends once this has been tested outside
- // llvm-cpu.
- if (requestedTargetDevice == "llvm-cpu" && hasRequestedTargetDevice)
- s.addElementType(b.getIntegerType(4));
s.addElementType(b.getIntegerType(8));
s.addElementType(b.getIntegerType(16));
s.addElementType(b.getIntegerType(32));
@@ -655,6 +645,8 @@
FunctionCall call(binary, jitFunction.argumentBindings.size(),
jitFunction.resultBindings.size());
+ if (failed(call.initialize(jitFunction.loc)))
+ return failure();
// Convert arguments.
for (ArgumentBinding &arg : jitFunction.argumentBindings) {
diff --git a/compiler/src/iree/compiler/ConstEval/Runtime.cpp b/compiler/src/iree/compiler/ConstEval/Runtime.cpp
index c5a93cf..988ad60 100644
--- a/compiler/src/iree/compiler/ConstEval/Runtime.cpp
+++ b/compiler/src/iree/compiler/ConstEval/Runtime.cpp
@@ -6,6 +6,7 @@
#include "iree/compiler/ConstEval/Runtime.h"
+#include "iree/base/api.h"
#include "iree/compiler/Dialect/Util/IR/UtilDialect.h"
#include "iree/compiler/Dialect/VM/Target/Bytecode/BytecodeModuleTarget.h"
#include "iree/hal/drivers/local_task/registration/driver_module.h"
@@ -19,20 +20,15 @@
namespace {
-LogicalResult handleRuntimeError(Location loc, iree_status_t status) {
+LogicalResult handleRuntimeError(Location loc, iree_status_t status,
+ bool freeStatus = true) {
if (iree_status_is_ok(status))
return success();
- std::string message;
- message.resize(512);
- iree_host_size_t buffer_length;
- if (!iree_status_format(status, message.size(), &message[0],
- &buffer_length)) {
- message.resize(buffer_length + 1);
- iree_status_format(status, message.size(), &message[0], &buffer_length);
+ std::string statusString = iree::Status::ToString(status);
+ if (freeStatus) {
+ iree_status_ignore(status);
}
- message.resize(buffer_length);
- iree_status_ignore(status);
- return emitError(loc) << "runtime error in consteval: " << message;
+ return emitError(loc) << "runtime error in consteval: " << statusString;
}
LogicalResult convertToElementType(Location loc, Type baseType,
@@ -149,13 +145,21 @@
FunctionCall::FunctionCall(CompiledBinary &binary, iree_host_size_t argCapacity,
iree_host_size_t resultCapacity)
- : binary(binary) {
- IREE_CHECK_OK(iree_vm_list_create(iree_vm_make_undefined_type_def(),
- argCapacity, iree_allocator_system(),
- &inputs));
- IREE_CHECK_OK(iree_vm_list_create(iree_vm_make_undefined_type_def(),
- resultCapacity, iree_allocator_system(),
- &outputs));
+ : binary(binary), argCapacity(argCapacity), resultCapacity(resultCapacity) {
+}
+
+LogicalResult FunctionCall::initialize(Location loc) {
+ iree_status_t status = iree_ok_status();
+ if (iree_status_is_ok(status)) {
+ status = iree_vm_list_create(iree_vm_make_undefined_type_def(), argCapacity,
+ iree_allocator_system(), &inputs);
+ }
+ if (iree_status_is_ok(status)) {
+ status =
+ iree_vm_list_create(iree_vm_make_undefined_type_def(), resultCapacity,
+ iree_allocator_system(), &outputs);
+ }
+ return handleRuntimeError(loc, status);
}
FailureOr<iree::vm::ref<iree_hal_buffer_t>>
@@ -174,28 +178,36 @@
std::memset(¶ms, 0, sizeof(params));
params.type =
IREE_HAL_MEMORY_TYPE_HOST_VISIBLE | IREE_HAL_MEMORY_TYPE_DEVICE_VISIBLE;
- if (failed(handleRuntimeError(
- loc, iree_hal_allocator_allocate_buffer(binary.getAllocator(), params,
- storageSize, &buffer))))
- return failure();
+
+ iree_status_t status = iree_ok_status();
+ if (iree_status_is_ok(status)) {
+ status = iree_hal_allocator_allocate_buffer(binary.getAllocator(), params,
+ storageSize, &buffer);
+ }
iree_hal_buffer_mapping_t mapping;
- if (failed(handleRuntimeError(
- loc, iree_hal_buffer_map_range(
- buffer.get(), IREE_HAL_MAPPING_MODE_SCOPED,
- IREE_HAL_MEMORY_ACCESS_WRITE, /*byte_offset=*/0,
- /*byte_length=*/storageSize, &mapping))))
- return failure();
+ if (iree_status_is_ok(status)) {
+ status = iree_hal_buffer_map_range(
+ buffer.get(), IREE_HAL_MAPPING_MODE_SCOPED,
+ IREE_HAL_MEMORY_ACCESS_WRITE, /*byte_offset=*/0,
+ /*byte_length=*/storageSize, &mapping);
+ }
- // Copy.
- LogicalResult copyResult = serializableAttr.serializeToBuffer(
- loc, llvm::endianness::native,
- ArrayRef<char>(reinterpret_cast<char *>(mapping.contents.data),
- storageSize));
+ if (iree_status_is_ok(status)) {
+ LogicalResult copyResult = serializableAttr.serializeToBuffer(
+ loc, llvm::endianness::native,
+ ArrayRef<char>(reinterpret_cast<char *>(mapping.contents.data),
+ storageSize));
+ iree_status_ignore(iree_hal_buffer_unmap_range(&mapping));
+ if (failed(copyResult)) {
+ status =
+ iree_make_status(IREE_STATUS_INTERNAL, "serializeToBuffer failed");
+ }
+ }
- if (failed(handleRuntimeError(loc, iree_hal_buffer_unmap_range(&mapping))) ||
- failed(copyResult)) {
- return failure();
+ if (!iree_status_is_ok(status)) {
+ iree_hal_buffer_release(buffer.get());
+ return handleRuntimeError(loc, status);
}
return buffer;
@@ -404,15 +416,19 @@
// mapping is not available. Today with the CPU backends it's always
// possible but would not work with accelerators.
iree_hal_buffer_mapping_t mapping;
- IREE_CHECK_OK(iree_hal_buffer_map_range(
- buffer, IREE_HAL_MAPPING_MODE_SCOPED, IREE_HAL_MEMORY_ACCESS_READ,
- /*byte_offset=*/0, length, &mapping));
+ if (failed(handleRuntimeError(
+ loc, iree_hal_buffer_map_range(
+ buffer, IREE_HAL_MAPPING_MODE_SCOPED,
+ IREE_HAL_MEMORY_ACCESS_READ,
+ /*byte_offset=*/0, length, &mapping)))) {
+ return {};
+ }
MutableArrayRef<char> rawBufferArray(
reinterpret_cast<char *>(mapping.contents.data),
mapping.contents.data_length);
auto convertedAttr =
createAttributeFromRawData(loc, tensorType, rawBufferArray);
- iree_hal_buffer_unmap_range(&mapping);
+ iree_status_ignore(iree_hal_buffer_unmap_range(&mapping));
return convertedAttr;
} else {
iree_string_view_t typeName =
@@ -427,37 +443,58 @@
return {};
}
-void CompiledBinary::initialize(void *data, size_t length) {
+LogicalResult CompiledBinary::initialize(Location loc, void *data,
+ size_t length) {
Runtime &runtime = Runtime::getInstance();
+ // Keep the sticky initStatus alive then free in |runtime|'s destructor.
+ if (failed(
+ handleRuntimeError(loc, runtime.initStatus, /*freeStatus=*/false))) {
+ return failure();
+ }
+
+ iree_status_t status = iree_ok_status();
// Create driver and device.
iree_hal_driver_t *driver = nullptr;
- IREE_CHECK_OK(iree_hal_driver_registry_try_create(
- runtime.registry, iree_make_cstring_view("local-task"),
- iree_allocator_system(), &driver));
- IREE_CHECK_OK(iree_hal_driver_create_default_device(
- driver, iree_allocator_system(), &device));
+ if (iree_status_is_ok(status)) {
+ status = iree_hal_driver_registry_try_create(
+ runtime.registry, iree_make_cstring_view("local-task"),
+ iree_allocator_system(), &driver);
+ }
+
+ if (iree_status_is_ok(status)) {
+ status = iree_hal_driver_create_default_device(
+ driver, iree_allocator_system(), &device);
+ }
iree_hal_driver_release(driver);
// Create hal module.
- iree_hal_device_t *device_ptr = device.get();
- IREE_CHECK_OK(iree_hal_module_create(
- runtime.instance.get(), /*device_count=*/1, &device_ptr,
- IREE_HAL_MODULE_FLAG_NONE, iree_allocator_system(), &hal_module));
+ if (iree_status_is_ok(status)) {
+ std::array<iree_hal_device_t *, 1> devices = {device.get()};
+ status = iree_hal_module_create(runtime.instance.get(), devices.size(),
+ devices.data(), IREE_HAL_MODULE_FLAG_NONE,
+ iree_allocator_system(), &hal_module);
+ }
// Bytecode module.
- IREE_CHECK_OK(iree_vm_bytecode_module_create(
- runtime.instance.get(), iree_make_const_byte_span(data, length),
- iree_allocator_null(), iree_allocator_system(), &main_module));
+ if (iree_status_is_ok(status)) {
+ status = iree_vm_bytecode_module_create(
+ runtime.instance.get(), iree_make_const_byte_span(data, length),
+ iree_allocator_null(), iree_allocator_system(), &main_module);
+ }
- // Context.
- std::array<iree_vm_module_t *, 2> modules = {
- hal_module.get(),
- main_module.get(),
- };
- IREE_CHECK_OK(iree_vm_context_create_with_modules(
- runtime.instance.get(), IREE_VM_CONTEXT_FLAG_NONE, modules.size(),
- modules.data(), iree_allocator_system(), &context));
+ // Create context.
+ if (iree_status_is_ok(status)) {
+ std::array<iree_vm_module_t *, 2> modules = {
+ hal_module.get(),
+ main_module.get(),
+ };
+ status = iree_vm_context_create_with_modules(
+ runtime.instance.get(), IREE_VM_CONTEXT_FLAG_NONE, modules.size(),
+ modules.data(), iree_allocator_system(), &context);
+ }
+
+ return handleRuntimeError(loc, status);
}
InMemoryCompiledBinary::~InMemoryCompiledBinary() { deinitialize(); }
@@ -472,20 +509,28 @@
return failure();
}
os.flush();
- initialize(&binary[0], binary.length());
- return success();
+ return initialize(moduleOp.getLoc(), &binary[0], binary.length());
}
Runtime::Runtime() {
- IREE_CHECK_OK(
- iree_hal_driver_registry_allocate(iree_allocator_system(), ®istry));
- IREE_CHECK_OK(iree_hal_local_task_driver_module_register(registry));
- IREE_CHECK_OK(iree_vm_instance_create(IREE_VM_TYPE_CAPACITY_DEFAULT,
- iree_allocator_system(), &instance));
- IREE_CHECK_OK(iree_hal_module_register_all_types(instance.get()));
+ if (iree_status_is_ok(initStatus)) {
+ initStatus =
+ iree_hal_driver_registry_allocate(iree_allocator_system(), ®istry);
+ }
+ if (iree_status_is_ok(initStatus)) {
+ initStatus = iree_hal_local_task_driver_module_register(registry);
+ }
+ if (iree_status_is_ok(initStatus)) {
+ initStatus = iree_vm_instance_create(IREE_VM_TYPE_CAPACITY_DEFAULT,
+ iree_allocator_system(), &instance);
+ }
+ if (iree_status_is_ok(initStatus)) {
+ initStatus = iree_hal_module_register_all_types(instance.get());
+ }
}
Runtime::~Runtime() {
+ iree_status_free(initStatus);
instance.reset();
iree_hal_driver_registry_free(registry);
}
diff --git a/compiler/src/iree/compiler/ConstEval/Runtime.h b/compiler/src/iree/compiler/ConstEval/Runtime.h
index 6ce1005..977c651 100644
--- a/compiler/src/iree/compiler/ConstEval/Runtime.h
+++ b/compiler/src/iree/compiler/ConstEval/Runtime.h
@@ -34,7 +34,7 @@
protected:
CompiledBinary();
- void initialize(void *data, size_t length);
+ LogicalResult initialize(Location loc, void *data, size_t length);
// The base class does not clean up initialized state. This must be done
// explicitly by subclasses, ensuring that any backing images remain valid
// through the call to deinitialize().
@@ -55,6 +55,7 @@
FunctionCall(CompiledBinary &binary, iree_host_size_t argCapacity,
iree_host_size_t resultCapacity);
+ LogicalResult initialize(Location loc);
LogicalResult addArgument(Location loc, Attribute attr);
LogicalResult invoke(Location loc, StringRef name);
LogicalResult getResultAsAttr(Location loc, size_t index, Type mlirType,
@@ -71,6 +72,8 @@
IREE::Util::SerializableAttrInterface serializableAttr);
CompiledBinary binary;
+ iree_host_size_t argCapacity;
+ iree_host_size_t resultCapacity;
iree::vm::ref<iree_vm_list_t> inputs;
iree::vm::ref<iree_vm_list_t> outputs;
};
@@ -93,6 +96,7 @@
iree_hal_driver_registry_t *registry = nullptr;
iree::vm::ref<iree_vm_instance_t> instance;
+ iree_status_t initStatus = iree_ok_status();
private:
Runtime();
diff --git a/compiler/src/iree/compiler/ConstEval/test/BUILD.bazel b/compiler/src/iree/compiler/ConstEval/test/BUILD.bazel
index 7888ae2..fce0782 100644
--- a/compiler/src/iree/compiler/ConstEval/test/BUILD.bazel
+++ b/compiler/src/iree/compiler/ConstEval/test/BUILD.bazel
@@ -19,6 +19,7 @@
"compile_regressions.mlir",
"failing.mlir",
"jit_globals.mlir",
+ "jit_globals_vmvx_errors.mlir",
"scalar_values.mlir",
],
include = ["*.mlir"],
diff --git a/compiler/src/iree/compiler/ConstEval/test/CMakeLists.txt b/compiler/src/iree/compiler/ConstEval/test/CMakeLists.txt
index e14f38b..247ae43 100644
--- a/compiler/src/iree/compiler/ConstEval/test/CMakeLists.txt
+++ b/compiler/src/iree/compiler/ConstEval/test/CMakeLists.txt
@@ -17,6 +17,7 @@
"compile_regressions.mlir"
"failing.mlir"
"jit_globals.mlir"
+ "jit_globals_vmvx_errors.mlir"
"scalar_values.mlir"
TOOLS
FileCheck
diff --git a/compiler/src/iree/compiler/ConstEval/test/failing.mlir b/compiler/src/iree/compiler/ConstEval/test/failing.mlir
index 41a1440..42d6724 100644
--- a/compiler/src/iree/compiler/ConstEval/test/failing.mlir
+++ b/compiler/src/iree/compiler/ConstEval/test/failing.mlir
@@ -1,4 +1,4 @@
-// RUN: iree-opt --split-input-file --iree-consteval-jit-target-device=vmvx --verify-diagnostics --iree-consteval-jit-debug --iree-consteval-jit-globals %s | FileCheck %s
+// RUN: iree-opt --split-input-file --verify-diagnostics --iree-consteval-jit-debug --iree-consteval-jit-globals %s | FileCheck %s
// XFAIL: *
// CHECK-LABEL: @eval_f64_scalar
diff --git a/compiler/src/iree/compiler/ConstEval/test/jit_globals.mlir b/compiler/src/iree/compiler/ConstEval/test/jit_globals.mlir
index 2760a2d..b3de554 100644
--- a/compiler/src/iree/compiler/ConstEval/test/jit_globals.mlir
+++ b/compiler/src/iree/compiler/ConstEval/test/jit_globals.mlir
@@ -1,6 +1,4 @@
-// RUN: iree-opt --split-input-file --iree-consteval-jit-target-device=vmvx --verify-diagnostics --iree-consteval-jit-debug --iree-consteval-jit-globals %s | FileCheck %s
-
-// TODO(laurenzo): Full type matrix for tests.
+// RUN: iree-opt --split-input-file --iree-consteval-jit-globals --iree-consteval-jit-debug --verify-diagnostics %s | FileCheck %s
module @no_uninitialized {
util.global private @hoisted : tensor<5x6xf32> = dense<4.0> : tensor<5x6xf32>
@@ -66,15 +64,17 @@
// -----
// CHECK-LABEL: @eval_f16_tensor
+// CHECK: util.global private @[[EVALED:.+]] = dense<2.000000e+02> : tensor<5x6xf16>
module @eval_f16_tensor {
util.global private @hoisted : tensor<5x6xf16>
- // expected-warning @+1 {{unsupported type for current jit configuration}}
+ // CHECK-NOT: util.initializer
util.initializer {
%cst = arith.constant dense<2.0e+2> : tensor<5x6xf16>
util.global.store %cst, @hoisted : tensor<5x6xf16>
util.return
}
util.func public @main() -> tensor<5x6xf16> {
+ // CHECK: util.global.load @[[EVALED]]
%hoisted = util.global.load @hoisted : tensor<5x6xf16>
util.return %hoisted : tensor<5x6xf16>
}
@@ -82,18 +82,18 @@
// -----
-// bf16 currently unsupported (initializer should remain).
-
// CHECK-LABEL: @eval_bf16_tensor
+// CHECK: util.global private @[[EVALED:.+]] = dense<2.000000e+02> : tensor<5x6xbf16>
module @eval_bf16_tensor {
util.global private @hoisted : tensor<5x6xbf16>
- // expected-warning @+1 {{unsupported type for current jit configuration}}
+ // CHECK-NOT: util.initializer
util.initializer {
%cst = arith.constant dense<2.0e+2> : tensor<5x6xbf16>
util.global.store %cst, @hoisted : tensor<5x6xbf16>
util.return
}
util.func public @main() -> tensor<5x6xbf16> {
+ // CHECK: util.global.load @[[EVALED]]
%hoisted = util.global.load @hoisted : tensor<5x6xbf16>
util.return %hoisted : tensor<5x6xbf16>
}
@@ -121,15 +121,17 @@
// -----
// CHECK-LABEL: @eval_f64_tensor
+// CHECK: util.global private @[[EVALED:.+]] = dense<[2.000000e+02, 3.200000e+03]> : tensor<2xf64>
module @eval_f64_tensor {
util.global private @hoisted : tensor<2xf64>
- // expected-warning @+1 {{unsupported type for current jit configuration}}
+ // CHECK-NOT: util.initializer
util.initializer {
%cst = arith.constant dense<[2.0e+2, 3.2e+3]> : tensor<2xf64>
util.global.store %cst, @hoisted : tensor<2xf64>
util.return
}
util.func public @main() -> tensor<2xf64> {
+ // CHECK: util.global.load @[[EVALED]]
%hoisted = util.global.load @hoisted : tensor<2xf64>
util.return %hoisted : tensor<2xf64>
}
diff --git a/compiler/src/iree/compiler/ConstEval/test/jit_globals_vmvx_errors.mlir b/compiler/src/iree/compiler/ConstEval/test/jit_globals_vmvx_errors.mlir
new file mode 100644
index 0000000..b6bab1a
--- /dev/null
+++ b/compiler/src/iree/compiler/ConstEval/test/jit_globals_vmvx_errors.mlir
@@ -0,0 +1,64 @@
+// RUN: iree-opt --split-input-file --iree-consteval-jit-globals --iree-consteval-jit-target-device=vmvx --iree-consteval-jit-debug --verify-diagnostics %s | FileCheck %s
+
+// CHECK-LABEL: @eval_f16_tensor
+module @eval_f16_tensor {
+ util.global private @hoisted : tensor<5x6xf16>
+ util.func public @main() -> tensor<5x6xf16> {
+ %hoisted = util.global.load @hoisted : tensor<5x6xf16>
+ util.return %hoisted : tensor<5x6xf16>
+ }
+ // expected-warning @+1 {{unsupported type for current jit configuration}}
+ util.initializer attributes {iree.compiler.consteval} {
+ %cst = arith.constant dense<2.0e+2> : tensor<5x6xf16>
+ util.global.store %cst, @hoisted : tensor<5x6xf16>
+ util.return
+ }
+}
+
+// -----
+// CHECK-LABEL: @eval_bf16_tensor
+module @eval_bf16_tensor {
+ util.global private @hoisted : tensor<5x6xbf16>
+ util.func public @main() -> tensor<5x6xbf16> {
+ %hoisted = util.global.load @hoisted : tensor<5x6xbf16>
+ util.return %hoisted : tensor<5x6xbf16>
+ }
+ // expected-warning @+1 {{unsupported type for current jit configuration}}
+ util.initializer attributes {iree.compiler.consteval} {
+ %cst = arith.constant dense<2.0e+2> : tensor<5x6xbf16>
+ util.global.store %cst, @hoisted : tensor<5x6xbf16>
+ util.return
+ }
+}
+
+// -----
+// CHECK-LABEL: @eval_f64_tensor
+module @eval_f64_tensor {
+ util.global private @hoisted : tensor<2xf64>
+ util.func public @main() -> tensor<2xf64> {
+ %hoisted = util.global.load @hoisted : tensor<2xf64>
+ util.return %hoisted : tensor<2xf64>
+ }
+ // expected-warning @+1 {{unsupported type for current jit configuration}}
+ util.initializer attributes {iree.compiler.consteval} {
+ %cst = arith.constant dense<[2.0e+2, 3.2e+3]> : tensor<2xf64>
+ util.global.store %cst, @hoisted : tensor<2xf64>
+ util.return
+ }
+}
+
+// -----
+// CHECK-LABEL: @eval_i4_tensor
+module @eval_i4_tensor {
+ util.global private @hoisted : tensor<5x6xi4>
+ util.func public @main() -> tensor<5x6xi4> {
+ %hoisted = util.global.load @hoisted : tensor<5x6xi4>
+ util.return %hoisted : tensor<5x6xi4>
+ }
+ // expected-warning @+1 {{unsupported type for current jit configuration}}
+ util.initializer attributes {iree.compiler.consteval} {
+ %cst = arith.constant dense<3> : tensor<5x6xi4>
+ util.global.store %cst, @hoisted : tensor<5x6xi4>
+ util.return
+ }
+}
diff --git a/compiler/src/iree/compiler/ConstEval/test/scalar_values.mlir b/compiler/src/iree/compiler/ConstEval/test/scalar_values.mlir
index 8bcfa1b..1d91498 100644
--- a/compiler/src/iree/compiler/ConstEval/test/scalar_values.mlir
+++ b/compiler/src/iree/compiler/ConstEval/test/scalar_values.mlir
@@ -1,4 +1,4 @@
-// RUN: iree-opt --split-input-file --iree-consteval-jit-target-device=vmvx --verify-diagnostics --iree-consteval-jit-debug --iree-consteval-jit-globals %s | FileCheck %s
+// RUN: iree-opt --split-input-file --verify-diagnostics --iree-consteval-jit-debug --iree-consteval-jit-globals %s | FileCheck %s
// CHECK-LABEL: @eval_i8_scalar
// CHECK: 42 : i8