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

Disabling ConvOclBwdWrW2 for asymmetric padding #179

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

shurale-nkn
Copy link
Contributor

Added condition in IsApplicable.

Fix for issue #142

@daniellowell
Copy link
Contributor

We need to purge the perf db of entries with this solver with any input that have asymmetric padding.

@daniellowell
Copy link
Contributor

@JehandadKhan @alexandraBara For awareness.

@atamazov
Copy link
Contributor

atamazov commented Apr 27, 2020

We need to purge the perf db of entries with this solver with any input that have asymmetric padding.

There is no immediate harm in this, except perf-db size. Do you mean find-db?

Copy link
Contributor

@atamazov atamazov left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -235,6 +235,15 @@ struct ProblemDescription
std::size_t GetBackwardPadW() const { return GetWeightsWidth() - GetPadW() - 1; }
std::size_t GetBackwardPadH() const { return GetWeightsHeight() - GetPadW() - 1; }

bool IsAsymmetricPadH() const
{
return conv.paddingMode == miopenPaddingSame && (GetWeightsHeight() % 2) == 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check code around https://github.com/ROCmSoftwarePlatform/MIOpen/blob/cb1ef1f2a89ebbc4e556cce51234456d9dc9ea03/src/convolution.cpp#L242-L248

It seems like in certain cases we can get asymmetric padding even in miopenPaddingDefault mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2 * GetConvPads()[i] - is symmetric padding;
1 - case where filter bigger than input image;

@atamazov
Copy link
Contributor

IIRC none of OCL kernels support asymmetric padding. And some old asm kernels too. @Kirpich30000 do you remember?

@Kirpich30000
Copy link
Contributor

No, I don't remember details about OCL kernels

@shurale-nkn
Copy link
Contributor Author

@atamazov
Copy link
Contributor

@Kirpich30000

No, I don't remember details about OCL kernels

What about asm kernels?

@atamazov
Copy link
Contributor

Further TODOs:

  • Disable asymmetric padding for all OCL kernels
  • Disable asymmetric padding for asm kernels that do not support it (pending @Kirpich30000 )

{
return conv.paddingMode == miopenPaddingSame && (GetWeightsHeight() % 2) == 0;
}
bool IsAsymmetricPadW() const
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these methods provide valid answer for all directions (Fwd/Bwd/WrW)?

Copy link
Contributor

Choose a reason for hiding this comment

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

@shurale-nkn @Kirpich30000 please answer

@Kirpich30000
Copy link
Contributor

Single and multi pass Winograd works with any padding. Other kernels were designed for symmetrical padding.

@daniellowell
Copy link
Contributor

@alexandraBara @JehandadKhan @cderb For awareness.

@daniellowell daniellowell merged commit 4fc158f into develop Apr 30, 2020
@daniellowell daniellowell deleted the asymmetric_padding_fix branch April 30, 2020 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants