Skip to content

Instantly share code, notes, and snippets.

/usr/bin/c++ -DIREE_HAVE_EMITC_DIALECT -I/usr/local/google/home/benoitjacob/iree/third_party/llvm-project/llvm/include -Ithird_party/llvm-project/llvm/include -I/usr/local/google/home/benoitjacob/iree/third_party/llvm-project/mlir/include -Ithird_party/llvm-project/llvm/tools/mlir/include -Ithird_party/llvm-project/llvm/tools/mlir-hlo/include -isystem /usr/local/google/home/benoitjacob/iree -isystem . -isystem iree/base/internal/flatcc -isystem /usr/local/google/home/benoitjacob/iree/third_party/flatcc/include -O2 -g -fPIC -fvisibility=hidden -fno-rtti -fno-exceptions -Wno-unused-but-set-parameter -Wno-comment -Wno-attributes -Wno-strict-prototypes -Wno-shadow-uncaptured-local -Wno-gnu-zero-variadic-macro-arguments -Wno-shadow-field-in-constructor -Wno-unreachable-code-return -Wno-missing-variable-declarations -Wno-gnu-label-as-value -I/usr/local/google/home/benoitjacob/iree/third_party/flatcc/include/ -I/usr/local/google/home/benoitjacob/iree/third_party/flatcc/include/flatcc/reflection/ -std=gnu++14 -MD -M
@bjacob
bjacob / a.cc
Created September 22, 2021 15:20
auto getProcAddress = [=](const char* sym_name) mutable {
for (auto funcOp : moduleOp.getOps<mlir::FuncOp>()) {
if (funcOp.sym_name() == sym_name) {
return funcOp;
}
}
llvm::errs() << "No function named `" << sym_name << "` in module.\n";
signalPassFailure();
return mlir::FuncOp();
};
#map0 = affine_map<(d0, d1, d2) -> (d0, d1)>
#map1 = affine_map<(d0, d1, d2) -> (d1, d2)>
#map2 = affine_map<(d0, d1, d2) -> (d0, d2)>
#map3 = affine_map<(d0, d1) -> (d0, d1)>
module {
func private @actual_matmul(%arg0: tensor<?x?xf32>, %arg1: tensor<?x?xf32>, %arg2: tensor<?x?xf32>) -> tensor<?x?xf32> {
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%arg2 : tensor<?x?xf32>) -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
}
func private @reference_matmul(%arg0: tensor<?x?xf32>, %arg1: tensor<?x?xf32>, %arg2: tensor<?x?xf32>) -> tensor<?x?xf32> {
#map0 = affine_map<(d0, d1, d2) -> (d0, d1)>
#map1 = affine_map<(d0, d1, d2) -> (d1, d2)>
#map2 = affine_map<(d0, d1, d2) -> (d0, d2)>
#map3 = affine_map<(d0, d1) -> (d0, d1)>
module {
func private @actual_matmul(%arg0: tensor<?x?xf32>, %arg1: tensor<?x?xf32>, %arg2: tensor<?x?xf32>) -> tensor<?x?xf32> {
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%arg2 : tensor<?x?xf32>) -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
}
func private @reference_matmul(%arg0: tensor<?x?xf32>, %arg1: tensor<?x?xf32>, %arg2: tensor<?x?xf32>) -> tensor<?x?xf32> {
@bjacob
bjacob / foo.txt
Created September 22, 2021 20:44
// -----// IR Dump After mlir::iree_compiler::IREE::ABI::WrapEntryPointsPass //----- //
#map0 = affine_map<(d0, d1, d2) -> (d0, d1)>
#map1 = affine_map<(d0, d1, d2) -> (d1, d2)>
#map2 = affine_map<(d0, d1, d2) -> (d0, d2)>
#map3 = affine_map<(d0, d1) -> (d0, d1)>
module {
func private @actual_matmul(%arg0: tensor<?x?xf32>, %arg1: tensor<?x?xf32>, %arg2: tensor<?x?xf32>) -> tensor<?x?xf32> {
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%arg2 : tensor<?x?xf32>) -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
}
UpdateCTestConfiguration from :/usr/local/google/home/benoitjacob/iree-build-android/DartConfiguration.tcl
UpdateCTestConfiguration from :/usr/local/google/home/benoitjacob/iree-build-android/DartConfiguration.tcl
Test project /usr/local/google/home/benoitjacob/iree-build-android
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 90
#map0 = affine_map<(d0, d1, d2) -> (d0, d1)>
#map1 = affine_map<(d0, d1, d2) -> (d1, d2)>
#map2 = affine_map<(d0, d1, d2) -> (d0, d2)>
#map3 = affine_map<(d0, d1) -> (d0, d1)>
#map4 = affine_map<(d0, d1, d2, d3) -> (d0, d2, d1, d3)>
#map5 = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>
#map6 = affine_map<(d0, d1, d2, d3) -> (d1, d3, d0, d2)>
module @matmul_f32 {
func private @reference_matmul(%arg0: tensor<?x?xf32>, %arg1: tensor<?x?xf32>, %arg2: tensor<?x?xf32>) -> tensor<?x?xf32> {
%0 = linalg.generic {indexing_maps = [#map0, #map1, #map2], iterator_types = ["parallel", "reduction", "parallel"]} ins(%arg0, %arg1 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%arg2 : tensor<?x?xf32>) {
benoitjacob@cloud:~/iree-build-linux$ ./iree/tools/iree-run-trace --driver=dylib /tmp/a.yaml
--- CALL[module.f32_dynamic_identity_2x3_times_identity_3x4_plus_zero_f32] ---
2x4xf32=[1 0 0 0][0 1 0 0]
--- CALL[module.f32_dynamic_random_2x3_times_random_3x4_plus_random_f32] ---
2x4xf32=[9 10 7 18][8 6 3 11]
--- CALL[module.f32_static_random_2x3_times_random_3x4_plus_random_f32] ---
2x4xf32=[14 8 15 15][7 6 8 7]
--- CALL[module.f32_mixed_random_2x3_times_random_3x4_plus_random_f32] ---
2x4xf32=[8 3 4 2][3 4 5 1]
--- CALL[module.f32_dynamic_identity_8x8_times_identity_8x8_plus_zero_f32] ---
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "cmake",
"args": ["--build", "."],
This file has been truncated, but you can view the full file.
execve("/usr/local/google/home/benoitjacob/iree-build-linux/iree/tools/iree-e2e-matmul-test", ["/usr/local/google/home/benoitjacob/iree-build-linux/iree/tools/iree-e2e-matmul-test", "--driver=dylib", "/usr/local/google/home/benoitjacob/iree-build-linux/iree/test/e2e/regression/e2e_matmul_mmt4d_i8_small_dylib-llvm-aot_dylib.yaml"], 0x55f49c1358f0 /* 43 vars */) = 0
brk(NULL) = 0x1586000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=113137, ...}) = 0
mmap(NULL, 113137, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f4ddd9d7000
close(4) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 4
read(4, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\362\0\0\0\0\0\0@\0\0\0\0\0\0\0@2\24\0\0\0\0\0\0\0\0\0@\08\0\t\0@\0\35\0\34\0\1\0\0\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\270\344\0\0\0\0\0\0\270\344\0\0\0\0\0\0\0\2