Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISCV64] [GSoC] Integrate SHL eltwise ops into OV #25674

Merged
merged 17 commits into from
Aug 14, 2024

Conversation

BHbean
Copy link
Contributor

@BHbean BHbean commented Jul 22, 2024

Details:

Tickets:

  • N/A

@BHbean BHbean requested review from a team as code owners July 22, 2024 15:59
@github-actions github-actions bot added the category: CPU OpenVINO CPU plugin label Jul 22, 2024
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Jul 22, 2024
@a-sidorova a-sidorova self-assigned this Jul 23, 2024
@dmitry-gorokhov dmitry-gorokhov added this to the 2024.4 milestone Jul 23, 2024
src/plugins/intel_cpu/src/nodes/executors/shl/shl.hpp Outdated Show resolved Hide resolved
src/plugins/intel_cpu/src/nodes/eltwise.h Outdated Show resolved Hide resolved
src/plugins/intel_cpu/src/nodes/eltwise.cpp Outdated Show resolved Hide resolved
src/plugins/intel_cpu/src/nodes/eltwise.cpp Outdated Show resolved Hide resolved
@BHbean BHbean requested a review from a team as a code owner August 2, 2024 08:27
@github-actions github-actions bot added the category: build OpenVINO cmake script / infra label Aug 2, 2024
@BHbean BHbean force-pushed the shl-executor branch 2 times, most recently from b5e3cd7 to 68cc344 Compare August 5, 2024 14:03
@a-sidorova
Copy link
Contributor

build_jenkins

@a-sidorova
Copy link
Contributor

build_jenkins

@a-sidorova
Copy link
Contributor

a-sidorova commented Aug 7, 2024

@BHbean ARM and x64 builds are failed with the following problem:

