Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

ONNX import/export: Add missing tests, ONNX export: LogSoftMax #13654

Merged
merged 4 commits into from
Dec 28, 2018

Conversation

vandanavk
Copy link
Contributor

@vandanavk vandanavk commented Dec 14, 2018

Description

Adding tests for operators that can currently be exported/imported from/to ONNX. Correcting the name of some tests. Added ONNX export of LogSoftMax too.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

ONNX export:

  • All matmul tests have been enabled
  • test_softplus, test_lrn, test_dropout, test_unsqueeze was missing before - added now
  • enabled tests which have the string 'broadcast' in them
  • Add default test for flatten
  • test_log_ covers onnx operator test test_log*, PyTorch Converted model test test_log_softmax*
  • test_elu, test_leakyrelu, test_relu, test_tanh all have onnx operator tests - removing from basic model tests

ONNX import:

  • there is no test "test_random" - removed this
  • All matmul tests have been enabled
  • test_dropout, test_gather, test_log, test_leakyrelu, test_elu, test_max have been enabled
  • test_elu, test_leakyrelu, test_relu, test_tanh, test_sigmoid all have onnx operator tests - removing from basic model tests
  • Add default test for flatten
  • test_log_ covers onnx operator test test_log*, PyTorch Converted model test test_log_softmax*

Comments

  • Executed onnx_backend_test, mxnet_backend_test, gluon_backend_test
  • ONNX operator tests for test_logsoftmax* is giving a different result compared to MXNet leading to test failure - will verify this manually and enable in a later PR

@vandanavk
Copy link
Contributor Author

@mxnet-label-bot add [ONNX, pr-awaiting-review]

@marcoabreu marcoabreu added ONNX pr-awaiting-review PR is waiting for code review labels Dec 14, 2018
Copy link
Contributor

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

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

LGTM!

@vandanavk
Copy link
Contributor Author

@mxnet-label-bot update [ONNX, pr-awaiting-merge]

@marcoabreu marcoabreu added pr-awaiting-merge Review and CI is complete. Ready to Merge and removed pr-awaiting-review PR is waiting for code review labels Dec 17, 2018
Copy link
Member

@anirudhacharya anirudhacharya left a comment

Choose a reason for hiding this comment

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

can you please explain why some of the tests have been removed?

tests/python-pytest/onnx/import/test_cases.py Outdated Show resolved Hide resolved
tests/python-pytest/onnx/import/test_cases.py Outdated Show resolved Hide resolved
tests/python-pytest/onnx/import/test_cases.py Outdated Show resolved Hide resolved
@vandanavk
Copy link
Contributor Author

@mxnet-label-bot update [ONNX, pr-work-in-progress]

@marcoabreu marcoabreu added pr-work-in-progress PR is still work in progress and removed pr-awaiting-merge Review and CI is complete. Ready to Merge labels Dec 17, 2018
@vandanavk vandanavk requested a review from szha as a code owner December 17, 2018 19:22
@vandanavk vandanavk force-pushed the onnx_unit_tests branch 2 times, most recently from e155725 to a1ccc7f Compare December 17, 2018 19:47
@vandanavk
Copy link
Contributor Author

@mxnet-label-bot update [ONNX, pr-awaiting-review]

@marcoabreu marcoabreu added pr-awaiting-review PR is waiting for code review and removed pr-work-in-progress PR is still work in progress labels Dec 17, 2018
@vandanavk vandanavk changed the title ONNX import/export: Add missing tests ONNX import/export: Add missing tests, ONNX export: LogSoftMax Dec 17, 2018
Copy link
Contributor

@sandeep-krishnamurthy sandeep-krishnamurthy left a comment

Choose a reason for hiding this comment

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

Thanks one minor comment.

python/mxnet/contrib/onnx/mx2onnx/_op_translations.py Outdated Show resolved Hide resolved
@sandeep-krishnamurthy sandeep-krishnamurthy added pr-awaiting-merge Review and CI is complete. Ready to Merge and removed pr-awaiting-review PR is waiting for code review labels Dec 26, 2018
Copy link
Contributor

@sandeep-krishnamurthy sandeep-krishnamurthy left a comment

Choose a reason for hiding this comment

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

Great thanks for fixing other operator error messaging as well!

@sandeep-krishnamurthy sandeep-krishnamurthy merged commit be3d945 into apache:master Dec 28, 2018
rondogency pushed a commit to rondogency/incubator-mxnet that referenced this pull request Jan 9, 2019
…e#13654)

* Logsoftmax, missing tests

* Support multiple outputs in Gluon backendrep

* Remove repeated unsqueeze test

* Allow multiple output support
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
…e#13654)

* Logsoftmax, missing tests

* Support multiple outputs in Gluon backendrep

* Remove repeated unsqueeze test

* Allow multiple output support
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ONNX pr-awaiting-merge Review and CI is complete. Ready to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants