Skip to content

Support aocc download and install #326

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 4 commits into from
Mar 27, 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: 1 addition & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- VERSION

jobs:

build_wheels:
if: github.repository_owner == 'mlcommons'
name: Build wheel
Expand Down
3 changes: 3 additions & 0 deletions automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions script/download-file/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -40,6 +41,8 @@ tags_help: download file
uid: 9cdc8dc41aae437e
variations:
cmutil:
alias: mlcutil
mlcutil:
default: true
env:
MLC_DOWNLOAD_TOOL: cmutil
Expand Down
3 changes: 2 additions & 1 deletion script/extract-file/customize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from mlc import utils
import os
import hashlib
from utils import *


def preprocess(i):
Expand Down Expand Up @@ -209,7 +210,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)
Expand Down
3 changes: 3 additions & 0 deletions script/extract-file/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.#:
Expand Down
7 changes: 7 additions & 0 deletions script/get-aocc/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 22 additions & 0 deletions script/get-aocc/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions script/get-gcc/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ tags:
- get-gcc
uid: dbf4ab5cbed74372
variations:
_path.#:
path.#:
env:
MLC_GCC_DIR_PATH: #
MLC_GCC_DIR_PATH: '#'
2 changes: 1 addition & 1 deletion script/get-one-api/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ tags:
- get-oneapi
uid: 1af872e81ef54742
variations:
_path.#:
path.#:
env:
MLC_ONEAPI_DIR_PATH: "#"
Loading