Skip to content

Instantly share code, notes, and snippets.

View stellaraccident's full-sized avatar

Stella Laurenzo stellaraccident

  • Amd
  • Seattle Washington, US
View GitHub Profile
This file has been truncated, but you can view the full file.
Loading:
Loading: 0 packages loaded
Analyzing: target //third_party/mlir_edge/iree_llvm_sandbox:matmul_bench (0 packages loaded, 0 targets configured)
INFO: Analyzed target //third_party/mlir_edge/iree_llvm_sandbox:matmul_bench (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
[0 / 10] [Prepa] action 'BuildInfo build-info.txt'
Target //third_party/mlir_edge/iree_llvm_sandbox:matmul_bench up-to-date:
blaze-bin/third_party/mlir_edge/iree_llvm_sandbox/matmul_bench
INFO: Elapsed time: 0.528s, Critical Path: 0.33s, Remote (72.78% of the time): [queue: 0.00%, upload: 72.48%, setup: 0.00%, process: 0.00%]
$ sudo apt install python3-graphviz python3-pygraphviz
$ /usr/bin/python3 ../iree/third_party/llvm-project/llvm/utils/check_ninja_deps.py
error: third_party/llvm-project/llvm/tools/mlir/lib/Interfaces/CMakeFiles/obj.MLIRTilingInterface.dir/TilingInterface.cpp.o requires third_party/llvm-project/llvm/tools/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOpsDialect.h.inc but has no dependency on it
error: third_party/llvm-project/llvm/tools/mlir/lib/Interfaces/CMakeFiles/obj.MLIRTilingInterface.dir/TilingInterface.cpp.o requires third_party/llvm-project/llvm/tools/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOpsEnums.h.inc but has no dependency on it
error: third_party/llvm-project/llvm/tools/mlir/lib/Interfaces/CMakeFiles/obj.MLIRTilingInterface.dir/TilingInterface.cpp.o requires third_party/llvm-project/llvm/tools/mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.h.inc but has no dependency on it
error: third_party/llvm-project/llvm/tools/mlir/lib/Interfaces/CMakeFiles/obj.MLIRTilingInterface.dir/T
#loc1 = loc("/home/stella/src/iree-samples/pydm/simple/fibonacci.py":31:0)
#loc19 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":16:0)
#loc31 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":27:0)
module @module {
func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/fibonacci.py":31:0)) -> (i32, i32) {
%c-4_i32 = arith.constant -4 : i32 loc(#loc2)
%c-7_i32 = arith.constant -7 : i32 loc(#loc3)
%c3_i32 = arith.constant 3 : i32 loc(#loc4)
%c0_i32 = arith.constant 0 : i32 loc(#loc5)
%c1 = arith.constant 1 : index loc(#loc1)
#loc1 = loc("/home/stella/src/iree-samples/pydm/simple/lists.py":40:0)
module @module {
func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/lists.py":40:0), %arg1: i32 loc("/home/stella/src/iree-samples/pydm/simple/lists.py":40:0)) -> (i32, i32) {
%c-4_i32 = arith.constant -4 : i32 loc(#loc2)
%c-7_i32 = arith.constant -7 : i32 loc(#loc3)
%c0_i32 = arith.constant 0 : i32 loc(#loc3)
%c-1_i32 = arith.constant -1 : i32 loc(#loc4)
%c2 = arith.constant 2 : index loc(#loc1)
%c1 = arith.constant 1 : index loc(#loc1)
%c0 = arith.constant 0 : index loc(#loc1)
@stellaraccident
stellaraccident / input_pydm.mlir
Created October 30, 2021 07:32
PyDM with CPA Type Inference Fibonacci
module @module {
iree_pydm.func @main(%arg0: !iree_pydm.integer) -> (!iree_pydm.exception_result, !iree_pydm.integer) attributes {arg_names = ["n"], cell_vars = [], free_vars = ["n", "a", "b", "i", "c"]} {
%i = alloc_free_var "i" -> !iree_pydm.free_var_ref
%b = alloc_free_var "b" -> !iree_pydm.free_var_ref
%a = alloc_free_var "a" -> !iree_pydm.free_var_ref
%c = alloc_free_var "c" -> !iree_pydm.free_var_ref
%n = alloc_free_var "n" -> !iree_pydm.free_var_ref
%0 = box %arg0 : !iree_pydm.integer -> !iree_pydm.object<!iree_pydm.integer>
store_var %n = %0 : !iree_pydm.free_var_ref, !iree_pydm.object<!iree_pydm.integer>
%1 = constant 0 : i64 -> !iree_pydm.integer
module @module {
func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/fibonacci.py":44:0)) -> (i32, i32) {
%c-4_i32 = arith.constant -4 : i32 loc(#loc2)
%c0_i32 = arith.constant 0 : i32 loc(#loc2)
%c1 = arith.constant 1 : index loc(#loc1)
%c78_i32 = arith.constant 78 : i32 loc(#loc1)
%c0 = arith.constant 0 : index loc(#loc1)
%c2 = arith.constant 2 : index loc(#loc1)
%c256_i32 = arith.constant 256 : i32 loc(#loc1)
%c1_i32 = arith.constant 1 : i32 loc(#loc3)
@stellaraccident
stellaraccident / gist:e4b0343bec6240c4e96380a027ce5d72
Created October 22, 2021 16:15
Ubuntu 18.04 build torch-mlir
docker run --rm -it -v $(pwd):/work ubuntu:18.04 /bin/bash
In container history:
2 apt update
4 apt search clang
5 apt install clang
7 apt install python3
12 apt install python3-pip
13 python3 -m pip install cmake==3.21.3
14 python3 -m pip install ninja
#loc1 = loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0)
#loc12 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":16:0)
#loc30 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":27:0)
#loc88 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":62:0)
#loc146 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/numerics.py":97:0)
#loc204 = loc("/home/stella/src/iree-build/compiler-api/python_package/iree/compiler/dialects/iree_pydm/rtl/modules/booleans.py":16:0)
module @module {
func @main(%arg0: i32 loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0), %arg1: i32 loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0), %arg2: i32 loc("/home/stella/src/iree-samples/pydm/simple/arithmetic.py":28:0)) -> (i
module @module {
func @object_as_bool_int(%arg0: i32, %arg1: i32, %arg2: i32) -> (i32, i32) {
%c-4_i32 = constant -4 : i32
%c0_i32 = constant 0 : i32
%c1 = constant 1 : index
%c256_i32 = constant 256 : i32
%c0 = constant 0 : index
%c2 = constant 2 : index
%c78_i32 = constant 78 : i32
%0 = iree.list.create : !iree.list<!iree.variant>
CALL -> return_arg
DISPATCH 1 ConstI32Zero
DISPATCH 4 ConstI32
DISPATCH 11 ConstI32
DISPATCH 18 ConstI32
DISPATCH 25 ConstI32
DISPATCH 32 ConstI32
DISPATCH 39 ConstI32
DISPATCH 47 ConstF32Zero
DISPATCH 50 ConstI32