Skip to content

Commit 0f6da5b

Browse files
committed
Turn off export_json by default for geekbench
1 parent 639f5d5 commit 0f6da5b

3 files changed

Lines changed: 41 additions & 41 deletions

File tree

script/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MLCommons Automation Scripts
22

3-
*Last updated: 2026-03-06 02:02:38*
3+
*Last updated: 2026-03-06 15:28:35*
44

55
This directory contains automation scripts for MLPerf benchmarks, AI/ML workflows, and development operations.
66

script/benchmark-program-geekbench/customize.py

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,15 @@ def preprocess(i):
4444
args.append('--no-upload')
4545

4646
# Export results as JSON
47-
results_dir = env.get('MLC_GEEKBENCH_RESULTS_DIR', os.getcwd())
48-
os.makedirs(results_dir, exist_ok=True)
49-
results_file = os.path.join(results_dir, 'geekbench_results.json')
50-
args.append('--export-json')
51-
if os_info['platform'] == 'windows':
47+
if is_true(env.get('MLC_GEEKBENCH_EXPORT_JSON', 'yes')):
48+
results_dir = env.get('MLC_GEEKBENCH_RESULTS_DIR', os.getcwd())
49+
os.makedirs(results_dir, exist_ok=True)
50+
results_file = os.path.join(results_dir, 'geekbench_results.json')
51+
args.append('--export-json')
5252
args.append(f'"{results_file}"')
53-
else:
54-
args.append(f"'{results_file}'")
5553

56-
env['MLC_GEEKBENCH_RESULTS_FILE'] = results_file
57-
env['MLC_GEEKBENCH_RESULTS_DIR'] = results_dir
54+
env['MLC_GEEKBENCH_RESULTS_FILE'] = results_file
55+
env['MLC_GEEKBENCH_RESULTS_DIR'] = results_dir
5856

5957
cmd = f"{q}{geekbench_bin}{q} {' '.join(args)}"
6058

@@ -75,36 +73,37 @@ def postprocess(i):
7573

7674
results_file = env.get('MLC_GEEKBENCH_RESULTS_FILE', '')
7775

78-
if results_file and os.path.isfile(results_file):
79-
logger.info(f"Geekbench results saved to: {results_file}")
80-
81-
try:
82-
with open(results_file, 'r') as f:
83-
results = json.load(f)
84-
85-
# Extract key scores from the results JSON
86-
if 'score' in results:
87-
env['MLC_GEEKBENCH_SCORE'] = str(results['score'])
88-
logger.info(f"Geekbench Score: {results['score']}")
89-
90-
if 'multicore_score' in results:
91-
env['MLC_GEEKBENCH_MULTICORE_SCORE'] = str(
92-
results['multicore_score'])
93-
logger.info(
94-
f"Geekbench Multi-Core Score: {results['multicore_score']}")
95-
96-
if 'single_core_score' in results:
97-
env['MLC_GEEKBENCH_SINGLE_CORE_SCORE'] = str(
98-
results['single_core_score'])
99-
logger.info(
100-
f"Geekbench Single-Core Score: {results['single_core_score']}")
101-
102-
state['geekbench_results'] = results
103-
104-
except Exception as e:
105-
logger.warning(f"Could not parse Geekbench results: {e}")
106-
else:
107-
logger.warning(
108-
"Geekbench results file not found. The benchmark may not have completed successfully.")
76+
if results_file:
77+
if os.path.isfile(results_file):
78+
logger.info(f"Geekbench results saved to: {results_file}")
79+
80+
try:
81+
with open(results_file, 'r') as f:
82+
results = json.load(f)
83+
84+
# Extract key scores from the results JSON
85+
if 'score' in results:
86+
env['MLC_GEEKBENCH_SCORE'] = str(results['score'])
87+
logger.info(f"Geekbench Score: {results['score']}")
88+
89+
if 'multicore_score' in results:
90+
env['MLC_GEEKBENCH_MULTICORE_SCORE'] = str(
91+
results['multicore_score'])
92+
logger.info(
93+
f"Geekbench Multi-Core Score: {results['multicore_score']}")
94+
95+
if 'single_core_score' in results:
96+
env['MLC_GEEKBENCH_SINGLE_CORE_SCORE'] = str(
97+
results['single_core_score'])
98+
logger.info(
99+
f"Geekbench Single-Core Score: {results['single_core_score']}")
100+
101+
state['geekbench_results'] = results
102+
103+
except Exception as e:
104+
logger.warning(f"Could not parse Geekbench results: {e}")
105+
else:
106+
logger.warning(
107+
"Geekbench results file not found. The benchmark may not have completed successfully.")
109108

110109
return {'return': 0}

script/benchmark-program-geekbench/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ input_mapping:
1616
license_key: MLC_GEEKBENCH_LICENSE_KEY
1717
workload: MLC_GEEKBENCH_WORKLOAD
1818
local_file: MLC_GEEKBENCH_LOCAL_FILE
19+
export_json: MLC_GEEKBENCH_EXPORT_JSON
1920
new_env_keys:
2021
- MLC_GEEKBENCH_*
2122
tags:

0 commit comments

Comments
 (0)