Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for mlperf-inference #14

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions script/app-mlperf-inference/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,28 @@ def postprocess(i):

if env.get('CM_HOST_SYSTEM_NAME','')!='': host_info['system_name']=env['CM_HOST_SYSTEM_NAME']

# Check CM automation repository
repo_name = 'mlcommons@cm4mlops'
repo_hash = ''
r = cm.access({'action':'find', 'automation':'repo', 'artifact':'mlcommons@cm4mlops,9e97bb72b0474657'})
if r['return']==0 and len(r['list'])==1:
repo_path = r['list'][0].path
if os.path.isdir(repo_path):
repo_name = os.path.basename(repo_path)

# Check dev
if repo_name == 'cm4mlops': repo_name = 'gateoverflow@cm4mlops'

r = cm.access({'action':'system',
'automation':'utils',
'path':repo_path,
'cmd':'git rev-parse HEAD'})
if r['return'] == 0 and r['ret'] == 0:
repo_hash = r['stdout']

host_info['cm_repo_name'] = repo_name
host_info['cm_repo_git_hash'] = repo_hash

with open ("cm-host-info.json", "w") as fp:
fp.write(json.dumps(host_info, indent=2)+'\n')

Expand All @@ -268,8 +290,8 @@ def postprocess(i):

readme_init+= "*Check [CM MLPerf docs](https://mlcommons.github.io/inference) for more details.*\n\n"

readme_body = "## Host platform\n\n* OS version: {}\n* CPU version: {}\n* Python version: {}\n* MLCommons CM version: {}\n{}\n\n".format(platform.platform(),
platform.processor(), sys.version, cm.__version__, md_xhashes)
readme_body = "## Host platform\n\n* OS version: {}\n* CPU version: {}\n* Python version: {}\n* MLCommons CM version: {}\n\n".format(platform.platform(),
platform.processor(), sys.version, cm.__version__)

x = repo_name
if repo_hash!='': x+=' --checkout='+str(repo_hash)
Expand Down
Loading