-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[MXNET-651] MXNet Model Backwards Compatibility Checker #11626
Changes from 16 commits
4ee8b21
118850f
27863fd
b3e9774
c141701
35cbefb
418f805
600efaf
d73b9e2
3eeba08
9c0157c
3d43bcd
4b70e4a
08ad342
5d1c3fc
cfe8dfc
7c41488
50be5d8
c3c9129
3485352
af9b86d
79cfa46
4df779b
04465b0
2d5cf09
7bfdf87
c80ee31
e764d5a
05ded05
60c7be0
9d4d099
d08ba5a
cebfb26
f7a36eb
1f63941
fbaf3e0
edd6816
87103d4
eb24e8e
3525656
25e7ec7
00ee6e7
a3a72b8
86e8882
ddb672a
9e77064
69843fb
fae44fe
c099979
ffcc637
7f7f6e3
33096c0
8a085b5
5207ab1
5e30f7a
e079d3c
ceac705
16d320a
19495d6
d8fa75d
ca01aa2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -854,6 +854,27 @@ nightly_test_javascript() { | |
| make -C /work/mxnet/amalgamation libmxnet_predict.js MIN=1 EMCC=/work/deps/emscripten/emcc | ||
| } | ||
|
|
||
| #Tests Model backwards compatibility on MXNet | ||
| nightly_model_backwards_compat_test() { | ||
| set -ex | ||
| export PYTHONPATH=./python/ | ||
| pip install boto3 | ||
| ./tests/nightly/model_backwards_compatibility_check/model_backward_compat_checker.sh | ||
| } | ||
|
|
||
| #Backfills S3 bucket with models trained on earlier versions of mxnet | ||
| nightly_model_backwards_compat_train() { | ||
| set -ex | ||
| export PYTHONPATH=./python/ | ||
| VENV=mbcc_py2_venv | ||
| virtualenv -p `which python2` $VENV | ||
|
||
| source $VENV/bin/activate | ||
| pip install boto3 | ||
piyushghai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ./tests/nightly/model_backwards_compatibility_check/train_mxnet_legacy_models.sh | ||
| #Deactivate the virtual env once we are done with it | ||
| deactivate | ||
| } | ||
|
|
||
| # Deploy | ||
|
|
||
| deploy_docs() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| // -*- mode: groovy -*- | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
|
|
||
| //This is a Jenkinsfile for the model backwards compatibility checker. The format and some functions have been picked up from the top-level Jenkinsfile. | ||
piyushghai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| err = null | ||
|
|
||
| def init_git() { | ||
| deleteDir() | ||
| retry(5) { | ||
| try { | ||
| timeout(time: 15, unit: 'MINUTES') { | ||
| checkout scm | ||
| sh 'git submodule update --init --recursive' | ||
| sh 'git clean -d -f' | ||
| } | ||
| } catch (exc) { | ||
| deleteDir() | ||
| error "Failed to fetch source codes with ${exc}" | ||
| sleep 2 | ||
| } | ||
| } | ||
| } | ||
|
|
||
| def docker_run(platform, function_name, use_nvidia, shared_mem = '500m') { | ||
| def command = "ci/build.py --docker-registry ${env.DOCKER_CACHE_REGISTRY} %USE_NVIDIA% --platform %PLATFORM% --shm-size %SHARED_MEM% /work/runtime_functions.sh %FUNCTION_NAME%" | ||
| command = command.replaceAll('%USE_NVIDIA%', use_nvidia ? '--nvidiadocker' : '') | ||
| command = command.replaceAll('%PLATFORM%', platform) | ||
| command = command.replaceAll('%FUNCTION_NAME%', function_name) | ||
| command = command.replaceAll('%SHARED_MEM%', shared_mem) | ||
|
|
||
| sh command | ||
| } | ||
|
|
||
| try { | ||
| stage('MBCC'){ | ||
| parallel 'ModelBackwardsCompat: CPU': { | ||
| node('mxnetlinux-cpu') { | ||
| ws('workspace/modelBackwardsCompat') { | ||
| init_git() | ||
| docker_run('ubuntu_nightly_cpu', 'nightly_model_backwards_compat_test', false) | ||
| } | ||
|
||
| } | ||
| } | ||
| } | ||
| } catch (caughtError) { | ||
| node("mxnetlinux-cpu") { | ||
| sh "echo caught ${caughtError}" | ||
| err = caughtError | ||
| currentBuild.result = "FAILURE" | ||
| } | ||
| } finally { | ||
| node("mxnetlinux-cpu") { | ||
| // Only send email if model backwards compat test failed | ||
| if (currentBuild.result == "FAILURE") { | ||
| emailext body: 'Nightly tests for model backwards compatibity on MXNet branch : ${BRANCH_NAME} failed. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[MODEL BACKWARDS COMPATIBILITY TEST FAILED] build ${BUILD_NUMBER}', to: '${EMAIL}' | ||
| } | ||
| // Remember to rethrow so the build is marked as failing | ||
| if (err) { | ||
| throw err | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Model Backwards Compatibility Tests | ||
|
|
||
| This folder contains the scripts that are required to run the nightly job of verifying the compatibility and inference results of models (trained on earlier versions of MXNet) when loaded on the latest release candidate. The tests flag if: | ||
| - The models fail to load on the latest version of MXNet. | ||
| - The inference results are different. | ||
|
|
||
|
|
||
| ## JenkinsfileForMBCC | ||
| This is configuration file for jenkins job. | ||
|
|
||
| ## Details | ||
| - The `model_backward_compat_checker.sh` is a top level script that invokes the inference files in python. | ||
| - Currently the APIs that covered for model saving/loading are : do_checkpoint/load_checkpoint, save_params/load_params, save_parameters/load_parameters(added v1.2.1 onwards), export/gluon.SymbolBlock.imports. | ||
| - These APIs are covered over models with architectures such as : MLP, RNNs, LeNet covering the four scenarios described above. | ||
| - More operators/models will be added in the future to extend the operator coverage. | ||
| - The model train files suffixed by `_train.py` and the trained models are hosted in AWS S3. | ||
| - The trained models for now are backfilled into S3 starting from every MXNet release version v1.1.0. | ||
| - The script for training the models on older versions of MXNet is : `train_mxnet_legacy_models.sh`. | ||
| - The inference files are suffixed by `_inference.py`. | ||
|
|
Uh oh!
There was an error while loading. Please reload this page.