Skip to content

Instantly share code, notes, and snippets.

View mehrdadh's full-sized avatar
:octocat:
Working...

Mehrdad Hessar mehrdadh

:octocat:
Working...
View GitHub Profile
@mehrdadh
mehrdadh / cmd.log
Created January 26, 2023 23:03
CMSIS
FAILED: CMakeFiles/app.dir/opt/arm/ethosu/cmsis/CMSIS-NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c.obj
ccache /opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I../include -Iruntime/include -Icodegen/host/include -I/opt/arm/ethosu/cmsis/CMSIS-NN/Include -I/opt/arm/ethosu/cmsis/CMSIS/DSP/Include -I/opt/zephyrproject/zephyr/include -Izephyr/include/generated -I/opt/zephyrproject/zephyr/soc/arm/arm/mps3 -I/opt/zephyrproject/zephyr/lib/libc/newlib/include -I/opt/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/opt/zephyrproject/zephyr/modules/hal_nxp/. -fno-strict-aliasing -Os -imacros /home/mhessar/work/tvm/apps/microtvm/zephyr_cmsisnn/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m55 -mthumb -mabi=aapcs -mfpu=auto -mfloat-abi=hard -mfp16-format=ieee --sysroot=/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/zeph
@mehrdadh
mehrdadh / aot_relax.py
Last active December 7, 2022 22:17
AoT Relax
@__tvm_main__ = primfn(args: handle, arg_type_ids: Pointer(int32), num_args: int32, out_ret_value: Pointer(), out_ret_tcode: Pointer(int32), resource_handle: handle) -> int32
attr = {"runner_function": True, "target": (nullptr), "global_symbol": "default___tvm_main__", "input_vars": [x: handle, y: handle], "output_vars": [alloc: handle], "calling_conv": 1} {
assert((num_args == 3), "default___tvm_main__: num_args should be 3")
let arg.x: handle = @tir.tvm_struct_get(args, 0, 12, dtype=handle)
let arg.x.code: int32 = arg_type_ids_1: Buffer(arg_type_ids, int32, [3], [])[0]
let arg.y: handle = @tir.tvm_struct_get(args, 1, 12, dtype=handle)
let arg.y.code: int32 = arg_type_ids_1[1]
let arg.alloc: handle = @tir.tvm_struct_get(args, 2, 12, dtype=handle)
let arg.alloc.code: int32 = arg_type_ids_1[2]
let x_buffer_var: Pointer(global int32) = @tir.tvm_struct_get(arg.x, 0, 1, dtype=handle)
@mehrdadh
mehrdadh / first_dense_tune.log
Created August 15, 2022 20:54
Anomaly Detection
{"input": ["c -keys=arm_cpu,cpu -device=arm_cpu -link-params=0 -mcpu=cortex-m4 -model=stm32l4r5zi", "dense_dsp.arm_cpu", [["TENSOR", [1, 640], "int16"], ["TENSOR", [128, 640], "int16"], null, "int32"], {}], "config": {"index": 117, "code_hash": null, "entity": [["tile_x", "sp", [-1, 1]], ["tile_y", "sp", [-1, 32]], ["tile_k", "sp", [-1, 320]]]}, "result": [[0.007217687], 0, 140.95950484275818, 1660590570.9498968], "version": 0.2, "tvm_version": "0.10.dev0"}
{"input": ["c -keys=arm_cpu,cpu -device=arm_cpu -link-params=0 -mcpu=cortex-m4 -model=stm32l4r5zi", "dense_dsp.arm_cpu", [["TENSOR", [1, 640], "int16"], ["TENSOR", [128, 640], "int16"], null, "int32"], {}], "config": {"index": 28, "code_hash": null, "entity": [["tile_x", "sp", [-1, 1]], ["tile_y", "sp", [-1, 16]], ["tile_k", "sp", [-1, 5]]]}, "result": [[0.009639], 0, 139.61223912239075, 1660590716.2905188], "version": 0.2, "tvm_version": "0.10.dev0"}
{"input": ["c -keys=arm_cpu,cpu -device=arm_cpu -link-params=0 -mcpu=cortex-m4 -model=stm32l4r5zi", "dense
@mehrdadh
mehrdadh / tvm_kws_cmsis.py
Created June 22, 2022 18:16
Build KWS with using Zephyr and CMSIS-NN in TVM
import tempfile
import numpy as np
import tarfile
import os
import pathlib
import io
import datetime
import tvm
from tvm import relay
@mehrdadh
mehrdadh / lib0.c
Last active January 27, 2022 17:34
Building AOT Executor on Hexagon
#ifdef _WIN32
#define TVM_EXPORT __declspec(dllexport)
#else
#define TVM_EXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif
TVM_EXPORT extern const unsigned char __tvm_dev_mblob[];
const unsigned char __tvm_dev_mblob[956] = {
@mehrdadh
mehrdadh / test_binary.so
Last active November 23, 2021 22:39
hexagon build with LLVM
test_binary.so: file format elf32-hexagon
Disassembly of section .text:
00000140 <add>:
140: 12 43 52 10 10524312 { p0 = cmp.eq(r2,#3); if (!p0.new) jump:nt 0x364 <add+0x224>
144: 00 c0 9d a0 a09dc000 allocframe(#0) }
148: 03 53 10 78 78105303 { r3 = #8344
@mehrdadh
mehrdadh / log.log
Created November 11, 2021 21:40
tune log
{"input": ["c -keys=cpu -link-params=0 -mcpu=cortex-m4 -model=stm32l4r5zi -runtime=c -system-lib=1", "conv2d_NCHWc.x86", [["TENSOR", [1, 3, 16, 16], "float32"], ["TENSOR", [8, 3, 5, 5], "float32"], [1, 1], [2, 2, 2, 2], [1, 1], "NCHW", "NCHW", "float32"], {}], "config": {"index": 6, "code_hash": null, "entity": [["tile_ic", "sp", [-1, 1]], ["tile_oc", "sp", [-1, 8]], ["tile_ow", "sp", [-1, 1]], ["unroll_kw", "ot", true]]}, "result": [[0.027152412], 0, 29.04643750190735, 1636661273.2943218], "version": 0.2, "tvm_version": "0.8.dev0"}
{"input": ["c -keys=cpu -link-params=0 -mcpu=cortex-m4 -model=stm32l4r5zi -runtime=c -system-lib=1", "conv2d_NCHWc.x86", [["TENSOR", [1, 3, 16, 16], "float32"], ["TENSOR", [8, 3, 5, 5], "float32"], [1, 1], [2, 2, 2, 2], [1, 1], "NCHW", "NCHW", "float32"], {}], "config": {"index": 78, "code_hash": null, "entity": [["tile_ic", "sp", [-1, 1]], ["tile_oc", "sp", [-1, 8]], ["tile_ow", "sp", [-1, 16]], ["unroll_kw", "ot", false]]}, "result": [[1000000000.0], 4, 31.553011178970337, 16366
@mehrdadh
mehrdadh / log.log
Created October 13, 2021 16:08
tvmc error
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/home/mhessar/tvm/python/tvm/__init__.py", line 72, in <module>
from . import micro
File "/home/mhessar/tvm/python/tvm/micro/__init__.py", line 22, in <module>
from .model_library_format import export_model_library_format, UnsupportedInModelLibraryFormatError
File "/home/mhessar/tvm/python/tvm/micro/model_library_format.py", line 34, in <module>
@mehrdadh
mehrdadh / log.log
Created September 16, 2021 19:20
zephyr tune log
Current/Best: 0.00/ 0.00 MFLOPS | Progress: (0/1) | 0.00 sINFO:__main__:run (in cwd: /tmp/tmpympk0aqj/generated-project/build): cmake .. -DWEST=west -DBOARD:STRING=qemu_x86
Including boilerplate (Zephyr base): /home/vagrant/zephyr/zephyr/cmake/app/boilerplate.cmake
-- Application: /tmp/tmpympk0aqj/generated-project
-- Zephyr version: 2.5.0 (/home/vagrant/zephyr/zephyr)
-- Found Python3: /home/vagrant/.cache/pypoetry/virtualenvs/microtvm-gTppbK-Q-py3.6/bin/python3.6 (found suitable exact version "3.6.9") found components: Interpreter
-- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
-- Board: qemu_x86
-- Cache files will be written to: /home/vagrant/.cache/zephyr
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Using toolchain: zephyr 0.12.3 (/home/vagrant/zephyr-sdk)
@mehrdadh
mehrdadh / log.log
Created September 15, 2021 16:43
vm log
Aug 3 03:43:54 ubuntu1804 systemd-modules-load[366]: Inserted module 'iscsi_tcp'
Aug 3 03:43:54 ubuntu1804 systemd[1]: Starting Flush Journal to Persistent Storage...
Aug 3 03:43:54 ubuntu1804 systemd[1]: Started Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.
Aug 3 03:43:54 ubuntu1804 systemd[1]: Started Load/Save Random Seed.
Aug 3 03:43:54 ubuntu1804 systemd[1]: Started Create Static Device Nodes in /dev.
Aug 3 03:43:54 ubuntu1804 systemd[1]: Starting udev Kernel Device Manager...
Aug 3 03:43:54 ubuntu1804 systemd-modules-load[366]: Inserted module 'ib_iser'
Aug 3 03:43:54 ubuntu1804 systemd[1]: Started Load Kernel Modules.
Aug 3 03:43:54 ubuntu1804 systemd[1]: Starting Apply Kernel Variables...
Aug 3 03:43:54 ubuntu1804 systemd[1]: Mounting FUSE Control File System...