Sample RISC-V Zephyr Tracing Report¶
This section contains a sample complete report with Zephyr tracing section on RISC-V platform, generated by Kenning using Zephelin.
Testing configuration:
Environment: Github Actions
Task: Gesture recognition on Magic Wand dataset
Tracing tool: Zephelin
Compiler framework:
TVMPlatform: SiFive HiFive Unmatched
Sample RISC-V Zephyr Tracing Report¶
Commands used¶
Note
This section was generated using:
python -m kenning.__init__ \
optimize \
test \
report \
--cfg \
/home/runner/work/kenning/kenning/scripts/configs/zephyr-tvm-magic-wand-hifive-unmatched-report.yml \
--measurements \
./results.json \
--report-path \
/home/runner/work/kenning/kenning/docs/source/generated/sample-riscv-zephyr-tracing-report.md \
--root-dir \
/home/runner/work/kenning/kenning/docs/source/ \
--img-dir \
/home/runner/work/kenning/kenning/docs/source/generated/img/ \
--report-name \
Sample RISC-V Zephyr Tracing Report \
--verbosity \
INFO \
--to-html
General information for results.json¶
Model framework:
torch ver. 2.8.0+cu128
Input JSON:
{
"dataset": {
"type": "kenning.datasets.magic_wand_dataset.MagicWandDataset",
"parameters": {
"window_size": 128,
"window_shift": 128,
"noise_level": 20,
"dataset_root": "build/data",
"inference_batch_size": 1,
"download_dataset": true,
"force_download_dataset": false,
"external_calibration_dataset": null,
"split_fraction_test": 0.2,
"split_fraction_val": null,
"split_seed": 1234,
"reduce_dataset": 1
}
},
"dataconverter": {
"type": "kenning.dataconverters.modelwrapper_dataconverter.ModelWrapperDataConverter",
"parameters": {}
},
"optimizers": [
{
"type": "kenning.optimizers.tvm.TVMCompiler",
"parameters": {
"model_framework": "any",
"target": null,
"target_attrs": "",
"target_microtvm_board": "hifive_unmatched/fu740/u74",
"target_host": null,
"zephyr_header_template": "gh://antmicro:kenning-zephyr-runtime/lib/kenning_inference_lib/runtimes/tvm/generated/model_impl.h.template;branch=main",
"zephyr_llext_source_template": null,
"opt_level": 3,
"libdarknet_path": "/usr/local/lib/libdarknet.so",
"compile_use_vm": false,
"output_conversion_function": "default",
"conv2d_data_layout": "",
"conv2d_kernel_layout": "",
"use_fp16_precision": false,
"use_int8_precision": false,
"int8_calibrate_chunk_by": -1,
"use_tensorrt": false,
"dataset_percentage": 0.25,
"module_name": null,
"compiled_model_path": "./build/compiled-model-magic-wand.graph_data",
"location": "host"
}
}
],
"platform": {
"type": "kenning.platforms.zephyr.ZephyrPlatform",
"parameters": {
"zephyr_build_path": "build/hifive_unmatched",
"llext_binary_path": null,
"sensors": null,
"sensors_frequency": null,
"enable_zephelin_gdb": false,
"enable_zephelin": true,
"zephyr_base": null,
"uart_port": "/tmp/renode_uart_qw9av2dv/uart",
"uart_baudrate": 115200,
"uart_log_port": "/tmp/renode_uart_qw9av2dv/uart_log",
"uart_log_baudrate": 115200,
"auto_flash": false,
"openocd_path": "openocd",
"sensor": null,
"number_of_batches": 16,
"simulated": true,
"runtime_binary_path": null,
"platform_resc_path": null,
"resc_dependencies": [],
"post_start_commands": [
"logLevel 3 sysbus.uart1"
],
"disable_opcode_counters": false,
"disable_profiler": false,
"profiler_dump_path": "/tmp/renode_profiler_i4pvmlhg.dump",
"profiler_interval_step": 10.0,
"runtime_init_log_msg": "Inference server started",
"runtime_init_timeout": 30,
"gdb_port": 3333,
"renode_log_lines_single_read_limit": 5000,
"name": "hifive_unmatched/fu740/u74",
"platforms_definitions": [
"kenning:///platforms/platforms.yml",
"/home/runner/work/kenning/kenning/kenning/resources/platforms/platforms.yml"
]
}
},
"protocol": {
"type": "kenning.protocols.uart.UARTProtocol",
"parameters": {
"port": "/tmp/renode_uart_qw9av2dv/uart",
"baudrate": 115200,
"error_recovery": true,
"timeout": 30
}
},
"model_wrapper": {
"type": "kenning.modelwrappers.classification.pytorch_magic_wand.PyTorchMagicWandModelWrapper",
"parameters": {
"batch_size": null,
"learning_rate": null,
"num_epochs": null,
"window_size": 128,
"logdir": null,
"export_dict": false,
"model_path": "kenning:///models/classification/magic_wand.pth",
"model_name": null
}
},
"runtime": {
"type": "kenning.runtimes.tvm.TVMRuntime",
"parameters": {
"save_model_path": "./build/compiled-model-magic-wand.graph_data",
"target_device_context": "cpu",
"target_device_context_id": 0,
"runtime_use_vm": false,
"llext_binary_path": null,
"batch_size": 1,
"disable_performance_measurements": false
}
},
"runtime_builder": {
"type": "kenning.runtimebuilders.zephyr.ZephyrRuntimeBuilder",
"parameters": {
"board": "hifive_unmatched/fu740/u74",
"application_dir": "/home/runner/work/kenning/kenning/zephyr-workspace/kenning-zephyr-runtime/app",
"build_dir": "/home/runner/work/kenning/kenning/zephyr-workspace/kenning-zephyr-runtime/build",
"venv_dir": "/home/runner/work/kenning/kenning/zephyr-workspace/kenning-zephyr-runtime/.west-venv",
"extra_targets": [
"board-repl"
],
"extra_build_args": [
"-DCONFIG_KENNING_TVM_MODEL_PRE_GEN=y"
],
"use_llext": false,
"run_west_update": false,
"workspace": "/home/runner/work/kenning/kenning/zephyr-workspace/kenning-zephyr-runtime",
"output_path": "build/hifive_unmatched",
"model_framework": "tvm"
}
}
}
Inference quality metrics for results.json¶
Figure 19 Confusion matrix¶
Statistic |
Value |
|---|---|
Accuracy |
0.992857 |
Mean precision |
0.994792 |
Mean sensitivity |
0.980769 |
G-mean |
0.980188 |
Inference performance metrics for results.json¶
Inference time¶
Figure 20 Inference time¶
Statistic |
Time [s] |
|---|---|
First inference duration |
0.009758 |
Mean |
0.009788 |
Median |
0.009809 |
Standard deviation |
0.000296 |
Minimum |
0.009086 |
Maximum |
0.010519 |
Renode performance measurements for results.json¶
Count of instructions used during inference¶
Figure 21 Histogram of used instructions during inference¶
Executed instructions counters¶
Figure 22 Count of executed instructions per second for cpu0 during benchmark¶
Figure 23 Cumulative count of executed instructions for cpu0 during benchmark¶
Figure 24 Count of executed instructions per second for cpu1 during benchmark¶
Figure 25 Cumulative count of executed instructions for cpu1 during benchmark¶
Figure 26 Count of executed instructions per second for cpu2 during benchmark¶
Figure 27 Cumulative count of executed instructions for cpu2 during benchmark¶
Figure 28 Count of executed instructions per second for cpu3 during benchmark¶
Figure 29 Cumulative count of executed instructions for cpu3 during benchmark¶
Peripheral access counters¶
Figure 30 Count of clint reads per second during benchmark¶
Figure 31 Cumulative count of clint reads during benchmark¶
Figure 32 Count of clint writes per second during benchmark¶
Figure 33 Cumulative count of clint writes during benchmark¶
Figure 34 Count of uart0 reads per second during benchmark¶
Figure 35 Cumulative count of uart0 reads during benchmark¶
Figure 36 Count of uart0 writes per second during benchmark¶
Figure 37 Cumulative count of uart0 writes during benchmark¶
Figure 38 Count of uart1 reads per second during benchmark¶
Figure 39 Cumulative count of uart1 reads during benchmark¶
Figure 40 Count of uart1 writes per second during benchmark¶
Figure 41 Cumulative count of uart1 writes during benchmark¶
Exceptions counters¶
Figure 42 Count of raised exceptions per second during benchmark¶
Figure 43 Cumulative count of raised exceptions during benchmark¶
Instructions stats¶
Instructions counters per inference pass: 1389083
Top 10 instructions and counters per inference pass:
c.addi: 210143
flw: 160091
bne: 94935
fsw: 76063
fadd.s: 65800
fmul.s: 62032
addi: 60838
c.mv: 54826
c.flw: 36256
ld: 34775
Memory allocation stats¶
Total allocated: 2946200
Total freed: 2889336
Peak allocated: 71200
Compiled model size: 21474.0
Host memory refers to memory of the CPU controlling the accelerator, while device memory is the memory of the accelerator.