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

[v1.x] Tool to help update/restore onnx support #19876

Open
wants to merge 4 commits into
base: v1.x
Choose a base branch
from

Conversation

Zha0q1
Copy link
Contributor

@Zha0q1 Zha0q1 commented Feb 9, 2021

As we frequently improve our ONNX support, users might want to get timely access to the latest changes. However, MXNet releases might not happen as frequent as the users would want and they might have other compatibility concerns to update the entire mxnet module. To help with this, this pr adds a simple tool to update(replace) and restore the mxnet/contrib/onnx folder to the latest version on github. For example, a user that has mxnet 1.7 installed can use this script to get the latest onnx support without updating mxnet to a later version. This script helps make our onnx support more accessible and users can report bugs back and expect them fixed more easily.

The script will automatically find the currently installed mxnet. The original files will be backuped to mxnet/contrib/onnx/backup. --branch option controls which mxnet branch to checkout and if --restore option is specified then files in backup will be restored.

To update to changes in v1.x

python update_onnx.py

To update to changes in a specific branch

python update_onnx.py --branch <branch>

To restore the original files

python update_onnx.py --restore

@Zha0q1 Zha0q1 requested a review from szha as a code owner February 9, 2021 23:41
@mxnet-bot
Copy link

Hey @Zha0q1 , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [windows-cpu, website, clang, centos-cpu, windows-gpu, centos-gpu, edge, unix-gpu, unix-cpu, miscellaneous, sanity]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Feb 9, 2021
@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Feb 10, 2021
@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Feb 12, 2021
@lanking520 lanking520 added pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-work-in-progress PR is still work in progress labels Feb 15, 2021
# Detect MXNet
print('Detected MXNet version: %s' % mxnet.__version__)
mx_path = os.path.abspath(mxnet.__file__)
mx_path = mx_path[:mx_path.rfind('/')]
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to use os.path.join(mx_path, "..", "contrib", "onnx"), so this will work in windows as well.

logging.error('ONNX backup path not found. %s does not exist' % backup_path)

# Restore backup
os.chdir(onnx_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

For this to work on windows, could you just check if the backup path exists and move it back then? The find/cp/rm commands won't work under windows.

@lanking520 lanking520 added pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Feb 15, 2021
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Mar 14, 2022
@mseth10 mseth10 added pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Mar 24, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Apr 9, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels May 4, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Nov 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-testing PR is reviewed and waiting CI build and test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants