Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ctuning/mlcommons-ck
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Feb 2, 2024
2 parents 86c0bbb + 1538c06 commit 418fe68
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 44 deletions.
2 changes: 1 addition & 1 deletion cm-mlops/automation/script/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"desc": "Making native scripts more portable, interoperable and deterministic",
"developers": "[Arjun Suresh](https://www.linkedin.com/in/arjunsuresh), [Grigori Fursin](https://cKnowledge.org/gfursin)",
"actions_with_help":["run"],
"actions_with_help":["run", "docker"],
"sort": 1000,
"tags": [
"automation"
Expand Down
41 changes: 1 addition & 40 deletions cm-mlops/automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,46 +652,7 @@ def run(self, i):

# Check if has --help
if i.get('help',False):
print ('')
print ('Help for this CM script (automation recipe):')

variations = meta.get('variations',{})
if len(variations)>0:
print ('')
print ('Available variations:')
print ('')
for v in sorted(variations):
print (' _'+v)

input_mapping = meta.get('input_mapping', {})
if len(input_mapping)>0:
print ('')
print ('Available flags mapped to environment variables:')
print ('')
for k in sorted(input_mapping):
v = input_mapping[k]

print (' --{} -> --env.{}'.format(k,v))

input_description = meta.get('input_description', {})
if len(input_description)>0:
print ('')
print ('Available flags (Python API dict keys):')
print ('')
for k in sorted(input_description):
v = input_description[k]
n = v.get('desc','')

x = ' --'+k
if n!='': x+=' ({})'.format(n)

print (x)


print ('')
input ('Press Enter to see common flags for all scripts')

return {'return':0}
return utils.call_internal_module(self, __file__, 'module_help', 'print_help', {'meta':meta, 'path':path})


deps = meta.get('deps',[])
Expand Down
51 changes: 51 additions & 0 deletions cm-mlops/automation/script/module_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import os
from cmind import utils

# Pring help about script
def print_help(i):

meta = i['meta']
path = i['path']

print ('')
print ('Help for this CM script ({},{}):'.format(meta.get('alias',''), meta.get('uid','')))

print ('')
print ('Path to this automation recipe: {}'.format(path))

variations = meta.get('variations',{})
if len(variations)>0:
print ('')
print ('Available variations:')
print ('')
for v in sorted(variations):
print (' _'+v)

input_mapping = meta.get('input_mapping', {})
if len(input_mapping)>0:
print ('')
print ('Available flags mapped to environment variables:')
print ('')
for k in sorted(input_mapping):
v = input_mapping[k]

print (' --{} -> --env.{}'.format(k,v))

input_description = meta.get('input_description', {})
if len(input_description)>0:
print ('')
print ('Available flags (Python API dict keys):')
print ('')
for k in sorted(input_description):
v = input_description[k]
n = v.get('desc','')

x = ' --'+k
if n!='': x+=' ({})'.format(n)

print (x)

print ('')
input ('Press Enter to see common flags for all scripts')

return {'return':0}
3 changes: 3 additions & 0 deletions cm-mlops/automation/script/module_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,9 @@ def docker(i):

meta = artifact.meta

if i.get('help',False):
return utils.call_internal_module(self_module, __file__, 'module_help', 'print_help', {'meta':meta, 'path':artifact.path})

script_path = artifact.path

tags = meta.get("tags", [])
Expand Down
8 changes: 7 additions & 1 deletion cm-mlops/script/get-lib-armnn/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"automation_uid": "5b4e0237da074764",
"cache": true,
"category": "Detection or installation of tools and artifacts",
"default_version": "23.05",
"default_version": "23.11",
"deps": [
{
"tags": "detect,os"
Expand Down Expand Up @@ -36,6 +36,12 @@
],
"uid": "9603a2e90fd44587",
"versions": {
"23.11": {
"env": {
"CM_LIB_ARMNN_VERSION": "v23.11",
"CM_TMP_GIT_BRANCH_NAME": "branches/armnn_23_11"
}
},
"23.05": {
"env": {
"CM_LIB_ARMNN_VERSION": "v23.05",
Expand Down
4 changes: 2 additions & 2 deletions cm-mlops/script/run-all-mlperf-models/run-mobilenet-models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ function run() {
}
POWER=" --power=yes --adr.mlperf-power-client.power_server=192.168.0.15 --adr.mlperf-power-client.port=4940 "
POWER=""
extra_option=" --adr.mlperf-inference-implementation.compressed_dataset=on"
extra_option=""
extra_tags=""
extra_tags=",_only-fp32"
#extra_option=" --adr.mlperf-inference-implementation.compressed_dataset=on"
#extra_tags=",_only-fp32"


#Add your run commands here...
Expand Down
11 changes: 11 additions & 0 deletions cm-mlops/script/run-mlperf-inference-mobilenet-models/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ def preprocess(i):
if env.get('CM_TEST_ONE_RUN', '') == "yes":
return {'return':0}

clean_input = {
'action': 'rm',
'automation': 'cache',
'tags': 'get,preprocessed,dataset,_for.mobilenet',
'quiet': True,
'v': verbose,
'f': 'True'
}
r = cmind.access(clean_input)
#if r['return'] > 0:
# return r
return {'return':0}

def postprocess(i):
Expand Down

0 comments on commit 418fe68

Please sign in to comment.