Skip to content

Commit 2ae745b

Browse files
authored
Support multi group version match, fix llvm-version string (mlcommons#717)
1 parent 48de264 commit 2ae745b

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/test-mlperf-inference-abtf-poc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
os: [ubuntu-22.04, ubuntu-latest, macos-latest, macos-13, windows-latest]
18+
os: [ubuntu-24.04, ubuntu-latest, macos-latest, macos-15, windows-latest]
1919
python-version: [ "3.8", "3.12" ]
2020
backend: [ "pytorch" ]
2121
implementation: [ "python" ]

automation/script/module.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(self, action_object, automation_file):
100100
'verify_ssl': {'desc': 'Verify SSL', 'default': False}
101101
}
102102

103-
############################################################
103+
#################################################################
104104

105105
def run(self, i):
106106
"""
@@ -4501,6 +4501,11 @@ def parse_version(self, i):
45014501

45024502
if r['match'].lastindex and r['match'].lastindex >= group_number:
45034503
version = r['match'].group(group_number)
4504+
if i.get(
4505+
'group_number_extra') and r['match'].lastindex >= i['group_number_extra']:
4506+
join_string = i.get('group_join_string', '-')
4507+
group_number_extra = i['group_number_extra']
4508+
version += f"{join_string}{r['match'].group(group_number_extra)}"
45044509
else:
45054510
return {'return': 1, 'error': 'Invalid version detection group number. Version was not detected. Last index of match = {}. Given group number = {}'.format(
45064511
r['match'].lastindex, group_number)}

script/get-llvm/customize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ def preprocess(i):
4848

4949
def detect_version(i):
5050

51-
r = i['automation'].parse_version({'match_text': r'clang version\s+([\w.]+(?:.*?\s([0-9a-f]{7,40}))?)',
51+
r = i['automation'].parse_version({'match_text': r'clang version\s+([\w.]+)(?:.*?\s([0-9a-f]{8})[0-9a-f]{0,32})?',
5252
'group_number': 1,
53+
'group_number_extra': 2,
5354
'env_key': 'MLC_LLVM_CLANG_VERSION',
5455
'which_env': i['env']})
5556
if r['return'] > 0:

0 commit comments

Comments
 (0)