[RISCV] Discuss opprtunities to extend OpenVINO with RISCV support #14365
Replies: 3 comments 6 replies
-
Hi Vladimir, On technical level as part of CPU plugin there are C++ implementations (which are not ngraph reference, but actually used in production) and there are no x86 specific extensions used in them. Then there are also oneDNN primitives which are working through separate executor and those are x86 specific. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Completely agree that bunch of #ifdefs is not good choice, and also interested in what you say regarding moving different CPU specific code in one general CPU plugin, the idea looks quite logical and straightforward. It should allow to reuse a lot of common code and keep really HW specific implementation as separate components of that general CPU plugin. |
Beta Was this translation helpful? Give feedback.
-
Just to add a little bit more details to Yury's message. What we are proposing for ARM is shown on the diagram below. The major idea is to extend existing modular structure of CPU plugin with new blocks required for ARM (and other HW architectures) support. Moving closer to kernel level we propose to extend existing Executor concept which is designed to separate an operation and its implementation abstractions. Each operation may have several executors and this is exactly the place there ARM/RISCV specifics can be encapsulated. It also assumes some base classes in hierarchy, like ACL executor designed to contain all specifics related to ARM compute library. Some can be applied for csi-nn2 library or any other. With that design we tried to maximize amount of logic that can be reused between the HW architectures. In this way all major plugin level features like dynamic shapes support, graph level optimizations, memory reuse optimization, opset coverage, graph serialization and others stays common. |
Beta Was this translation helpful? Give feedback.
-
Hello OpenVINO team,
Thanks you guys for amazing work you are doing, we’d like to ask your opinion on opportunity to add OpenVINO support for RISCV CPU ISA to enable DL inference on this promising new architecture. As you probably know, RISCV committee has ratified some time ago vector extension v1.0 (kind of SIMD technology but vector length may vary at runtime). At the moment there are publicly available tools which enable development for this new arch (although, there is no CPU with RVV 1.0 hardware implementation available at the market yet but it is expected they may appear at this year or beginning of the next year). So, for now there is gcc and clang compilers capable to generate RVV 1.0 code and there is QEMU emulator, allowing functional testing of such code.
Also, as we can see, there is some effort in community to bring up inference capabilities on RISCV architectures (https://github.com/tum-ei-eda/muriscv-nn, https://github.com/rvboards/ncnn and there are might be others). We think having OpenVINO API available for RISCV platforms would be beneficial for both OpenVINO and community.
So, we have tried those compilers with OpenVINO code base and successfully build OpenVINO and CPU plugin (with minor cmake files adjustments to enable new toolchain). Obviously, when CPU plugin compiled for new CPU architecture, all x86 specific optimization turned off and only ngraph reference code is actually compiled. But this makes OpenVINO work on RISCV, we successfully passed OpenVINO conformance tests on RISCV QEMU (although performance of reference code is not good, expectable). That makes us think that ngraph reference code could be replaced one by one with RVV 1.0 optimized code, under conditional compilation, for example, allowing performance boost on RISCV CPUs.
What is you guys vision on this? Do you think it make sense to bring RISCV support to OpenVINO and if so, what should be the best way to implement this?
We also may need pay attention to the possibility for RISCV vendor specific extensions, in other words, RISCV committee ratified base RVV 1.0 ISA, which any RISCV CPU should be compatible with, and also allow vendor to extend RISCV ISA with some specific, optional extensions (for example DSP, or compressed instructions or whatever). It seems to support RISCV vendor adoption for OpenVINO we may need to think about some way to enable this kind of differentiation across CPU vendors. Something like specify not only 'CPU' as execution device, but also have ability to enable or disable some vendor extensions, to allow portability on application level through different RISCV implementations/platforms.
Would be interesting to hear back your opinion on this
Thanks
Beta Was this translation helpful? Give feedback.
All reactions