Skip to content

Commit b491789

Browse files
authored
Merge pull request #649 from GATEOverflow/dev
Support update_meta_if_env at script level
2 parents ab62497 + 81e4a9b commit b491789

File tree

4 files changed

+40
-22
lines changed

4 files changed

+40
-22
lines changed

.github/workflows/build_wheel_off.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- VERSION
99

10+
1011
jobs:
1112
build_wheels:
1213
if: github.repository_owner == 'mlcommons'

automation/script/module.py

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -809,14 +809,15 @@ def _run(self, i):
809809
run_state['script_entry_repo_git'] = script_item.repo.meta.get(
810810
'git', False)
811811

812-
deps = meta.get('deps', [])
813-
post_deps = meta.get('post_deps', [])
814-
prehook_deps = meta.get('prehook_deps', [])
815-
posthook_deps = meta.get('posthook_deps', [])
812+
deps = []
813+
post_deps = []
814+
prehook_deps = []
815+
posthook_deps = []
816816
input_mapping = meta.get('input_mapping', {})
817+
new_env_keys_from_meta = []
818+
new_state_keys_from_meta = []
819+
817820
docker_settings = meta.get('docker')
818-
new_env_keys_from_meta = meta.get('new_env_keys', [])
819-
new_state_keys_from_meta = meta.get('new_state_keys', [])
820821

821822
found_script_item = utils.assemble_object(
822823
meta['alias'], meta['uid'])
@@ -844,22 +845,30 @@ def _run(self, i):
844845
for key in script_item_default_env:
845846
env.setdefault(key, script_item_default_env[key])
846847

847-
# Force env from meta['env'] as a CONST
848-
# (env OVERWRITE)
849-
script_item_env = meta.get('env', {})
850-
# print(f"script meta env= {script_item_env}")
848+
# for update_meta_if_env
851849

852-
utils.merge_dicts({'dict1': env,
853-
'dict2': script_item_env,
854-
'append_lists': True,
855-
'append_unique': True})
856-
# print(f"env = {env}")
850+
r = update_state_from_meta(
851+
meta,
852+
env,
853+
state,
854+
const,
855+
const_state,
856+
deps,
857+
post_deps,
858+
prehook_deps,
859+
posthook_deps,
860+
new_env_keys_from_meta,
861+
new_state_keys_from_meta,
862+
run_state,
863+
i)
864+
if r['return'] > 0:
865+
return r
857866

858-
script_item_state = meta.get('state', {})
859-
utils.merge_dicts({'dict1': state,
860-
'dict2': script_item_state,
861-
'append_lists': True,
862-
'append_unique': True})
867+
# taking from meta or else deps with same names will be ignored
868+
deps = meta.get('deps', [])
869+
post_deps = meta.get('post_deps', [])
870+
prehook_deps = meta.get('prehook_deps', [])
871+
posthook_deps = meta.get('posthook_deps', [])
863872

864873
# Store the default_version in run_state -> may be overridden by
865874
# variations

script/get-generic-sys-util/meta.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ variations:
176176
brew: sox
177177
dnf: sox
178178
yum: ''
179+
gfortran-12-aarch64-linux-gnu:
180+
env:
181+
MLC_SYS_UTIL_NAME: gfortran-12-aarch64
182+
state:
183+
gfortran-12-aarch64: # tbd: complete for other flavours of linux
184+
apt: gfortran-12-aarch64-linux-gnu
185+
179186
gfortran-aarch64-linux-gnu:
180187
env:
181188
MLC_SYS_UTIL_NAME: gfortran-aarch64

script/install-llvm-src/meta.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ variations:
132132
cross-compile-x86-aarch64:
133133
deps:
134134
- tags: get,generic-sys-util,_crossbuild-essential-arm64
135-
- tags: get,generic-sys-util,_gfortran-aarch64-linux-gnu
135+
- tags: get,generic-sys-util,_gfortran-12-aarch64-linux-gnu
136+
136137
env:
137-
MLC_LLVM_CROSS_COMPILE_FLAGS: "-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-linux-gnu -DCMAKE_Fortran_COMPILER=aarch64-linux-gnu-gfortran -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++"
138+
MLC_LLVM_CROSS_COMPILE_FLAGS: "-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-linux-gnu -DCMAKE_Fortran_COMPILER=aarch64-linux-gnu-gfortran-12 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++"
138139
for-intel-mlperf-inference-v3.1-bert:
139140
adr:
140141
conda-package:

0 commit comments

Comments
 (0)