Skip to content

Support base variation inside dynamic variations #348

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

Merged
merged 8 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
workflow_dispatch: {}

jobs:

build_wheels:
if: github.repository_owner == 'mlcommons'
name: Build wheel
Expand Down
10 changes: 7 additions & 3 deletions automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3146,7 +3146,7 @@ def _update_variation_meta_with_dynamic_suffix(
value = variation_meta[key]

if isinstance(value, list): # deps,pre_deps...
for item in value:
for i, item in enumerate(value):
if isinstance(item, dict):
for item_key in item:
item_value = item[item_key]
Expand All @@ -3163,6 +3163,9 @@ def _update_variation_meta_with_dynamic_suffix(
else:
item[item_key] = item[item_key].replace(
"#", variation_tag_dynamic_suffix)
elif isinstance(item, str):
value[i] = value[i].replace(
"#", variation_tag_dynamic_suffix)

elif isinstance(value, dict): # add_deps, env, ..
for item in value:
Expand All @@ -3188,8 +3191,9 @@ def _update_variation_meta_with_dynamic_suffix(
value[item] = value[item].replace(
"#", variation_tag_dynamic_suffix)

else: # scalar value
pass # no dynamic update for now
else: # scalar value, never used?
variation_meta[key] = variation_meta[key].replace(
"#", variation_tag_dynamic_suffix)

##########################################################################

Expand Down
13 changes: 13 additions & 0 deletions script/get-llvm/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ def preprocess(i):
env['FILE_NAME_C'] = file_name_c

if 'MLC_LLVM_CLANG_BIN_WITH_PATH' not in env:

if env.get('MLC_LLVM_DIR_PATH', '') != '':
llvm_path = env['MLC_LLVM_DIR_PATH']
if os.path.exists(os.path.join(llvm_path, 'bin', 'clang')):
env['MLC_TMP_PATH'] = os.path.join(llvm_path, 'bin')
else:
for l in os.listdir(aocc_path):
if os.path.exists(os.path.join(
llvm_path, l, 'bin', 'clang')):
llvm_path = os.path.join(llvm_path, l)
env['MLC_LLVM_DIR_PATH'] = llvm_path
env['MLC_TMP_PATH'] = os.path.join(llvm_path, 'bin')

r = i['automation'].find_artifact({'file_name': file_name_c,
'env': env,
'os_info': os_info,
Expand Down
3 changes: 3 additions & 0 deletions script/get-llvm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ variations:
ad:
llvm-install:
tags: src,_clang
path.#:
env:
MLC_LLVM_DIR_PATH: '#'
8 changes: 8 additions & 0 deletions script/install-llvm-src/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ tags:
- src-llvm
uid: 2af16e9a6c5f4702
variations:
version.main:
group: version
base:
- branch.main
version.#:
group: version
base:
- tag.#
branch.#:
env:
MLC_GIT_CHECKOUT: '#'
Expand Down
Loading