-
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.
- Loading branch information
Showing
21 changed files
with
381 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# About | ||
|
||
Activate python virtual environment installed via CM: | ||
|
||
```bash | ||
cm run script "activate python-ven" (--version={python version}) (--name={user friendly name of the virtual environment)) | ||
``` |
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
"names": [ | ||
"python-venv" | ||
], | ||
"reuse_version": true, | ||
"tags": "install,python-venv" | ||
} | ||
], | ||
|
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Get MLCommons Training Source | ||
This [CM script](https://github.com/mlcommons/ck/blob/master/cm/docs/tutorial-scripts.md) git clones the [MLCommons Training repository](https://github.com/mlcommons/training). | ||
|
||
## Commands | ||
To install | ||
``` | ||
cm run script --tags=get,mlperf,training,src,[VARIATION] --version=[VERSION] | ||
``` | ||
where [VARIATION] is one of | ||
* `default:` Works with the official MLCommons inference repository. Uses `short-history` variation | ||
* `patch:` Applies the `git.patch` to the cloned git repository | ||
* `octoml:` Works with the OctoML fork of the MLCommons inference repository. Uses `short-history` variation | ||
* `short-history:` Uses a git depth of last 10 commits (significantly reduces the download size) | ||
* `full-history:` Uses the full git history | ||
* `no-recurse-submodules:` Only download the main repository | ||
|
||
[VERSION] is one of | ||
* `master:` Uses the master branch | ||
* `r2.1:` Uses the release branch used for MLCommons training 2.1 round | ||
|
||
## Exported Variables | ||
* `CM_MLPERF_TRAINING_SOURCE`: Directory path of the cloned inference repository | ||
* `PYTHONPATH`: Is appended with the paths to vision module and the submission tools module | ||
|
||
## Supported and Tested OS | ||
1. Ubuntu 18.04, 20.04, 22.04 | ||
2. RHEL 9 |
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,93 @@ | ||
{ | ||
"alias": "get-mlperf-training-src", | ||
"automation_alias": "script", | ||
"automation_uid": "5b4e0237da074764", | ||
"cache": true, | ||
"category": "Modular MLPerf benchmarks", | ||
"default_env": { | ||
"CM_GIT_CHECKOUT": "master", | ||
"CM_GIT_DEPTH": "--depth 4", | ||
"CM_GIT_PATCH": "no", | ||
"CM_GIT_RECURSE_SUBMODULES": " --recurse-submodules", | ||
"CM_GIT_URL": "https://github.com/mlcommons/training.git" | ||
}, | ||
"default_variation": "default", | ||
"default_version": "master", | ||
"deps": [ | ||
{ | ||
"tags": "detect,os" | ||
}, | ||
{ | ||
"names": [ | ||
"python", | ||
"python3" | ||
], | ||
"tags": "get,python3" | ||
} | ||
], | ||
"new_env_keys": [ | ||
"CM_MLPERF_TRAINING_*", | ||
"CM_MLPERF_TRAINING_LAST_RELEASE", | ||
"+PYTHONPATH" | ||
], | ||
"tags": [ | ||
"get", | ||
"src", | ||
"source", | ||
"training", | ||
"training-src", | ||
"training-source", | ||
"mlperf", | ||
"mlcommons" | ||
], | ||
"uid": "dc440bd88e794a28", | ||
"variations": { | ||
"default": { | ||
"base": [ | ||
"short-history" | ||
], | ||
"env": { | ||
"CM_GIT_PATCH": "no" | ||
} | ||
}, | ||
"full-history": { | ||
"env": { | ||
"CM_GIT_DEPTH": "" | ||
} | ||
}, | ||
"no-recurse-submodules": { | ||
"env": { | ||
"CM_GIT_RECURSE_SUBMODULES": "" | ||
} | ||
}, | ||
"patch": { | ||
"env": { | ||
"CM_GIT_PATCH": "yes" | ||
} | ||
}, | ||
"short-history": { | ||
"env": { | ||
"CM_GIT_DEPTH": "--depth 5" | ||
} | ||
} | ||
}, | ||
"versions": { | ||
"custom": { | ||
"env": { | ||
"CM_MLPERF_LAST_RELEASE": "v2.1" | ||
} | ||
}, | ||
"master": { | ||
"env": { | ||
"CM_GIT_CHECKOUT": "master", | ||
"CM_MLPERF_LAST_RELEASE": "v2.1" | ||
} | ||
}, | ||
"r2.1": { | ||
"env": { | ||
"CM_GIT_CHECKOUT": "r2.1", | ||
"CM_MLPERF_LAST_RELEASE": "v2.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,41 @@ | ||
from cmind import utils | ||
import os | ||
import shutil | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
if os_info['platform'] == 'windows': | ||
return {'return':1, 'error': 'Windows is not supported in this script yet'} | ||
|
||
env = i['env'] | ||
meta = i['meta'] | ||
|
||
if 'CM_GIT_DEPTH' not in env: | ||
env['CM_GIT_DEPTH'] = '' | ||
|
||
if 'CM_GIT_RECURSE_SUBMODULES' not in env: | ||
env['CM_GIT_RECURSE_SUBMODULES'] = '' | ||
|
||
need_version = env.get('CM_VERSION','') | ||
versions = meta['versions'] | ||
|
||
if need_version!='' and not need_version in versions: | ||
env['CM_GIT_CHECKOUT'] = need_version | ||
|
||
return {'return':0} | ||
|
||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
state = i['state'] | ||
|
||
env['CM_MLPERF_TRAINING_SOURCE'] = os.path.join(os.getcwd(), 'training') | ||
|
||
# 20221024: we save and restore env in the main script and can clean env here for determinism | ||
# if '+PYTHONPATH' not in env: env['+PYTHONPATH'] = [] | ||
env['+PYTHONPATH']=[] | ||
|
||
return {'return':0} |
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,27 @@ | ||
#!/bin/bash | ||
|
||
CUR_DIR=$PWD | ||
SCRIPT_DIR=${CM_TMP_CURRENT_SCRIPT_PATH} | ||
|
||
echo "******************************************************" | ||
echo "Cloning Mlcommons from ${CM_GIT_URL} with branch ${CM_GIT_CHECKOUT} ${CM_GIT_DEPTH} ${CM_GIT_RECURSE_SUBMODULES}..." | ||
|
||
if [ ! -d "training" ]; then | ||
if [ -z ${CM_GIT_SHA} ]; then | ||
git clone ${CM_GIT_RECURSE_SUBMODULES} -b "${CM_GIT_CHECKOUT}" ${CM_GIT_URL} ${CM_GIT_DEPTH} training | ||
cd training | ||
else | ||
git clone ${CM_GIT_RECURSE_SUBMODULES} ${CM_GIT_URL} ${CM_GIT_DEPTH} training | ||
cd training | ||
git checkout -b "${CM_GIT_CHECKOUT}" | ||
fi | ||
if [ "${?}" != "0" ]; then exit 1; fi | ||
fi | ||
|
||
if [ ${CM_GIT_PATCH} == "yes" ]; then | ||
patch_filename=${CM_GIT_PATCH_FILENAME:-git.patch} | ||
echo "Applying patch ${SCRIPT_DIR}/patch/$patch_filename" | ||
git apply ${SCRIPT_DIR}/patch/"$patch_filename" | ||
if [ "${?}" != "0" ]; then exit 1; fi | ||
fi | ||
cd "$CUR_DIR" |
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
Oops, something went wrong.