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

[onert] Fix DepthwiseConvOp kernel condition #13689

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions runtime/onert/backend/cpu/ops/DepthwiseConvolutionLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace ops

void DepthwiseConvolutionLayer::prepareF32()
{
if (_dilationWidth != 1 || _dilationHeight != 1)
if (_dilationWidth != 1 || _dilationHeight != 1 || _strideWidth != _strideHeight)
return;

// DepthwiseConvOp cpu kernel needs additional memory to perform with multi-
Expand Down Expand Up @@ -81,9 +81,9 @@ void DepthwiseConvolutionLayer::convFloat32()
op_params.float_activation_min = output_activation_min;
op_params.float_activation_max = output_activation_max;

// Since DepthwiseConvOp does not support dilation yet, it uses the existing
// kernel in this case.
if (_dilationWidth == 1 && _dilationHeight == 1)
// Since DepthwiseConvOp does not support dilation and different W/H stride yet,
// it uses the existing kernel in this case.
if (_dilationWidth == 1 && _dilationHeight == 1 && _strideWidth == _strideHeight)
Copy link
Contributor

Choose a reason for hiding this comment

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

The prepareF32 function must also be updated to add new constraints.
Thank you!

{
nnfw::cker::DepthwiseConvOp(op_params, getShape(_input), getBuffer<float>(_input),
getShape(_kernel), getBuffer<float>(_kernel), getShape(_bias),
Expand Down