-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating TinyMLPerf tutorials (#789)
- Loading branch information
Showing
11 changed files
with
226 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
#!/bin/bash | ||
echo $PWD | ||
if [ -e "${CM_EXTRACT_EXTRACTED_FILENAME}" ] ; then | ||
CMD=${CM_EXTRACT_EXTRACTED_CHECKSUM_CMD} | ||
echo "${CMD}" | ||
eval "${CMD}" | ||
test $? -eq 0 && exit 0 | ||
fi | ||
|
||
CMD=${CM_EXTRACT_CMD} | ||
echo ${CMD} | ||
eval ${CMD} | ||
echo "${CMD}" | ||
eval "${CMD}" | ||
test $? -eq 0 || exit $? | ||
|
||
CMD=${CM_EXTRACT_EXTRACTED_CHECKSUM_CMD} | ||
echo ${CMD} | ||
eval ${CMD} | ||
echo "${CMD}" | ||
eval "${CMD}" | ||
test $? -eq 0 || exit $? |
Binary file modified
BIN
+6.03 KB
(110%)
...-experiment/assets/cm-visualization-and-customization-of-tinymlperf-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"alias": "prepare-training-data-bert", | ||
"automation_alias": "script", | ||
"automation_uid": "5b4e0237da074764", | ||
"cache": true, | ||
"deps": [], | ||
"input_description": {}, | ||
"input_mapping": { | ||
"data_dir": "CM_DATA_DIR" | ||
}, | ||
"new_env_keys": [], | ||
"new_state_keys": [], | ||
"post_deps": [], | ||
"posthook_deps": [], | ||
"prehook_deps": [], | ||
"tags": [ | ||
"prepare", | ||
"training", | ||
"data", | ||
"input", | ||
"bert" | ||
], | ||
"uid": "1e06a7abe23545eb", | ||
"variations": { | ||
"nvidia": { | ||
"group": "implementation", | ||
"default": true, | ||
"deps": [ | ||
{ | ||
"tags": "get,git,repo,_repo.https://github.com/mlcommons/training_results_v2.1" | ||
} | ||
], | ||
"prehook_deps": [ | ||
{ | ||
"tags": "download,file,_gdown,_url.https://drive.google.com/uc?id=1fbGClQMi2CoMv7fwrwTC5YYPooQBdcFW", | ||
"env": { | ||
"CM_DOWNLOAD_FILENAME": "bert_config.json", | ||
"CM_DOWNLOAD_PATH": "<<<CM_BERT_CONFIG_DOWNLOAD_DIR>>>" | ||
} | ||
}, | ||
{ | ||
"tags": "download,file,_gdown,_url.https://drive.google.com/uc?id=1USK108J6hMM_d27xCHi738qBL8_BT1u1", | ||
"env": { | ||
"CM_DOWNLOAD_FILENAME": "vocab.txt", | ||
"CM_DOWNLOAD_PATH": "<<<CM_BERT_VOCAB_DOWNLOAD_DIR>>>" | ||
} | ||
}, | ||
{ | ||
"tags": "download,file,_gdown,_url.https://drive.google.com/uc?id=1tmMgLwoBvbEJEHXh77sqrXYw5RpqT8R_", | ||
"env": { | ||
"CM_DOWNLOAD_FILENAME": "bert_reference_results_text_md5.txt", | ||
"CM_DOWNLOAD_PATH": "<<<CM_BERT_DATA_DOWNLOAD_DIR>>>", | ||
"CM_DOWNLOAD_FINAL_ENV_NAME": "CM_BERT_REFERENCE_RESULTS_TEXT_MD5_FILE_PATH" | ||
} | ||
}, | ||
{ | ||
"tags": "download-and-extract,file,_gdown,_extract,_url.https://drive.google.com/uc?id=14xV2OUGSQDG_yDBrmbSdcDC-QGeqpfs_", | ||
"env": { | ||
"CM_DOWNLOAD_FILENAME": "results_text.tar.gz", | ||
"CM_EXTRACT_EXTRACTED_FILENAME": "results4", | ||
"CM_DOWNLOAD_PATH": "<<<CM_BERT_DATA_DOWNLOAD_DIR>>>", | ||
"CM_EXTRACT_PATH": "<<<CM_BERT_DATA_DOWNLOAD_DIR>>>", | ||
"CM_EXTRACT_EXTRACTED_CHECKSUM_FILE": "<<<CM_BERT_REFERENCE_RESULTS_TEXT_MD5_FILE_PATH>>>" | ||
} | ||
}, | ||
{ | ||
"tags": "download,file,_gdown,_url.https://drive.google.com/uc?id=1chiTBljF0Eh1U5pKs6ureVHgSbtU8OG_", | ||
"env": { | ||
"CM_DOWNLOAD_FILENAME": "model.ckpt-28252.data-00000-of-00001", | ||
"CM_DOWNLOAD_PATH": "<<<CM_BERT_CHECKPOINT_DOWNLOAD_DIR>>>" | ||
} | ||
}, | ||
{ | ||
"tags": "download,file,_gdown,_url.https://drive.google.com/uc?id=1Q47V3K3jFRkbJ2zGCrKkKk-n0fvMZsa0", | ||
"env": { | ||
"CM_DOWNLOAD_FILENAME": "model.ckpt-28252.index", | ||
"CM_DOWNLOAD_PATH": "<<<CM_BERT_CHECKPOINT_DOWNLOAD_DIR>>>" | ||
} | ||
}, | ||
{ | ||
"tags": "download,file,_gdown,_url.https://drive.google.com/uc?id=1vAcVmXSLsLeQ1q7gvHnQUSth5W_f_pwv", | ||
"env": { | ||
"CM_DOWNLOAD_FILENAME": "model.ckpt-28252.meta", | ||
"CM_DOWNLOAD_PATH": "<<<CM_BERT_CHECKPOINT_DOWNLOAD_DIR>>>" | ||
} | ||
} | ||
], | ||
"env": { | ||
"CM_TMP_VARIATION": "nvidia" | ||
} | ||
} | ||
}, | ||
"versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from cmind import utils | ||
import os | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
env = i['env'] | ||
|
||
meta = i['meta'] | ||
|
||
automation = i['automation'] | ||
|
||
quiet = (env.get('CM_QUIET', False) == 'yes') | ||
if env.get("CM_TMP_VARIATION", "") == "nvidia": | ||
datadir = env.get('CM_DATA_DIR', os.getcwd()) | ||
env['CM_BERT_CONFIG_DOWNLOAD_DIR'] = os.path.join(datadir, "phase1") | ||
env['CM_BERT_VOCAB_DOWNLOAD_DIR'] = os.path.join(datadir, "phase1") | ||
env['CM_BERT_DATA_DOWNLOAD_DIR'] = os.path.join(datadir, "download") | ||
|
||
env['CM_BERT_CHECKPOINT_DOWNLOAD_DIR'] = os.path.join(datadir, "phase1") | ||
code_path = os.path.join(env['CM_GIT_REPO_CHECKOUT_PATH'], 'NVIDIA', 'benchmarks', 'bert', 'implementations', 'pytorch-22.09') | ||
env['CM_RUN_DIR'] = code_path | ||
|
||
return {'return':0} | ||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
|
||
return {'return':1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
#CM Script location: ${CM_TMP_CURRENT_SCRIPT_PATH} | ||
|
||
#To export any variable | ||
#echo "VARIABLE_NAME=VARIABLE_VALUE" >>tmp-run-env.out | ||
|
||
#${CM_PYTHON_BIN_WITH_PATH} contains the path to python binary if "get,python" is added as a dependency | ||
|
||
|
||
|
||
function exit_if_error() { | ||
test $? -eq 0 || exit $? | ||
} | ||
|
||
function run() { | ||
echo "Running: " | ||
echo "$1" | ||
echo "" | ||
if [[ ${CM_FAKE_RUN} != 'yes' ]]; then | ||
eval "$1" | ||
exit_if_error | ||
fi | ||
} | ||
|
||
#Add your run commands here... | ||
# run "$CM_RUN_CMD" | ||
|
||
CUR=${CM_DATA_DIR:-"$PWD/data"} | ||
run "cd \"${CM_RUN_DIR}\"" | ||
run "docker build --pull -t mlperf-nvidia:language_model ." | ||
run "ID=`docker run -dt --runtime=nvidia --ipc=host -v $CUR:/workspace/bert_data mlperf-nvidia:language_model bash`" | ||
#run "docker exec $ID bash -c 'python3 -m pip install --upgrade gdown && cd /workspace/bert && ./input_preprocessing/prepare_data.sh -s --outputdir /workspace/bert_data'" | ||
run "docker exec $ID bash -c 'cd /workspace/bert && ./input_preprocessing/prepare_data.sh -s --outputdir /workspace/bert_data'" |