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

support Pad(18) #14219

Merged
merged 8 commits into from
Jan 23, 2023
Merged

support Pad(18) #14219

merged 8 commits into from
Jan 23, 2023

Conversation

liqunfu
Copy link
Contributor

@liqunfu liqunfu commented Jan 11, 2023

Signed-off-by: Liqun Fu [email protected]

Description

Support Pad(18)

Motivation and Context

for Ort release 1.14

Signed-off-by: Liqun Fu <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>
skottmckay added a commit that referenced this pull request Jan 12, 2023
…ing pipeline.

Slice(was checked in today.
Resize: #13890
Col2Im: #12311
ScatterND and ScatterElement: #14224
Pad (should also fix CenterCropPad failures): #14219
Bitwise ops: #14197
Optional: Unknown if we're intending to support this in 1.14

Not sure about SoftPlus as that failing due to `Could not find an implementation for Exp(1)`. ORT supports opset 6 and on, so it seems incorrect for the test model created in opset 18 to be using a version of Exp that is so old.
Signed-off-by: Liqun Fu <[email protected]>
skottmckay added a commit that referenced this pull request Jan 12, 2023
…ing pipeline (#14259)

### Description
<!-- Describe your changes. -->
Skip tests for opset18 models that we haven't implemented kernels for
yet.

Slice was checked in today so those failures should go away.

Resize: #13890 (all resize failures are fixed by this PR as confirmed in
output
[here](https://dev.azure.com/aiinfra/530acbc4-21bc-487d-8cd8-348ff451d2ff/_apis/build/builds/264725/logs/729))
Col2Im: #12311
ScatterND and ScatterElement: #14224
Pad (should also fix CenterCropPad failures): #14219 Bitwise ops: #14197
Optional: Unknown if we're intending to support this in 1.14

Not sure about SoftPlus as that is failing due to `Could not find an
implementation for Exp(1)`. ORT supports Exp from opset 6 and on, and it
seems incorrect for the test model created for opset 18 to be using a
version of Exp that is so old. Would have expected it to use the latest
- Exp(13). @liqunfu is this something that requires a fix to the ONNX
model?


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Fix pipeline
@liqunfu liqunfu closed this Jan 17, 2023
@liqunfu liqunfu reopened this Jan 17, 2023
docs/ContribOperators.md Outdated Show resolved Hide resolved
onnxruntime/core/providers/cpu/tensor/pad.cc Outdated Show resolved Hide resolved
onnxruntime/core/providers/cpu/tensor/pad.cc Outdated Show resolved Hide resolved
onnxruntime/core/providers/cpu/tensor/pad.cc Outdated Show resolved Hide resolved
onnxruntime/core/providers/cpu/tensor/pad.cc Outdated Show resolved Hide resolved
onnxruntime/core/providers/cpu/tensor/pad.cc Show resolved Hide resolved
Signed-off-by: Liqun Fu <[email protected]>
Signed-off-by: Liqun Fu <[email protected]>
@@ -805,5 +805,28 @@ TEST(PadOpTest, BoolType) {
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
}

TEST(PadOpTest, ConstantPadAxes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please add more tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The feature added to Pad(18) is with pad axes input. One new test case was added in ONNX for this new feature. Here the similar unit test is added to test the new feature.

const Tensor* axes_tensor = ctx->Input<Tensor>(3);
if (axes_tensor) {
const auto& axes_tensor_dims = axes_tensor->Shape().GetDims();
ORT_ENFORCE(axes_tensor_dims.size() == 1, "Axes tensor should be a 1D tensor ");
Copy link
Contributor

Choose a reason for hiding this comment

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

I know some of the code is old here and it has established a practice that it's ok to use ORT_ENFORCE in a Compute method. Since Compute already returns a Status we should try to return a Status with INVALID_ARGUMENT code.

@liqunfu liqunfu merged commit 05915d8 into main Jan 23, 2023
@liqunfu liqunfu deleted the liqun/pad branch January 23, 2023 20:14
@faxu faxu added the triage:approved Approved for cherrypicks for release label Jan 25, 2023
rui-ren pushed a commit that referenced this pull request Jan 27, 2023
@faxu faxu removed the release:1.14 label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage:approved Approved for cherrypicks for release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants