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

Add axes (optional) input to Pad #2178

Merged
merged 8 commits into from
Oct 17, 2023

Conversation

attila-dusnoki-htec
Copy link
Collaborator

@attila-dusnoki-htec attila-dusnoki-htec commented Sep 13, 2023

Pad version 18 introduced axes, as a way to make pads easier to use. With that, you only need to define the actually changing pads and the axes that they will be used on.

This change only affects the way the parsing works, no modification on the migraphx pad op needed.

Note: no onnx python unittest to enable, because they fail with PARSE_PAD: pad input must be constant

Resolves migraphx-benchmark#71

src/onnx/parse_pad.cpp Outdated Show resolved Hide resolved
test/onnx/onnx_test.cpp Outdated Show resolved Hide resolved
src/onnx/parse_pad.cpp Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #2178 (43904ba) into develop (52c74f0) will increase coverage by 0.01%.
The diff coverage is 91.66%.

❗ Current head 43904ba differs from pull request most recent head f779f52. Consider uploading reports for the commit f779f52 to get more accurate results

@@             Coverage Diff             @@
##           develop    #2178      +/-   ##
===========================================
+ Coverage    91.33%   91.35%   +0.01%     
===========================================
  Files          438      438              
  Lines        16435    16465      +30     
===========================================
+ Hits         15011    15041      +30     
  Misses        1424     1424              
Files Coverage Δ
src/onnx/parse_pad.cpp 94.33% <91.66%> (+2.23%) ⬆️

@attila-dusnoki-htec attila-dusnoki-htec force-pushed the onnx_parse_pad_axes branch 2 times, most recently from b9f0a7a to 0363676 Compare October 3, 2023 08:30
@pfultz2 pfultz2 requested a review from CharlieL7 October 6, 2023 22:32
Copy link
Collaborator

@CharlieL7 CharlieL7 left a comment

Choose a reason for hiding this comment

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

Minor suggestions to make throws more informative

if(args.size() >= pos)
{
auto axes_arg = args.at(pos - 1)->eval();
check_arg_empty(axes_arg, "PARSE_PAD: pad input must be constant");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
check_arg_empty(axes_arg, "PARSE_PAD: pad input must be constant");
check_arg_empty(axes_arg, "PARSE_PAD: variable `axes` input not supported");

if(args.size() >= 2)
{
auto pad_arg = args.at(1)->eval();
check_arg_empty(pad_arg, "PARSE_PAD: pad input must be constant");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
check_arg_empty(pad_arg, "PARSE_PAD: pad input must be constant");
check_arg_empty(pad_arg, "PARSE_PAD: `pads` input must be constant");

Pad version 18 introduced axes, as a way to make pads easier
to use. With that, you only need to define the actually changing
pads and the axes that they will be used on.

This change only affects the way the parsing works, no modification
on the migraphx pad op needed.
@causten causten merged commit 94bda24 into ROCm:develop Oct 17, 2023
14 of 15 checks passed
@causten causten deleted the onnx_parse_pad_axes branch October 17, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pad operator axes input parse error
4 participants