From d339bc6ba043a8684d0ba556576f404457a617bf Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 18:50:04 +0530 Subject: [PATCH 01/10] Fix ABTF run --- script/run-mlperf-automotive-app/customize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/run-mlperf-automotive-app/customize.py b/script/run-mlperf-automotive-app/customize.py index d9ca6f3e0..6f8398743 100644 --- a/script/run-mlperf-automotive-app/customize.py +++ b/script/run-mlperf-automotive-app/customize.py @@ -3,7 +3,6 @@ import json import shutil import subprocess -import mlc import copy from tabulate import tabulate @@ -20,6 +19,7 @@ def preprocess(i): inp = i['input'] state = i['state'] script_path = i['run_script_input']['path'] + mlc = i['automation'].action_object if env.get('MLC_RUN_DOCKER_CONTAINER', '') == "yes": return {'return': 0} From a81a668e7406f5625bedfe4fa6a851c18c742e25 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 18:55:27 +0530 Subject: [PATCH 02/10] Fix PATH export in dockerfile --- script/build-dockerfile/customize.py | 2 ++ script/build-dockerfile/dockerinfo.json | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/script/build-dockerfile/customize.py b/script/build-dockerfile/customize.py index fe680c3b1..a526c8f46 100644 --- a/script/build-dockerfile/customize.py +++ b/script/build-dockerfile/customize.py @@ -296,6 +296,8 @@ def preprocess(i): f.write('RUN {} -m venv $HOME/venv/mlc'.format(python) + " " + EOL) f.write('ENV PATH="$HOME/venv/mlc/bin:$PATH"' + EOL) # f.write('RUN . /opt/venv/mlc/bin/activate' + EOL) + + f.write('ENV PATH="$PATH:$HOME/.local/bin"' + EOL) f.write( 'RUN {} -m pip install '.format(python) + diff --git a/script/build-dockerfile/dockerinfo.json b/script/build-dockerfile/dockerinfo.json index a189267a8..cfb739e77 100644 --- a/script/build-dockerfile/dockerinfo.json +++ b/script/build-dockerfile/dockerinfo.json @@ -11,8 +11,7 @@ }, "ENTRYPOINT": "[\"/bin/bash\", \"-c\"]", "ENV": { - "TZ": "US/Pacific", - "PATH": "${PATH}:/home/mlcuser/.local/bin" + "TZ": "US/Pacific" }, "RUN_CMDS": [ "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone" From 59c81d49c845950f052cd482fb6df616be5cac40 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 24 Jan 2025 13:25:45 +0000 Subject: [PATCH 03/10] [Automated Commit] Format Codebase --- script/build-dockerfile/customize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build-dockerfile/customize.py b/script/build-dockerfile/customize.py index a526c8f46..23e7891dc 100644 --- a/script/build-dockerfile/customize.py +++ b/script/build-dockerfile/customize.py @@ -296,7 +296,7 @@ def preprocess(i): f.write('RUN {} -m venv $HOME/venv/mlc'.format(python) + " " + EOL) f.write('ENV PATH="$HOME/venv/mlc/bin:$PATH"' + EOL) # f.write('RUN . /opt/venv/mlc/bin/activate' + EOL) - + f.write('ENV PATH="$PATH:$HOME/.local/bin"' + EOL) f.write( From a52e53fb8494463ad8ce18c16b6c57f4028593bc Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 21:28:42 +0530 Subject: [PATCH 04/10] Fixes for docker deps --- automation/script/docker.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/automation/script/docker.py b/automation/script/docker.py index fb8dc526a..7207126fb 100644 --- a/automation/script/docker.py +++ b/automation/script/docker.py @@ -31,11 +31,11 @@ def dockerfile(self_module, input_params): return {'return': 1, 'error': 'No scripts were found'} # Step 3: Process Dockerfile-related configurations - environment_vars = input_params.get('env', {}) + env = input_params.get('env', {}) state_data = input_params.get('state', {}) constant_vars = input_params.get('const', {}) constant_state = input_params.get('const_state', {}) - dockerfile_environment_vars = input_params.get('dockerfile_env', {}) + dockerfile_env = input_params.get('dockerfile_env', {}) tag_values = input_params.get('tags', '').split(",") variation_tags = [tag[1:] for tag in tag_values if tag.startswith("_")] @@ -55,13 +55,13 @@ def dockerfile(self_module, input_params): 'script_variation_tags': variation_tags } docker_settings = metadata.get('docker', {}) - docker_settings['dockerfile_env'] = dockerfile_environment_vars + docker_settings['dockerfile_env'] = dockerfile_env state_data['docker'] = docker_settings add_deps_recursive = input_params.get('add_deps_recursive', {}) # Update state with metadata and variations update_state_result = self_module.update_state_from_meta( - metadata, environment_vars, state_data, constant_vars, constant_state, + metadata, env, state_data, constant_vars, constant_state, deps=[], post_deps=[], prehook_deps=[], @@ -77,7 +77,7 @@ def dockerfile(self_module, input_params): update_variations_result = self_module._update_state_from_variations( input_params, metadata, variation_tags, metadata.get( 'variations', {}), - environment_vars, state_data, constant_vars, constant_state, + env, state_data, constant_vars, constant_state, deps=[], # Add your dependencies if needed post_deps=[], # Add post dependencies if needed prehook_deps=[], # Add prehook dependencies if needed @@ -94,8 +94,8 @@ def dockerfile(self_module, input_params): # Set Docker-specific configurations docker_settings = state_data.get('docker', {}) - docker_settings['dockerfile_env'] = dockerfile_environment_vars - dockerfile_environment_vars['MLC_RUN_STATE_DOCKER'] = True + docker_settings['dockerfile_env'] = dockerfile_env + dockerfile_env['MLC_RUN_STATE_DOCKER'] = True if not docker_settings.get('run', True) and not input_params.get( 'docker_run_override', False): @@ -103,14 +103,14 @@ def dockerfile(self_module, input_params): continue # Handle build dependencies - build_dependencies = docker_settings.get('build_deps', []) - if build_dependencies: - deps_result = self_module._run_deps( - build_dependencies, run_state=run_state, verbose=input_params.get( - 'v', False) - ) - if deps_result['return'] > 0: - return deps_result + show_time = input_params.get('show_time', False) + deps = docker_settings.get('deps', []) + if deps: + r = self_module._run_deps( + deps, [], env, {}, {}, {}, {}, '', [], '', False, '', verbose, + show_time, ' ', run_state) + if r['return'] > 0: + return r # Prune temporary environment variables run_command = copy.deepcopy(run_command_arc) @@ -154,15 +154,15 @@ def dockerfile(self_module, input_params): # Push Docker image if specified if input_params.get('docker_push_image') in [True, 'True', 'yes']: - environment_vars['MLC_DOCKER_PUSH_IMAGE'] = 'yes' + env['MLC_DOCKER_PUSH_IMAGE'] = 'yes' # Generate Dockerfile mlc_docker_input = { 'action': 'run', 'automation': 'script', 'tags': 'build,dockerfile', 'fake_run_option': " " if docker_inputs.get('real_run') else " --fake_run", 'comments': comments, 'run_cmd': f"{run_command_string} --quiet", - 'script_tags': input_params.get('tags'), 'env': environment_vars, - 'dockerfile_env': dockerfile_environment_vars, + 'script_tags': input_params.get('tags'), 'env': env, + 'dockerfile_env': dockerfile_env, 'quiet': True, 'v': input_params.get('v', False), 'real_run': True } mlc_docker_input.update(docker_inputs) From 3c01acab350d5d4fc05f07a53c39475c4ba20a50 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 23:19:50 +0530 Subject: [PATCH 05/10] Fix update_meta_if_env working for docker --- automation/script/docker.py | 19 +++++++++++++++++-- script/app-mlperf-inference/meta.yaml | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/automation/script/docker.py b/automation/script/docker.py index 7207126fb..d5b179943 100644 --- a/automation/script/docker.py +++ b/automation/script/docker.py @@ -93,7 +93,7 @@ def dockerfile(self_module, input_params): return update_variations_result # Set Docker-specific configurations - docker_settings = state_data.get('docker', {}) + docker_settings = state_data['docker'] docker_settings['dockerfile_env'] = dockerfile_env dockerfile_env['MLC_RUN_STATE_DOCKER'] = True @@ -104,7 +104,7 @@ def dockerfile(self_module, input_params): # Handle build dependencies show_time = input_params.get('show_time', False) - deps = docker_settings.get('deps', []) + deps = docker_settings.get('build_deps', []) if deps: r = self_module._run_deps( deps, [], env, {}, {}, {}, {}, '', [], '', False, '', verbose, @@ -112,6 +112,21 @@ def dockerfile(self_module, input_params): if r['return'] > 0: return r + update_state_result = self_module.update_state_from_meta( + metadata, env, state_data, constant_vars, constant_state, + deps=[], + post_deps=[], + prehook_deps=[], + posthook_deps=[], + new_env_keys=[], + new_state_keys=[], + run_state=run_state, + i=input_params + ) + if update_state_result['return'] > 0: + return update_state_result + docker_settings = state_data['docker'] + # Prune temporary environment variables run_command = copy.deepcopy(run_command_arc) for key in list(run_command.get('env', {}).keys()): diff --git a/script/app-mlperf-inference/meta.yaml b/script/app-mlperf-inference/meta.yaml index 975bae164..9f8ab1a71 100644 --- a/script/app-mlperf-inference/meta.yaml +++ b/script/app-mlperf-inference/meta.yaml @@ -351,7 +351,8 @@ variations: MLC_HOST_PLATFORM_FLAVOR: - x86_64 docker: - base_image: nvcr.io/nvidia/mlperf/mlperf-inference:mlpinf-v4.1-cuda12.4-pytorch24.04-ubuntu22.04-aarch64-GraceHopper-release + base_image_off: nvcr.io/nvidia/mlperf/mlperf-inference:mlpinf-v4.1-cuda12.4-pytorch24.04-ubuntu22.04-aarch64-GraceHopper-release + base_image: nvcr.io/nvidia/mlperf/mlperf-inference:mlpinf-v4.0-cuda12.2-cudnn8.9-aarch64-ubuntu22.04-public env: MLC_ENV_NVMITTEN_DOCKER_WHEEL_PATH: '/opt/nvmitten-0.1.3b0-cp310-cp310-linux_aarch64.whl' From 3b5ac9c1fb4fcf43f4beb5c1bfd58cade33e90e1 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 23:40:55 +0530 Subject: [PATCH 06/10] Added backup url for R50 model --- script/get-ml-model-resnet50/meta.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/get-ml-model-resnet50/meta.yaml b/script/get-ml-model-resnet50/meta.yaml index f9617eca5..006307eb4 100644 --- a/script/get-ml-model-resnet50/meta.yaml +++ b/script/get-ml-model-resnet50/meta.yaml @@ -135,7 +135,8 @@ variations: onnx,opset-8: env: MLC_DOWNLOAD_CHECKSUM: a638cf028b5870da29e09ccc2f7182e7 - MLC_PACKAGE_URL: https://zenodo.org/record/2592612/files/resnet50_v1.onnx + MLC_PACKAGE_URL: https://armi.in/files/resnet50_v1.onnx + MLC_PACKAGE_URL1: https://zenodo.org/record/2592612/files/resnet50_v1.onnx onnxruntime: alias: onnx opset-11: From d46cecb895caa5759e2b9e5ce7d15dd6009a5596 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 19:28:35 +0000 Subject: [PATCH 07/10] Update test-mlperf-inference-resnet50.yml --- .github/workflows/test-mlperf-inference-resnet50.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index 57925e829..d2726d328 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -80,6 +80,6 @@ jobs: echo ${{ env.PAT }} echo "hello" >> README.md git commit -a -m "Test commit" - git push https://${PAT}@github.com/mlcommons/mlperf_inference_test_submissions_v5.0 HEAD:${{ github.ref_name }} + git push https://git:${PAT}@github.com/mlcommons/mlperf_inference_test_submissions_v5.0 HEAD:${{ github.ref_name }} # mlcr --tags=push,github,mlperf,inference,submission --env.MLC_GITHUB_PAT=pat --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=auto-update --commit_message="Results from R50 GH action on ${{ matrix.os }}" --quiet From 59b8a0c5dc80a09c2cf9eb71a75ea2a0371857c9 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 19:28:52 +0000 Subject: [PATCH 08/10] Update test-mlperf-inference-resnet50.yml --- .github/workflows/test-mlperf-inference-resnet50.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index d2726d328..83daa8494 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -72,12 +72,6 @@ jobs: git config --global user.email "mlcommons-bot@users.noreply.github.com" git clone -b auto-update https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 tmp cd tmp - RE=$PAT - echo $RE - echo $PAT - lop=$RE - echo $lop - echo ${{ env.PAT }} echo "hello" >> README.md git commit -a -m "Test commit" git push https://git:${PAT}@github.com/mlcommons/mlperf_inference_test_submissions_v5.0 HEAD:${{ github.ref_name }} From 1e3d44773564f3bbf51ee19bc0d74757ee5daa06 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 19:34:12 +0000 Subject: [PATCH 09/10] Update test-mlperf-inference-resnet50.yml --- .github/workflows/test-mlperf-inference-resnet50.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index 83daa8494..498cbe70a 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -1,7 +1,7 @@ name: MLPerf inference ResNet50 on: - pull_request: + pull_request_target: branches: [ "main", "dev" ] paths: - '.github/workflows/test-mlperf-inference-resnet50.yml' From 42a233ef61886acdfc264bb13ef04a5063f576b7 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sat, 25 Jan 2025 01:04:41 +0530 Subject: [PATCH 10/10] Fix README text in script module --- automation/script/module.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index 19d6d02ad..6728d5136 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -3797,10 +3797,6 @@ def _get_readme(self, cmd_parts, run_state): pip install mlcflow ``` -Check [this readme](https://github.com/mlcommons/ck/blob/master/docs/installation.md) -with more details about installing MLC and dependencies across different platforms -(Ubuntu, MacOS, Windows, RHEL, ...). - """ current_mlc_repo = run_state['script_repo_alias']