[2024-08-07T04:28:28.277Z] /Users/sys_k8sworker/ci-openvino/workspace/private-ci/ie/build-linux-macos/b/repos/openvino/src/plugins/intel_cpu/src/nodes/eltwise.cpp:3183: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]
[2024-08-07T04:28:28.277Z] /Users/sys_k8sworker/ci-openvino/workspace/private-ci/ie/build-linux-macos/b/repos/openvino/src/plugins/intel_cpu/src/nodes/eltwise.cpp:3185: Namespace should be terminated with "// namespace node" [readability/namespace] [5]
[2024-08-07T04:28:28.277Z] /Users/sys_k8sworker/ci-openvino/workspace/private-ci/ie/build-linux-macos/b/repos/openvino/src/plugins/intel_cpu/src/nodes/eltwise.cpp:3186: Namespace should be terminated with "// namespace intel_cpu" [readability/namespace] [5]
[2024-08-07T04:28:28.277Z] Done processing /Users/sys_k8sworker/ci-openvino/workspace/private-ci/ie/build-linux-macos/b/repos/openvino/src/plugins/intel_cpu/src/nodes/eltwise.cpp
[2024-08-07T04:28:28.277Z] Category 'readability/namespace' errors found: 2
[2024-08-07T04:28:28.277Z] Category 'whitespace/blank_line' errors found: 1
[2024-08-07T04:28:28.277Z] Total errors found: 3
[2024-08-07T04:28:28.277Z]
[2024-08-07T04:28:28.277Z] CMake Error at /Users/sys_k8sworker/ci-openvino/workspace/private-ci/ie/build-linux-macos/b/repos/openvino/cmake/developer_package/cpplint/cpplint_run.cmake:53 (message):
[2024-08-07T04:28:28.277Z] [cpplint] Code style check failed for :
[2024-08-07T04:28:28.277Z] /Users/sys_k8sworker/ci-openvino/workspace/private-ci/ie/build-linux-macos/b/repos/openvino/src/plugins/intel_cpu/src/nodes/eltwise.cpp
[2024-08-07T04:28:28.277Z]
[2024-08-07T04:28:28.277Z]
[2024-08-07T04:28:28.277Z] make[2]: *** [src/plugins/intel_cpu/cpplint/src/nodes/eltwise.cpp.cpplint] Error 1
[2024-08-07T04:28:28.277Z] make[2]: *** Deleting file `src/plugins/intel_cpu/cpplint/src/nodes/eltwise.cpp.cpplint'
[2024-08-07T04:28:28.277Z] make[1]: *** [src/plugins/intel_cpu/CMakeFiles/openvino_intel_cpu_plugin_cpplint.dir/all] Error 2

Could you please fix code style?

@a-sidorova
Copy link
Contributor

build_jenkins

2 similar comments
@a-sidorova
Copy link
Contributor

build_jenkins

@a-sidorova
Copy link
Contributor

build_jenkins

Copy link
Contributor

@a-sidorova a-sidorova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution to OpenVINO! 🎉

src/plugins/intel_cpu/src/nodes/eltwise.cpp Show resolved Hide resolved
BHbean added 4 commits August 13, 2024 13:54
[RISCV64] add shlExecutor option for eltwise node

[RISCV64] fix some errors with eltwise executor

[RISCV64] add constructor def and vector initialization for ShlTensor

[RISCV64] remove redundant debug print

[RISCV64] skip failed tests

[RISCV64] change way of invoking kernels

[RISCV64] set shapes for ShlTensor before SHL add

[RISCV64] simplify eltwise kernel invocation

[RISCV64] integrate other eltwise ops

[RISCV64] fix tests for some eltwise and activation ops

[RISCV64] integrate PRelu and LeakyRelu op and fix related tests

[RISCV64] integrate Maximum and Minimum op for the need of some tests

[RISCV64] fix some tests

[RISCV64] fix inaccurate problem with LeakyReLu op

[RISCV64] fix some tests

[RISCV64] enable debugging for riscv64

[RISCV64] update due to API changes
@a-sidorova
Copy link
Contributor

build_jenkins

Copy link
Contributor

@dmitry-gorokhov dmitry-gorokhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issue from my perspective. Let follow-up remaining comments in separate PR (if needed)

namespace ov {
namespace intel_cpu {

inline void log_unsupported_prec(const std::vector<MemoryDescPtr>& srcDescs,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems to be unused. Could you please delete?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Comment on lines +56 to +79
for (const auto& srcDesc : srcDescs) {
csinn_layout_enum supportedLayout = getShlDataLayoutByMemoryDesc(srcDesc);
switch (eltwiseAttrs.algorithm) {
case Algorithm::EltwisePrelu:
// SHL PRelu op only supports these two kinds of layout
if (!(supportedLayout == csinn_layout_enum::CSINN_LAYOUT_NC1HWC0 || supportedLayout == csinn_layout_enum::CSINN_LAYOUT_NCHW)) {
DEBUG_LOG("src descriptor layout is unsupported by SHL Prelu op: ", srcDesc->serializeFormat());
return false;
}
break;
default:
if (supportedLayout == csinn_layout_enum::CSINN_LAYOUT_NULL) {
DEBUG_LOG("src descriptor layout is unsupported by SHL: ", srcDesc->serializeFormat());
return false;
}
continue;
}
}
for (const auto& dstDesc : dstDescs) {
if (getShlDataLayoutByMemoryDesc(dstDesc) == csinn_layout_enum::CSINN_LAYOUT_NULL) {
DEBUG_LOG("dst descriptor layout is unsupported by SHL: ", dstDesc->serializeFormat());
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that Eltwise node creates only planar layoit desc (nchw) while this code checks doesn't prohibit nhwc layout. So what is really supported by SHL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SHL Eltwise node supports only planar layout by creating descriptors with only nchw layout. This part of code does not block any other layouts as the eltwise ops in SHL does not constrain the layouts of their input and output (expect PRelu). So in the future more layouts can be supported by creating descriptors with different layouts under different situations.

@dmitry-gorokhov dmitry-gorokhov added this pull request to the merge queue Aug 14, 2024
Merged via the queue into openvinotoolkit:master with commit 25eac04 Aug 14, 2024
134 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: build OpenVINO cmake script / infra category: CPU OpenVINO CPU plugin ExternalPR External contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants