From 30c8dfa15f20154ced280cbe8aae6dc9d188040e Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 01:45:58 +0000 Subject: [PATCH 01/11] Update check-broken-links.yml From 18ae11847892a8705744ffcd6beb4a5fbf641f8b Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 01:47:34 +0000 Subject: [PATCH 02/11] Update test-mlperf-inference-abtf-poc.yml --- .github/workflows/test-mlperf-inference-abtf-poc.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-mlperf-inference-abtf-poc.yml b/.github/workflows/test-mlperf-inference-abtf-poc.yml index f12e6bd45..839d31eca 100644 --- a/.github/workflows/test-mlperf-inference-abtf-poc.yml +++ b/.github/workflows/test-mlperf-inference-abtf-poc.yml @@ -1,5 +1,3 @@ -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: MLPerf Automotive POC Test on: From ffb030c9d51170194aa1fcdb9595e5581d33ecd1 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 14:55:31 +0530 Subject: [PATCH 03/11] Changed default mlops repo branch to dev --- .github/workflows/test-mlc-script-features.yml | 4 ++-- script/build-dockerfile/meta.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-mlc-script-features.yml b/.github/workflows/test-mlc-script-features.yml index d117afa8d..a4ec7d3d0 100644 --- a/.github/workflows/test-mlc-script-features.yml +++ b/.github/workflows/test-mlc-script-features.yml @@ -63,10 +63,10 @@ jobs: - name: Run docker container from dockerhub on linux if: runner.os == 'linux' run: | - mlc run script --tags=run,docker,container --adr.compiler.tags=gcc --docker_mlc_repo=mlcommons@mlperf-automations --image_name=cm-script-app-image-classification-onnx-py --env.MLC_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.MLC_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.MLC_DOCKER_IMAGE_REPO=cknowledge --quiet + mlc run script --tags=run,docker,container --adr.compiler.tags=gcc --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --image_name=cm-script-app-image-classification-onnx-py --env.MLC_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.MLC_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.MLC_DOCKER_IMAGE_REPO=cknowledge --quiet - name: Run docker container locally on linux if: runner.os == 'linux' run: | - mlc run script --tags=run,docker,container --adr.compiler.tags=gcc --docker_mlc_repo=mlcommons@mlperf-automations --image_name=mlc-script-app-image-classification-onnx-py --env.MLC_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.MLC_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.MLC_DOCKER_IMAGE_REPO=local --quiet + mlc run script --tags=run,docker,container --adr.compiler.tags=gcc --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --image_name=mlc-script-app-image-classification-onnx-py --env.MLC_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.MLC_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.MLC_DOCKER_IMAGE_REPO=local --quiet diff --git a/script/build-dockerfile/meta.yaml b/script/build-dockerfile/meta.yaml index e6237fb6b..0c85f1606 100644 --- a/script/build-dockerfile/meta.yaml +++ b/script/build-dockerfile/meta.yaml @@ -19,7 +19,7 @@ default_env: ' MLC_DOCKER_OS: ubuntu MLC_DOCKER_NOT_PULL_UPDATE: False - MLC_MLOPS_REPO_BRANCH: mlc + MLC_MLOPS_REPO_BRANCH: dev input_mapping: build: MLC_BUILD_DOCKER_IMAGE From 08337bd317ae868134b20d027db2e17518ce025b Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 15:29:24 +0530 Subject: [PATCH 04/11] Added unzip to install package for docker --- script/build-dockerfile/dockerinfo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build-dockerfile/dockerinfo.json b/script/build-dockerfile/dockerinfo.json index 05d712418..690757c0b 100644 --- a/script/build-dockerfile/dockerinfo.json +++ b/script/build-dockerfile/dockerinfo.json @@ -29,7 +29,7 @@ "package-manager-update-cmd": "apt-get update -y", "package-manager-get-cmd": "apt-get install -y", "packages": [ - "python3", "python3-pip", "git", "sudo", "wget", "python3-venv", "systemctl" + "python3", "python3-pip", "git", "sudo", "wget", "python3-venv", "systemctl", "unzip" ], "versions": { "18.04": { From 85170309b34b98a6c94b3d5011f7f1cc04b444b2 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 15:46:20 +0530 Subject: [PATCH 05/11] Clean up of docker_it and docker_dt arguments --- automation/script/docker_utils.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/automation/script/docker_utils.py b/automation/script/docker_utils.py index 2b5b07b27..52520bfb7 100644 --- a/automation/script/docker_utils.py +++ b/automation/script/docker_utils.py @@ -72,9 +72,17 @@ def prepare_docker_inputs(input_params, docker_settings, if (value := input_params.get(f"docker_{key}", docker_settings.get(key, get_docker_default(key)))) is not None } - if docker_inputs.get('detached', docker_inputs.get('dt')): + if str(docker_inputs.get('detached', docker_inputs.get('dt', ''))).lower() in ["yes", "true", "on", "1"]: docker_inputs['interactive'] = False docker_inputs['detached'] = True + elif str(docker_inputs.get('interactive', docker_inputs.get('it', ''))).lower() in ["yes", "true", "on", "1"]: + docker_inputs['interactive'] = True + docker_inputs['detached'] = False + + for key in ["dt", "it"]: + if docker_inputs.get(key): + del(docker_inputs[key]) + # Determine Dockerfile suffix and path docker_base_image = docker_inputs.get('base_image') @@ -268,9 +276,7 @@ def get_docker_default(key): "skip_run_cmd": False, "pre_run_cmds": [], "run_cmd_prefix": '', - "port_maps": [], - "detached": False, - "interactive": True + "port_maps": [] } if key in defaults: return defaults[key] From a933f0e4d4ae449a7e99f63ce2178d74e9ad2f5c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 24 Jan 2025 10:16:37 +0000 Subject: [PATCH 06/11] [Automated Commit] Format Codebase --- automation/script/docker_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automation/script/docker_utils.py b/automation/script/docker_utils.py index 52520bfb7..d401e1925 100644 --- a/automation/script/docker_utils.py +++ b/automation/script/docker_utils.py @@ -72,7 +72,8 @@ def prepare_docker_inputs(input_params, docker_settings, if (value := input_params.get(f"docker_{key}", docker_settings.get(key, get_docker_default(key)))) is not None } - if str(docker_inputs.get('detached', docker_inputs.get('dt', ''))).lower() in ["yes", "true", "on", "1"]: + if str(docker_inputs.get('detached', docker_inputs.get('dt', '')) + ).lower() in ["yes", "true", "on", "1"]: docker_inputs['interactive'] = False docker_inputs['detached'] = True elif str(docker_inputs.get('interactive', docker_inputs.get('it', ''))).lower() in ["yes", "true", "on", "1"]: @@ -81,8 +82,7 @@ def prepare_docker_inputs(input_params, docker_settings, for key in ["dt", "it"]: if docker_inputs.get(key): - del(docker_inputs[key]) - + del (docker_inputs[key]) # Determine Dockerfile suffix and path docker_base_image = docker_inputs.get('base_image') From e828d32ba57dbb3fe3073a35c5d1ffd4d960bd1b Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 10:20:07 +0000 Subject: [PATCH 07/11] Update test-mlperf-inference-rgat.yml --- .github/workflows/test-mlperf-inference-rgat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-mlperf-inference-rgat.yml b/.github/workflows/test-mlperf-inference-rgat.yml index dc2a7eb5c..f745cb4e0 100644 --- a/.github/workflows/test-mlperf-inference-rgat.yml +++ b/.github/workflows/test-mlperf-inference-rgat.yml @@ -35,6 +35,7 @@ jobs: - name: Test MLPerf Inference R-GAT using ${{ matrix.backend }} on ${{ matrix.os }} run: | mlcr --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --adr.inference-src.tags=_branch.dev --pull_changes=yes --pull_inference_changes=yes --submitter="MLCommons" --hw_name=gh_${{ matrix.os }}_x86 --model=rgat --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --adr.compiler.tags=gcc --category=datacenter --quiet -v --target_qps=1 + - name: Push Results if: github.repository_owner == 'gateoverflow' env: From 339041fa0b11cad8b33d11b8e0e61a3c8529834c Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 17:34:27 +0530 Subject: [PATCH 08/11] Added ubuntu as the default user in ubuntu docker, is_true, is_false functions --- automation/script/docker.py | 3 +-- automation/script/docker_utils.py | 6 +++--- automation/utils.py | 5 +++++ script/build-dockerfile/customize.py | 6 +++--- script/build-dockerfile/dockerinfo.json | 1 + script/get-sys-utils-cm/run-ubuntu.sh | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/automation/script/docker.py b/automation/script/docker.py index f77462fa9..fb8dc526a 100644 --- a/automation/script/docker.py +++ b/automation/script/docker.py @@ -200,7 +200,7 @@ def docker_run(self_module, i): regenerate_docker_file = not i.get('docker_noregenerate', False) recreate_docker_image = i.get('docker_recreate', False) - if i.get('docker_skip_build', False): + if is_true(i.get('docker_skip_build', False)): regenerate_docker_file = False recreate_docker_image = False env['MLC_DOCKER_SKIP_BUILD'] = 'yes' @@ -209,7 +209,6 @@ def docker_run(self_module, i): r = prune_input({'input': i, 'extra_keys_starts_with': ['docker_']}) f_run_cmd = r['new_input'] - print(f"regenerate_docker_file = {regenerate_docker_file}") # Regenerate Dockerfile if required if regenerate_docker_file: r = dockerfile(self_module, i) diff --git a/automation/script/docker_utils.py b/automation/script/docker_utils.py index d401e1925..c10810db2 100644 --- a/automation/script/docker_utils.py +++ b/automation/script/docker_utils.py @@ -72,11 +72,10 @@ def prepare_docker_inputs(input_params, docker_settings, if (value := input_params.get(f"docker_{key}", docker_settings.get(key, get_docker_default(key)))) is not None } - if str(docker_inputs.get('detached', docker_inputs.get('dt', '')) - ).lower() in ["yes", "true", "on", "1"]: + if is_true(docker_inputs.get('detached', docker_inputs.get('dt', ''))): docker_inputs['interactive'] = False docker_inputs['detached'] = True - elif str(docker_inputs.get('interactive', docker_inputs.get('it', ''))).lower() in ["yes", "true", "on", "1"]: + elif is_true(docker_inputs.get('interactive', docker_inputs.get('it', ''))): docker_inputs['interactive'] = True docker_inputs['detached'] = False @@ -84,6 +83,7 @@ def prepare_docker_inputs(input_params, docker_settings, if docker_inputs.get(key): del (docker_inputs[key]) + # Determine Dockerfile suffix and path docker_base_image = docker_inputs.get('base_image') docker_path = docker_inputs.get('path') diff --git a/automation/utils.py b/automation/utils.py index 61cc08e28..cf2f1989e 100644 --- a/automation/utils.py +++ b/automation/utils.py @@ -1,5 +1,10 @@ from mlc.utils import * +def is_true(val): + return str(val).lower() in ["1", "true", "on", "yes"] + +def is_false(val): + return str(val).lower() in ["0", "false", "off", "no"] def get_host_os_info(i={}): """ diff --git a/script/build-dockerfile/customize.py b/script/build-dockerfile/customize.py index 491c86976..fe680c3b1 100644 --- a/script/build-dockerfile/customize.py +++ b/script/build-dockerfile/customize.py @@ -264,7 +264,7 @@ def preprocess(i): DOCKER_GROUP = "-g $GID -o" user_shell = json.loads(shell) - f.write('RUN useradd ' + DOCKER_USER_ID + DOCKER_GROUP + ' --create-home --shell ' + user_shell[0] + ' ' + f.write(f"""RUN id -u {docker_user} > /dev/null 2>&1 || useradd """ + DOCKER_USER_ID + DOCKER_GROUP + ' --create-home --shell ' + user_shell[0] + ' ' + docker_user + EOL) f.write( 'RUN echo "' + @@ -272,7 +272,7 @@ def preprocess(i): ' ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' + EOL) f.write('USER ' + docker_user + ":" + docker_group + EOL) - f.write('ENV HOME=/home/mlcuser' + EOL) + f.write(f"""ENV HOME=/home/{docker_user}""" + EOL) else: f.write('ENV HOME=/root' + EOL) @@ -284,7 +284,7 @@ def preprocess(i): docker_env_key + "=" + str(dockerfile_env[docker_env_key]) workdir = get_value(env, config, 'WORKDIR', 'MLC_DOCKER_WORKDIR') - if workdir and ("/home/mlcuser" not in workdir or str(env.get('MLC_DOCKER_USE_DEFAULT_USER', '')).lower() not in [ + if workdir and (f"""/home/{docker_user}""" not in workdir or str(env.get('MLC_DOCKER_USE_DEFAULT_USER', '')).lower() not in [ "yes", "1", "true"]): f.write('WORKDIR ' + workdir + EOL) diff --git a/script/build-dockerfile/dockerinfo.json b/script/build-dockerfile/dockerinfo.json index 690757c0b..a6ff5056c 100644 --- a/script/build-dockerfile/dockerinfo.json +++ b/script/build-dockerfile/dockerinfo.json @@ -26,6 +26,7 @@ "WORKDIR": "/home/mlcuser", "distros": { "ubuntu": { + "USER": "ubuntu", "package-manager-update-cmd": "apt-get update -y", "package-manager-get-cmd": "apt-get install -y", "packages": [ diff --git a/script/get-sys-utils-cm/run-ubuntu.sh b/script/get-sys-utils-cm/run-ubuntu.sh index d6fb9f7ed..334515507 100644 --- a/script/get-sys-utils-cm/run-ubuntu.sh +++ b/script/get-sys-utils-cm/run-ubuntu.sh @@ -14,7 +14,7 @@ fi MLC_APT_TOOL=${MLC_APT_TOOL:-apt-get} ${MLC_SUDO} ${MLC_APT_TOOL} update && \ - ${MLC_SUDO} DEBIAN_FRONTEND=noninteractive ${MLC_APT_TOOL} install -y --no-install-recommends \ + ${MLC_SUDO} DEBIAN_FRONTEND=noninteractive ${MLC_APT_TOOL} install -y --no-install-recommends --ignore-missing \ apt-utils \ git \ wget \ From a2ef1a954266f202a28b3f8f7d58277c016470cf Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 17:39:59 +0530 Subject: [PATCH 09/11] Fixes for abtf github action --- .github/workflows/test-mlperf-inference-abtf-poc.yml | 8 ++++---- script/app-mlperf-automotive/meta.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-mlperf-inference-abtf-poc.yml b/.github/workflows/test-mlperf-inference-abtf-poc.yml index ee92775b9..026db0b14 100644 --- a/.github/workflows/test-mlperf-inference-abtf-poc.yml +++ b/.github/workflows/test-mlperf-inference-abtf-poc.yml @@ -18,7 +18,7 @@ jobs: python-version: [ "3.8", "3.12" ] backend: [ "pytorch" ] implementation: [ "python" ] - docker: [ "", " --docker --docker_os=ubuntu --docker_os_version=22.04 --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt=yes" ] + docker: [ "", " --docker --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt" ] extra-args: [ "--adr.compiler.tags=gcc", "--env.MLC_MLPERF_LOADGEN_BUILD_FROM_SRC=off" ] exclude: - os: ubuntu-24.04 @@ -28,16 +28,16 @@ jobs: - os: windows-latest extra-args: "--adr.compiler.tags=gcc" - os: windows-latest - docker: " --docker --docker_it=no --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt=yes" + docker: " --docker --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt" # windows docker image is not supported in CM yet - os: macos-latest python-version: "3.8" - os: macos-13 python-version: "3.8" - os: macos-latest - docker: " --docker --docker_it=no --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt=yes" + docker: " --docker --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt" - os: macos-13 - docker: " --docker --docker_it=no --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt=yes" + docker: " --docker --docker_mlc_repo=mlcommons@mlperf-automations --docker_mlc_repo_branch=dev --docker_dt" steps: - uses: actions/checkout@v3 diff --git a/script/app-mlperf-automotive/meta.yaml b/script/app-mlperf-automotive/meta.yaml index be0ce6333..896008c39 100644 --- a/script/app-mlperf-automotive/meta.yaml +++ b/script/app-mlperf-automotive/meta.yaml @@ -100,7 +100,7 @@ docker: use_host_user_id: True real_run: false interactive: True - mlc_repos: 'mlc pull repo mlcommons@cm4abtf --branch=poc' + mlc_repos_off: 'mlc pull repo mlcommons@cm4abtf --branch=poc' deps: - tags: get,abtf,scratch,space mounts: From a4e0fcfc517ab6703203aee4cc04deb3f5552cce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 24 Jan 2025 12:10:18 +0000 Subject: [PATCH 10/11] [Automated Commit] Format Codebase --- automation/script/docker_utils.py | 1 - automation/utils.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/automation/script/docker_utils.py b/automation/script/docker_utils.py index c10810db2..2d70a68f4 100644 --- a/automation/script/docker_utils.py +++ b/automation/script/docker_utils.py @@ -83,7 +83,6 @@ def prepare_docker_inputs(input_params, docker_settings, if docker_inputs.get(key): del (docker_inputs[key]) - # Determine Dockerfile suffix and path docker_base_image = docker_inputs.get('base_image') docker_path = docker_inputs.get('path') diff --git a/automation/utils.py b/automation/utils.py index cf2f1989e..fd024061d 100644 --- a/automation/utils.py +++ b/automation/utils.py @@ -1,11 +1,14 @@ from mlc.utils import * + def is_true(val): return str(val).lower() in ["1", "true", "on", "yes"] + def is_false(val): return str(val).lower() in ["0", "false", "off", "no"] + def get_host_os_info(i={}): """ Get some host platform name (currently windows or linux) and OS bits From ceff4a40755b5d9ecad82165689f6cc7e635e636 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Fri, 24 Jan 2025 12:11:33 +0000 Subject: [PATCH 11/11] Update build_wheel.yml --- .github/workflows/build_wheel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 005f41d88..85039c7d5 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -11,7 +11,6 @@ on: - VERSION - setup.py - jobs: build_wheels: if: github.repository_owner == 'mlcommons'