[Good First Issue] [ARM] [Debug Caps] : Implement register prints in just-in-time Kernels #27715
Labels
category: CPU
OpenVINO CPU plugin
good first issue
Good for newcomers
platform: arm
OpenVINO on ARM / ARM64
Context
The CPU Plugin in OpenVINO uses optimized just-in-time (JIT) kernels to efficiently execute operations. For example, the kernel for Elementwise operation consists of several JIT Emitters.
While writing the JIT emitter or kernel, a developer sometimes needs to know content of registers to find root cause of a some bug. The JIT source code execution debugging might be slow and difficult due to disassemble view. To accelerate the debugging process, there can be implemented the debug capabilities - the ability to print register content.
Prerequisites
Recommended to use ARM CPU based platform for development (e.g. Mac, Raspberry Pi etc). The cross-compilation with an emulator (e.g. QEMU) using is still option:
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/arm64.toolchain.cmake ..
.What needs to be done?
RegPrints
in new filesrc/plugins/intel_cpu/src/emitters/plugin/aarch64/debug_capabilities.hpp
. This class should provide the ability to print the contents of general-purpose and vector registers during JIT kernel execution on ARM64 SIMD platforms. It means that the classRegPrints
should have only two public methodsprint
: for general-purpose and vector registers.RegPrints
for x64 platforms.Tests
Tests are disabled in default build, so ensure to add
-DENABLE_TESTS=ON
into cmake command.GoogleTest is used for testing. CPU functional test target is ov_cpu_func_tests.
At the moment, we don't have test infrastructure to validate single JIT emitter or single small JIT kernel if they're not mapped to OpenVINO operation. However, there are still options to validate the developed functionality of
RegPrints
:RegPrint
and implementation of the emitter if you know what the emitter should process.reg_work_amount
in the same kernel. This register contain work amount of the loop. On each loop iteration the value in register should decrease inloop_step
.Then we can launch any test with the OpenVINO operation which is executed using this JIT kernel. The list of elementwise operations which are supportd by JIT Kernel is here. For example, to launch tests with
Add
operation we can call the following command line:./bin/[platform]/[build_type]/ov_cpu_func_tests --gtest_filter="*smoke*Eltwise*Add*"
Examples
RegPrints
for x64 platforms - link. The implementation uses binary call - execute the instructioncall
for register with stored pointer to static method which prints the content of registers.std::powf
during execution - link.Helpful AArch64 documentation
Resources
Contact points
@a-sidorova, @dmitry-gorokhov
The text was updated successfully, but these errors were encountered: