From 94efae7409e4aa111cd502a479ccb5650b67a4fe Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Mon, 8 Dec 2025 17:22:56 +0530 Subject: [PATCH 1/2] Add script to get endpoints repo --- script/get-mlperf-endpoints-src/COPYRIGHT.md | 9 ++ script/get-mlperf-endpoints-src/customize.py | 57 ++++++++++++ script/get-mlperf-endpoints-src/meta.yaml | 94 ++++++++++++++++++++ 3 files changed, 160 insertions(+) create mode 100644 script/get-mlperf-endpoints-src/COPYRIGHT.md create mode 100644 script/get-mlperf-endpoints-src/customize.py create mode 100644 script/get-mlperf-endpoints-src/meta.yaml diff --git a/script/get-mlperf-endpoints-src/COPYRIGHT.md b/script/get-mlperf-endpoints-src/COPYRIGHT.md new file mode 100644 index 000000000..d2ceead84 --- /dev/null +++ b/script/get-mlperf-endpoints-src/COPYRIGHT.md @@ -0,0 +1,9 @@ +# Copyright Notice + +© 2025-2026 MLCommons. All Rights Reserved. + +This file is licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License can be obtained at: + +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software distributed under the License is provided on an "AS IS" basis, without warranties or conditions of any kind, either express or implied. Please refer to the License for the specific language governing permissions and limitations under the License. diff --git a/script/get-mlperf-endpoints-src/customize.py b/script/get-mlperf-endpoints-src/customize.py new file mode 100644 index 000000000..fb2de22c5 --- /dev/null +++ b/script/get-mlperf-endpoints-src/customize.py @@ -0,0 +1,57 @@ +from mlc import utils +from utils import is_true +import os +import shutil + + +def preprocess(i): + + os_info = i['os_info'] + + env = i['env'] + meta = i['meta'] + + script_path = i['run_script_input']['path'] + + if env.get("MLC_MLPERF_LAST_RELEASE", '') == '': + env["MLC_MLPERF_LAST_RELEASE"] = "v5.1" + + if 'MLC_GIT_DEPTH' not in env: + env['MLC_GIT_DEPTH'] = '' + + if 'MLC_GIT_RECURSE_SUBMODULES' not in env: + env['MLC_GIT_RECURSE_SUBMODULES'] = '' + + submodules = [] + + # will add submodules in future if needed, for now none + possible_submodules = { + } + + for submodule in possible_submodules: + env_name = submodule.upper().replace("-", "_") + if is_true(env.get("MLC_SUBMODULE_" + env_name)): + submodules.append(possible_submodules[submodule]) + + env['MLC_GIT_SUBMODULES'] = ",".join(submodules) + + if env.get('MLC_GIT_PATCH_FILENAME', '') != '': + patch_file_name = env['MLC_GIT_PATCH_FILENAME'] + env['MLC_GIT_PATCH_FILEPATHS'] = os.path.join( + script_path, 'patch', patch_file_name) + + return {'return': 0} + + +def postprocess(i): + + env = i['env'] + state = i['state'] + + endpoints_root = env['MLC_MLPERF_INFERENCE_ENDPOINTS_SOURCE'] + + env['MLC_GET_DEPENDENT_CACHED_PATH'] = endpoints_root + + env['+PYTHONPATH'] = [] + + return {'return': 0} diff --git a/script/get-mlperf-endpoints-src/meta.yaml b/script/get-mlperf-endpoints-src/meta.yaml new file mode 100644 index 000000000..056251f7c --- /dev/null +++ b/script/get-mlperf-endpoints-src/meta.yaml @@ -0,0 +1,94 @@ +alias: get-mlperf-endpoints-src +automation_alias: script +automation_uid: 5b4e0237da074764 +cache: true +category: MLPerf benchmark support +default_env: + MLC_GIT_CHECKOUT_FOLDER: endpoints + MLC_GIT_DEPTH: --depth 4 + MLC_GIT_PATCH: 'no' + MLC_GIT_RECURSE_SUBMODULES: '' +deps: +- tags: detect,os +- names: + - python + - python3 + tags: get,python3 +new_env_keys: +- MLC_MLPERF_INFERENCE_ENDPOINTS_SOURCE +- MLC_MLPERF_INFERENCE_ENDPOINTS_SOURCE_VERSION +- MLC_MLPERF_LAST_RELEASE +- +PYTHONPATH +prehook_deps: +- env: + MLC_GIT_CHECKOUT_PATH_ENV_NAME: MLC_MLPERF_INFERENCE_ENDPOINTS_SOURCE + extra_cache_tags: endpoints,src + force_env_keys: + - MLC_GIT_* + names: + - inference-git-repo + tags: get,git,repo + update_tags_from_env_with_prefix: + _branch.: + - MLC_GIT_CHECKOUT + _repo.: + - MLC_GIT_URL + _sha.: + - MLC_GIT_SHA + _submodules.: + - MLC_GIT_SUBMODULES +print_env_at_the_end_disabled: + MLC_MLPERF_INFERENCE_ENDPOINTS_SOURCE: Path to MLPerf endpoints benchmark sources +tags: +- get-mlperf-endpoints-src +uid: 82c6b66389b24322 +variations: + mlcommons: + default: true + env: + MLC_GIT_URL: https://github.com/mlcommons/endpoints + group: repo + main: + default: true + env: + MLC_GIT_CHECKOUT: main + group: checkout + branch.#: + env: + MLC_GIT_CHECKOUT: '#' + MLC_MLPERF_INFERENCE_ENDPOINTS_SOURCE_VERSION: 'custom' + group: checkout + repo.#: + env: + MLC_GIT_URL: '#' + MLC_MLPERF_INFERENCE_ENDPOINTS_SOURCE_VERSION: 'custom' + group: repo + submodules.#: + env: + MLC_GIT_SUBMODULES: '#' + sha.#: + env: + MLC_GIT_SHA: '#' + group: checkout + full-history: + env: + MLC_GIT_DEPTH: '' + group: git-history + no-recurse-submodules: + env: + MLC_GIT_RECURSE_SUBMODULES: '' + patch: + ad: + inference-git-repo: + tags: _patch + env: + MLC_GIT_PATCH: 'yes' + recurse-submodules: + env: + MLC_GIT_RECURSE_SUBMODULES: ' --recurse-submodules' + short-history: + default: true + env: + MLC_GIT_DEPTH: --depth 10 + group: git-history + From 9284b9a4a2de5468ed187acc93babb3ba48fa7a6 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Mon, 8 Dec 2025 17:24:51 +0530 Subject: [PATCH 2/2] fix tag --- script/get-mlperf-endpoints-src/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/get-mlperf-endpoints-src/meta.yaml b/script/get-mlperf-endpoints-src/meta.yaml index 056251f7c..e7444beab 100644 --- a/script/get-mlperf-endpoints-src/meta.yaml +++ b/script/get-mlperf-endpoints-src/meta.yaml @@ -26,7 +26,7 @@ prehook_deps: force_env_keys: - MLC_GIT_* names: - - inference-git-repo + - endpoints-git-repo tags: get,git,repo update_tags_from_env_with_prefix: _branch.: