From 8f03e5e8d3151b2339f51f8870ab8e6dee704c6b Mon Sep 17 00:00:00 2001 From: Arjun Date: Thu, 27 Mar 2025 18:19:33 +0530 Subject: [PATCH 1/4] Support aocc download with EULA --- automation/script/module.py | 3 +++ script/download-file/meta.yaml | 3 +++ script/extract-file/customize.py | 4 ++-- script/extract-file/meta.yaml | 3 +++ script/get-aocc/customize.py | 7 +++++++ script/get-aocc/meta.yaml | 22 ++++++++++++++++++++++ 6 files changed, 40 insertions(+), 2 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index 1325f5197..02db3571c 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -4727,6 +4727,9 @@ def find_cached_script(i): r = docker_utils.get_container_path_script(i) if not os.path.exists(r['value_env']): # Need to rm this cache entry + logger.debug( + recursion_spaces + + ' - Skipping cached entry as the dependent path {} is missing!'.format(r['value_env'])) skip_cached_script = True continue diff --git a/script/download-file/meta.yaml b/script/download-file/meta.yaml index 832275c1c..6f940186e 100644 --- a/script/download-file/meta.yaml +++ b/script/download-file/meta.yaml @@ -6,6 +6,7 @@ can_force_cache: true category: DevOps automation default_env: MLC_RCLONE_COPY_USING: sync + MLC_EXTRACT_REMOVE_EXTRACTED: no deps: - tags: detect,os - enable_if_env: @@ -40,6 +41,8 @@ tags_help: download file uid: 9cdc8dc41aae437e variations: cmutil: + alias: mlcutil + mlcutil: default: true env: MLC_DOWNLOAD_TOOL: cmutil diff --git a/script/extract-file/customize.py b/script/extract-file/customize.py index d55f8787c..1d7a11c29 100644 --- a/script/extract-file/customize.py +++ b/script/extract-file/customize.py @@ -1,7 +1,7 @@ from mlc import utils import os import hashlib - +from utils import * def preprocess(i): @@ -209,7 +209,7 @@ def postprocess(i): env['MLC_GET_DEPENDENT_CACHED_PATH'] = filepath # Check if need to remove archive after extraction - if env.get('MLC_EXTRACT_REMOVE_EXTRACTED', '').lower() != 'no': + if is_true(env.get('MLC_EXTRACT_REMOVE_EXTRACTED', '')): archive_filepath = env.get('MLC_EXTRACT_FILEPATH', '') if archive_filepath != '' and os.path.isfile(archive_filepath): os.remove(archive_filepath) diff --git a/script/extract-file/meta.yaml b/script/extract-file/meta.yaml index 56f29fe1d..7e69437e1 100644 --- a/script/extract-file/meta.yaml +++ b/script/extract-file/meta.yaml @@ -36,9 +36,12 @@ tags_help: extract file uid: 3f0b76219d004817 variations: keep: + group: keep + default: true env: MLC_EXTRACT_REMOVE_EXTRACTED: 'no' no-remove-extracted: + group: keep env: MLC_EXTRACT_REMOVE_EXTRACTED: 'no' path.#: diff --git a/script/get-aocc/customize.py b/script/get-aocc/customize.py index 5c8b33712..0759e8d05 100644 --- a/script/get-aocc/customize.py +++ b/script/get-aocc/customize.py @@ -25,6 +25,13 @@ def preprocess(i): aocc_path = env['MLC_AOCC_DIR_PATH'] if os.path.exists(os.path.join(aocc_path, 'bin', 'clang')): env['MLC_TMP_PATH'] = os.path.join(aocc_path, 'bin') + else: + for l in os.listdir(aocc_path): + if os.path.exists(os.path.join(aocc_path, l, 'bin', 'clang')): + aocc_path = os.path.join(aocc_path, l) + env['MLC_AOCC_DIR_PATH'] = aocc_path + env['MLC_TMP_PATH'] = os.path.join(aocc_path, 'bin') + r = i['automation'].find_artifact({'file_name': exe_c, 'env': env, diff --git a/script/get-aocc/meta.yaml b/script/get-aocc/meta.yaml index e1ffa999c..41ff05210 100644 --- a/script/get-aocc/meta.yaml +++ b/script/get-aocc/meta.yaml @@ -6,10 +6,24 @@ category: Compiler automation clean_files: [] deps: - tags: detect,os +- tags: download,file,_mlcutil + extra_cache_tags: aocc,download + update_tags_from_env_with_prefix: + _url.: + - MLC_AOCC_URL + force_cache: true + env: + MLC_DOWNLOAD_FINAL_ENV_NAME: MLC_AOCC_TAR_FILE_PATH + enable_if_env: + MLC_AOCC_URL: + - on + MLC_AOCC_ACCEPT_EULA: + - on - tags: extract,file update_tags_from_env_with_prefix: _path.: - MLC_AOCC_TAR_FILE_PATH + extra_cache_tags: aocc,extract force_cache: true env: MLC_EXTRACT_FINAL_ENV_NAME: MLC_AOCC_DIR_PATH @@ -21,6 +35,7 @@ deps: input_mapping: tar_file_path: MLC_AOCC_TAR_FILE_PATH aocc_dir: MLC_AOCC_DIR_PATH + accept_eula: MLC_AOCC_ACCEPT_EULA name: Detect or install AOCC compiler new_env_keys: @@ -43,6 +58,13 @@ tags: - get - aocc uid: 1ceb0656e99a44ec +versions: + 5.0.0: + env: + MLC_AOCC_URL: https://download.amd.com/developer/eula/aocc/aocc-5-0/aocc-compiler-5.0.0.tar + MLC_DOWNLOAD_CHECKSUM: 966fac2d2c759e9de6e969c10ada7a7b306c113f7f1e07ea376829ec86380daa + MLC_AOCC_NEEDS_TAR: yes + MLC_VERSION: '5.0.0-Build#1377' variations: path.#: env: From 0f2e60952525010c79a1a3be33af67c72f548a3a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 27 Mar 2025 12:51:11 +0000 Subject: [PATCH 2/4] [Automated Commit] Format Codebase [skip ci] --- script/extract-file/customize.py | 1 + script/get-aocc/customize.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/script/extract-file/customize.py b/script/extract-file/customize.py index 1d7a11c29..c7e50be3a 100644 --- a/script/extract-file/customize.py +++ b/script/extract-file/customize.py @@ -3,6 +3,7 @@ import hashlib from utils import * + def preprocess(i): variation_tags = i.get('variation_tags', []) diff --git a/script/get-aocc/customize.py b/script/get-aocc/customize.py index 0759e8d05..1e42e360a 100644 --- a/script/get-aocc/customize.py +++ b/script/get-aocc/customize.py @@ -27,11 +27,11 @@ def preprocess(i): env['MLC_TMP_PATH'] = os.path.join(aocc_path, 'bin') else: for l in os.listdir(aocc_path): - if os.path.exists(os.path.join(aocc_path, l, 'bin', 'clang')): + if os.path.exists(os.path.join( + aocc_path, l, 'bin', 'clang')): aocc_path = os.path.join(aocc_path, l) env['MLC_AOCC_DIR_PATH'] = aocc_path env['MLC_TMP_PATH'] = os.path.join(aocc_path, 'bin') - r = i['automation'].find_artifact({'file_name': exe_c, 'env': env, From d74431026faa07d396f486c16e0c283a7e64537b Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Thu, 27 Mar 2025 12:52:26 +0000 Subject: [PATCH 3/4] Update build_wheel.yml --- .github/workflows/build_wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 3b7919325..5467a7cc9 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -8,6 +8,7 @@ on: - VERSION jobs: + build_wheels: if: github.repository_owner == 'mlcommons' name: Build wheel From 490ece62ace1e9bb2638957431306e98fc91b6af Mon Sep 17 00:00:00 2001 From: Arjun Date: Thu, 27 Mar 2025 23:35:13 +0530 Subject: [PATCH 4/4] Fix get-gcc,get-oneapi variations --- script/get-gcc/meta.yaml | 4 ++-- script/get-one-api/meta.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/get-gcc/meta.yaml b/script/get-gcc/meta.yaml index 4de1812f5..d8d7827b3 100644 --- a/script/get-gcc/meta.yaml +++ b/script/get-gcc/meta.yaml @@ -31,6 +31,6 @@ tags: - get-gcc uid: dbf4ab5cbed74372 variations: - _path.#: + path.#: env: - MLC_GCC_DIR_PATH: # + MLC_GCC_DIR_PATH: '#' diff --git a/script/get-one-api/meta.yaml b/script/get-one-api/meta.yaml index 1033eb772..47cf218b0 100644 --- a/script/get-one-api/meta.yaml +++ b/script/get-one-api/meta.yaml @@ -26,6 +26,6 @@ tags: - get-oneapi uid: 1af872e81ef54742 variations: - _path.#: + path.#: env: MLC_ONEAPI_DIR_PATH: "#"