Skip to content

Instantly share code, notes, and snippets.

View makslevental's full-sized avatar
💩

Maksim Levental makslevental

💩
View GitHub Profile
@makslevental
makslevental / repair.py
Created July 15, 2024 21:48
auditwheel don't delete/rename sos
import os
import shutil
import stat
from os.path import isabs, abspath, basename, exists
from os.path import join as pjoin
from pathlib import Path
from auditwheel.policy import WheelPolicies
from auditwheel.repair import WHEEL_INFO_RE
from auditwheel.wheel_abi import get_wheel_elfdata
module attributes {hal.device.targets = [#hal.device.target<"amd-aie-direct", [#hal.executable.target<"amd-aie-direct", "amdaie-xclbin-fb", {target_arch = "chip-tbd", ukernels = ""}>]>]} {
hal.executable private @matmul_i32_dispatch_0 {
hal.executable.variant public @amdaie_xclbin_fb target(<"amd-aie-direct", "amdaie-xclbin-fb", {target_arch = "chip-tbd", ukernels = ""}>) {
hal.executable.export public @matmul_i32_dispatch_0_matmul_128x128x256_i32 ordinal(0) layout(#hal.pipeline.layout<push_constants = 0, sets = [<0, bindings = [<0, storage_buffer, ReadOnly>, <1, storage_buffer, ReadOnly>, <2, storage_buffer>]>]>) attributes {hal.interface.bindings = [#hal.interface.binding<0, 0>, #hal.interface.binding<0, 1>, #hal.interface.binding<0, 2>]} {
^bb0(%arg0: !hal.device):
%x, %y, %z = flow.dispatch.workgroup_count_from_slice
hal.return %x, %y, %z : index, index, index
}
builtin.module {
func.func @matmul_i32_dispatch_0_matmul_128x128x256_i32() {
(iree) mlevental@mlevental-F7BSC:~/dev_projects/iree_plus_amd_aie/iree-amd-aie/runtime/src/iree-amd-aie/aie_runtime$ nm -C /home/mlevental/dev_projects/iree_plus_amd_aie/iree/cmake-build-debug/runtime/plugins/AMD-AIE/iree-amd-aie/aie_runtime/libiree-amd-aie_aie_runtime_AMDAIEEnums2.a
AMDAIEEnums2.cpp.o:
U memcmp
U __stack_chk_fail
U strlen
0000000000000000 W llvm::StringSwitch<std::optional<mlir::iree_compiler::AMDAIE::Foo>, std::optional<mlir::iree_compiler::AMDAIE::Foo> >::Case(llvm::StringLiteral, std::optional<mlir::iree_compiler::AMDAIE::Foo>)
0000000000000000 W llvm::StringSwitch<std::optional<mlir::iree_compiler::AMDAIE::Foo>, std::optional<mlir::iree_compiler::AMDAIE::Foo> >::Default(std::optional<mlir::iree_compiler::AMDAIE::Foo>)
0000000000000000 W llvm::StringSwitch<std::optional<mlir::iree_compiler::AMDAIE::Foo>, std::optional<mlir::iree_compiler::AMDAIE::Foo> >::StringSwitch(llvm::StringRef)
0000000000000000 W llvm::StringSwitch<std::optional<m
@makslevental
makslevental / 0_input.mlir
Last active July 5, 2024 17:00
matmul_16x64_32xi8__dispatch_0_matmul_tran_0.aiecc.mlir
aie.device(npu1_4col) {
%tile_0_0 = aie.tile(0, 0)
%tile_0_1 = aie.tile(0, 1)
%tile_1_1 = aie.tile(1, 1)
%tile_2_1 = aie.tile(2, 1)
%tile_0_2 = aie.tile(0, 2)
%lock_1_1 = aie.lock(%tile_1_1, 1) {init = 1 : i32}
%lock_1_1_0 = aie.lock(%tile_1_1, 0) {init = 0 : i32}
%lock_0_1 = aie.lock(%tile_0_1, 1) {init = 1 : i32}
%lock_0_1_1 = aie.lock(%tile_0_1, 0) {init = 0 : i32}
#!/usr/bin/env python3
"""A script to generate FileCheck statements for mlir unit tests.
This script is a utility to add FileCheck patterns to an mlir file.
NOTE: The input .mlir is expected to be the output from the parser, not a
stripped down variant.
Example usage:
$ generate-test-checks.py foo.mlir
Verifying against reference matmul ...
a: 116.63, b: 112.958
diff: 3.6727, norm: 229.588
abs_th: 0.5, epsilon * norm: 114.794
a: 135.27, b: 120.372
diff: 14.8982, norm: 255.642
abs_th: 0.5, epsilon * norm: 127.821
a: 133.749, b: 141.148
diff: 7.39873, norm: 274.897
abs_th: 0.5, epsilon * norm: 137.449
builtin.module {
aie.device(npu) {
%tile_0_2 = aie.tile(0, 2)
%tile_0_3 = aie.tile(0, 3)
%tile_1_2 = aie.tile(1, 2)
%tile_1_3 = aie.tile(1, 3)
%tile_0_0 = aie.tile(0, 0)
%tile_0_1 = aie.tile(0, 1)
aie.objectfifo @obj0(%tile_0_0, {%tile_0_1}, 4 : i32) : !aie.objectfifo<memref<2048xi32, 1>>
aie.objectfifo @obj1(%tile_0_0, {%tile_0_1}, 4 : i32) : !aie.objectfifo<memref<2048xi32, 1>>
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Op Declarations *|
|* *|
|* Automatically generated file, do not edit! *|
|* From: AIEOps.td *|
|* *|
\*===----------------------------------------------------------------------===*/
#if defined(GET_OP_CLASSES) || defined(GET_OP_FWD_DEFINES)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b14ae68f35..b9a9da824c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,9 +74,9 @@ endif()
option(IREE_ENABLE_CPUINFO "Enables runtime use of cpuinfo for processor topology detection." ${IREE_ENABLE_CPUINFO_DEFAULT})
option(IREE_BUILD_COMPILER "Builds the IREE compiler." ON)
-option(IREE_BUILD_TESTS "Builds IREE unit tests." ON)
+option(IREE_BUILD_TESTS "Builds IREE unit tests." OFF)
//#include "transactionFWDump.h"
#include <cassert>
#include <chrono>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
#include "xrt/xrt_bo.h"