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] Introduce tests for Reshape, Squeeze and ExpandDims #14227

Merged
merged 5 commits into from
Dec 2, 2024

Conversation

mbencer
Copy link
Contributor

@mbencer mbencer commented Oct 16, 2024

This commit adds more tests for Reshape, Squeeze and ExpandDims. The purpose is to cover the cases where memory copying of those ops can be skipped.

ONE-DCO-1.0-Signed-off-by: Mateusz Bencer [email protected]

Draft: #14057

This commit adds more tests for Reshape, Squeeze and ExpandDims.
The purpose is to cover the cases where memory copying of those ops can be skipped.

ONE-DCO-1.0-Signed-off-by: Mateusz Bencer [email protected]
int reshape_out = cgen.addTensor({{2, 2}, circle::TensorType::TensorType_FLOAT32});
int cos2_out = cgen.addTensor({{2, 2}, circle::TensorType::TensorType_FLOAT32});

cgen.addOperatorCos({{input}, {cos1_out}});
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for curiosity,

Is there a specific reason to choose cos operator?
Did you choose cos because it is element-wise operator - which works without additional arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This cos node is needed just to not set Reshape input/output as a input/output of the whole model (in such a case sharing memory is disabled). But I see your confusion so I've wrapped it in helper function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I see your confusion so I've wrapped it in helper function.

Sorry, I've forgot to push the code last time ;)

@mbencer mbencer requested a review from zetwhite October 25, 2024 15:26
zetwhite
zetwhite previously approved these changes Oct 31, 2024
@hseok-oh
Copy link
Contributor

hseok-oh commented Nov 18, 2024

@mbencer Please add negative test: same or more negative test with positive test to fulfill release criteria.

@mbencer
Copy link
Contributor Author

mbencer commented Nov 20, 2024

@mbencer Please add negative test: same or more negative test with positive test to fulfill release criteria.

I see the argument about release criteria. Due to fact that compilation/inference should run without errors both with and without my optimization it's hard to write such negative unit test explicitly.

To fulfill the requirements I've just added some general negative tests for the related operators. Now only 5 (at least 12 is expected). If you are ok with such approach I'll try to add more. Already added expected 12 negative tests.

@mbencer
Copy link
Contributor Author

mbencer commented Nov 20, 2024

FYI: I will be on vacation until 26 (Nov) so please expect delays in communication ;-)

@mbencer
Copy link
Contributor Author

mbencer commented Nov 26, 2024

@mbencer Please add negative test: same or more negative test with positive test to fulfill release criteria.

I see the argument about release criteria. Due to fact that compilation/inference should run without errors both with and without my optimization it's hard to write such negative unit test explicitly.

To fulfill the requirements I've just added some general negative tests for the related operators.

@hseok-oh Please let me know if you are ok with such approach ;)

@mbencer mbencer requested a review from zetwhite November 26, 2024 16:32
@hseok-oh
Copy link
Contributor

@nnfw-bot test onert-x64-release

@@ -75,6 +75,25 @@ TEST_F(GenModelTest, OneOp_neg_ExpandDims_Axis)
SUCCEED();
}

TEST_F(GenModelTest, OneOp_neg_ExpandDims_NegAxis)
Copy link
Contributor

Choose a reason for hiding this comment

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

Negative test's name should start with neg_. Please remove OneOp_ prefix. (Same on other negative 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.

done

Copy link
Contributor

@hseok-oh hseok-oh left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ragmani ragmani left a comment

Choose a reason for hiding this comment

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

LGTM

@hseok-oh
Copy link
Contributor

@zetwhite @glistening ping

Copy link
Contributor

@glistening glistening left a comment

Choose a reason for hiding this comment

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

LGTM

@hseok-oh hseok-oh merged commit e5d253d into Samsung:master Dec 2, 2024
9 checks passed
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.

5 participants