diff --git a/script/test-cm-core/src/script/process_tests.py b/.github/scripts/process_individual_tests.py similarity index 76% rename from script/test-cm-core/src/script/process_tests.py rename to .github/scripts/process_individual_tests.py index 8012d097b..d328aad63 100644 --- a/script/test-cm-core/src/script/process_tests.py +++ b/.github/scripts/process_individual_tests.py @@ -1,7 +1,6 @@ import sys import os -import cmind as cm -import check as checks +import mlc import json import yaml @@ -11,7 +10,7 @@ print(file) if not os.path.isfile(file) or not "script" in file: continue - if not file.endswith("_cm.json") and not file.endswith("_cm.yaml"): + if not file.endswith("meta.json") and not file.endswith("meta.yaml"): continue script_path = os.path.dirname(file) f = open(file) @@ -24,7 +23,7 @@ uid = data['uid'] ii = { - 'action': 'test', 'automation': 'script', 'artifact': uid, 'quiet': 'yes', 'out': 'con' + 'action': 'test', 'target': 'script', 'item': uid, 'quiet': 'yes', 'out': 'con' } if os.environ.get('DOCKER_CM_REPO', '') != '': ii['docker_cm_repo'] = os.environ['DOCKER_CM_REPO'] @@ -33,6 +32,6 @@ if os.environ.get('TEST_INPUT_INDEX', '') != '': ii['test_input_index'] = os.environ['TEST_INPUT_INDEX'] print(ii) - r = cm.access(ii) - - checks.check_return(r) + ret = mlc.access(ii) + if ret['return'] > 0: + raise Exception(r['error']) diff --git a/.github/workflows/run-individual-script-tests.yml b/.github/workflows/run-individual-script-tests.yml index 45b9dd283..cd0f2712d 100644 --- a/.github/workflows/run-individual-script-tests.yml +++ b/.github/workflows/run-individual-script-tests.yml @@ -1,12 +1,12 @@ # This workflow will run configured tests for any updated CM scripts -name: Individual CM script Tests +name: Individual Automation script Tests on: pull_request: branches: [ "main", "dev" ] paths: - - 'script/**_cm.json' - - 'script/**_cm.yaml' + - 'script/**meta.json' + - 'script/**meta.yaml' jobs: run-script-tests: @@ -32,6 +32,6 @@ jobs: for file in ${{ steps.getfile.outputs.files }}; do echo $file done - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - DOCKER_CM_REPO=${{ github.event.pull_request.head.repo.html_url }} DOCKER_CM_REPO_BRANCH=${{ github.event.pull_request.head.ref }} TEST_INPUT_INDEX=${{ matrix.test-input-index }} python3 script/test-cm-core/src/script/process_tests.py ${{ steps.getfile.outputs.files }} + pip install mlcflow + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + DOCKER_CM_REPO=${{ github.event.pull_request.head.repo.html_url }} DOCKER_CM_REPO_BRANCH=${{ github.event.pull_request.head.ref }} TEST_INPUT_INDEX=${{ matrix.test-input-index }} python3 .github/scripts/process_individual_tests.py ${{ steps.getfile.outputs.files }} diff --git a/.github/workflows/test-cm-script-features.yml b/.github/workflows/test-cm-script-features.yml deleted file mode 100644 index 728223df1..000000000 --- a/.github/workflows/test-cm-script-features.yml +++ /dev/null @@ -1,53 +0,0 @@ -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: CM script automation features test - -on: - pull_request: - branches: [ "main", "dev", "mlperf-inference" ] - paths: - - '.github/workflows/test-cm-script-features.yml' - - '**' - - '!**.md' - -jobs: - test_cm_script_features: - - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - python-version: ["3.12", "3.8"] - os: ["ubuntu-latest", "windows-latest", "macos-latest"] - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Configure git longpaths (Windows) - if: matrix.os == 'windows-latest' - run: | - git config --system core.longpaths true - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' - run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' - run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops - - name: Pull MLOps repository - run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - cm run script --quiet --tags=get,sys-utils-cm - - name: Run test_docker on linux - if: runner.os == 'linux' - run: | - python script/test-cm-core/src/script/test_docker.py - - name: Test CM Script Features - run: | - python script/test-cm-core/src/script/test_deps.py - python script/test-cm-core/src/script/test_install.py - python script/test-cm-core/src/script/test_features.py diff --git a/.github/workflows/test-cm-tutorial-retinanet.yml b/.github/workflows/test-cm-tutorial-retinanet.yml deleted file mode 100644 index 5fa649772..000000000 --- a/.github/workflows/test-cm-tutorial-retinanet.yml +++ /dev/null @@ -1,38 +0,0 @@ -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: CM tutorial retinanet - -on: - pull_request: - branches: [ "main", "dev", "mlperf-inference" ] - paths: - - '.github/workflows/test-cm-tutorial-retinanet.yml' - - '**' - - '!**.md' -jobs: - build: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies on Unix Platforms - run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops - - name: Pull MLOps repository - run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - cm run script --quiet --tags=get,sys-utils-cm - - name: Test CM Tutorial Retinanet - run: | - python script/test-cm-core/src/tutorials/test_tutorial_retinanet.py diff --git a/.github/workflows/test-cm-tutorial-tvm-pip.yml b/.github/workflows/test-cm-tutorial-tvm-pip.yml deleted file mode 100644 index 8cc87ca0e..000000000 --- a/.github/workflows/test-cm-tutorial-tvm-pip.yml +++ /dev/null @@ -1,63 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: CM tutorial tvm pip install - -on: - pull_request: - branches: [ "main", "test", "mlperf-inference" ] - paths: - - '.github/workflows/test-cm-tutorial-tvm-pip.yml' - - '**' - - '!**.md' - -jobs: - test_vm_runtime: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies on Unix Platforms - run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops - - name: Pull MLOps repository - run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - cm run script --quiet --tags=get,sys-utils-cm - - name: Test CM Tutorial TVM pip install with VirtualMachine Runtime - run: | - python script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py - - test_ge_runtime: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies on Unix Platforms - run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops - - name: Pull MLOps repository - run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - cm run script --quiet --tags=get,sys-utils-cm - - name: Test CM Tutorial TVM pip install with GraphExecutor Runtime - run: | - python script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py diff --git a/.github/workflows/test-cm-tutorial-tvm.yml b/.github/workflows/test-cm-tutorial-tvm.yml deleted file mode 100644 index 96b653b0f..000000000 --- a/.github/workflows/test-cm-tutorial-tvm.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: CM tutorial tvm - -on: - pull_request: - branches: [ "test" ] - paths: - - '.github/workflows/test-cm-tutorial-tvm.yml' - - '**' - - '!**.md' - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies on Unix Platforms - run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops - - name: Pull MLOps repository - run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - cm run script --quiet --tags=get,sys-utils-cm - - name: Test CM Tutorial TVM - run: | - python script/test-cm-core/src/tutorials/test_tutorial_tvm.py diff --git a/.github/workflows/test-cm4mlops-wheel-macos.yml b/.github/workflows/test-cm4mlops-wheel-macos.yml deleted file mode 100644 index fede3adb9..000000000 --- a/.github/workflows/test-cm4mlops-wheel-macos.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build Python Wheel - -on: - pull_request: - branches: - - main - - dev - - mlperf-inference - paths: - - '.github/workflows/test-cm4mlops-wheel-macos.yml' - - 'setup.py' - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [macos-latest] - python-version: [ '3.11', '3.12'] - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - - name: Build the Python wheel - run: | - python3 -m venv cm - source cm/bin/activate - python3 -m pip install . -v diff --git a/.github/workflows/test-cm4mlops-wheel-windows.yml b/.github/workflows/test-cm4mlops-wheel-windows.yml deleted file mode 100644 index 68bf199a7..000000000 --- a/.github/workflows/test-cm4mlops-wheel-windows.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build Python Wheel - -on: - pull_request: - branches: - - main - - dev - - mlperf-inference - paths: - - '.github/workflows/test-cm4mlops-wheel-windows.yml' - - 'setup.py' - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [windows-latest] - python-version: ['3.9', '3.11', '3.12'] - exclude: - - os: ubuntu-latest - python-version: "3.8" - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - - name: Build the Python wheel - run: | - python3 -m venv cm - cm\Scripts\activate.bat - git config --system core.longpaths true - python3 -m pip install . -v diff --git a/.github/workflows/test-image-classification-onnx.yml b/.github/workflows/test-image-classification-onnx.yml index 075de9c76..d0cc00ee4 100644 --- a/.github/workflows/test-image-classification-onnx.yml +++ b/.github/workflows/test-image-classification-onnx.yml @@ -1,11 +1,8 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: image classification with ONNX +name: Image classification with ONNX on: pull_request: - branches: [ "main", "dev", "mlperf-inference" ] + branches: [ "main", "dev" ] paths: - '.github/workflows/test-image-classification-onnx.yml' - '**' @@ -30,18 +27,14 @@ jobs: if: matrix.os == 'windows-latest' run: | git config --system core.longpaths true - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' + - name: Install mlcflow run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' - run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow + pip install tabulate + - name: Pull MLOps repository run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - cm run script --quiet --tags=get,sys-utils-cm + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - name: Test image classification with ONNX run: | - cm run script --tags=python,app,image-classification,onnx --quiet + mlcr --tags=python,app,image-classification,onnx --quiet diff --git a/.github/workflows/test-cm-based-submission-generation.yml b/.github/workflows/test-mlc-based-submission-generation.yml similarity index 80% rename from .github/workflows/test-cm-based-submission-generation.yml rename to .github/workflows/test-mlc-based-submission-generation.yml index 8ac9d3814..c409e955f 100644 --- a/.github/workflows/test-cm-based-submission-generation.yml +++ b/.github/workflows/test-mlc-based-submission-generation.yml @@ -1,12 +1,10 @@ -# This workflow will test the submission generation capability of CM f - -name: CM based Submission Generation +name: MLC based Submission Generation on: pull_request: - branches: [ "main", "dev", "mlperf-inference" ] + branches: [ "main", "dev" ] paths: - - '.github/workflows/test-cm-based-submission-generation.yml' + - '.github/workflows/test-mlc-based-submission-generation.yml' - '**' - '!**.md' jobs: @@ -48,17 +46,12 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' - run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' + - name: Install mlcflow run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow - name: Pull MLOps repository run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - name: Pull repo where test cases are uploaded run: | git clone -b submission-generation-tests https://github.com/mlcommons/inference.git submission_generation_tests @@ -88,7 +81,7 @@ jobs: fi # Dynamically set the log group to simulate a dynamic step name echo "::group::$description" - cm ${{ matrix.action }} script --tags=generate,inference,submission --version=v4.1 --clean --preprocess_submission=yes --results_dir=$PWD/submission_generation_tests/${{ matrix.case }}/ --run-checker --submitter=MLCommons --tar=yes --env.CM_TAR_OUTFILE=submission.tar.gz --division=${{ matrix.division }} --env.CM_DETERMINE_MEMORY_CONFIGURATION=yes --quiet $extra_run_args + mlc ${{ matrix.action }} script --tags=generate,inference,submission --version=v4.1 --clean --preprocess_submission=yes --results_dir=$PWD/submission_generation_tests/${{ matrix.case }}/ --run-checker --submitter=MLCommons --tar=yes --env.CM_TAR_OUTFILE=submission.tar.gz --division=${{ matrix.division }} --env.CM_DETERMINE_MEMORY_CONFIGURATION=yes --quiet $extra_run_args exit_status=$? echo "Exit status for the job ${description} ${exit_status}" if [[ "${{ matrix.case }}" == "case-5" || "${{ matrix.case }}" == "case-6" ]]; then diff --git a/.github/workflows/test-mlc-script-features.yml b/.github/workflows/test-mlc-script-features.yml new file mode 100644 index 000000000..8ee512bca --- /dev/null +++ b/.github/workflows/test-mlc-script-features.yml @@ -0,0 +1,72 @@ +name: MLC script automation features test + +on: + pull_request: + branches: [ "main", "dev" ] + paths: + - '.github/workflows/test-mlc-script-features.yml' + - '**' + - '!**.md' + +jobs: + test_mlc_script_features: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.12", "3.8"] + os: ["ubuntu-latest", "windows-latest", "macos-latest"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Configure git longpaths (Windows) + if: matrix.os == 'windows-latest' + run: | + git config --system core.longpaths true + - name: Pull MLOps repository + run: | + pip install mlcflow + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + + - name: Test Python venv + run: | + mlc run script --tags=install,python-venv --name=test --quiet + mlc search cache --tags=get,python,virtual,name-test --quiet + + - name: Test variations + run: | + mlc run script --tags=get,dataset,preprocessed,imagenet,_NHWC --quiet + mlc search cache --tags=get,dataset,preprocessed,imagenet,-_NCHW + mlc search cache --tags=get,dataset,preprocessed,imagenet,-_NHWC + + - name: Test versions + continue-on-error: true + if: runner.os == 'linux' + run: | + mlc run script --tags=get,generic-python-lib,_package.scipy --version=1.9.3 --quiet + test $? -eq 0 || exit $? + mlc run script --tags=get,generic-python-lib,_package.scipy --version=1.9.2 --quiet + test $? -eq 0 || exit $? + mlc run script --tags=get,generic-python-lib,_package.scipy --version=1.9.3 --quiet --only_execute_from_cache=True + test $? -eq 0 || exit 0 + + - name: Test python install from src + run: | + mlc run script --tags=python,src,install,_shared --version=3.9.10 --quiet + mlc search cache --tags=python,src,install,_shared,version-3.9.10 + + - 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_cm_repo=mlcommons@mlperf-automations --image_name=cm-script-app-image-classification-onnx-py --env.CM_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.CM_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.CM_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_cm_repo=mlcommons@mlperf-automations --image_name=mlc-script-app-image-classification-onnx-py --env.CM_DOCKER_RUN_SCRIPT_TAGS=app,image-classification,onnx,python --env.CM_DOCKER_IMAGE_BASE=ubuntu:22.04 --env.CM_DOCKER_IMAGE_REPO=local --quiet + diff --git a/.github/workflows/test-mlc-tutorial-retinanet.yml b/.github/workflows/test-mlc-tutorial-retinanet.yml new file mode 100644 index 000000000..af40cd023 --- /dev/null +++ b/.github/workflows/test-mlc-tutorial-retinanet.yml @@ -0,0 +1,42 @@ +name: MLC tutorial retinanet + +on: + pull_request: + branches: [ "main", "dev" ] + paths: + - '.github/workflows/test-mlc-tutorial-retinanet.yml' + - '**' + - '!**.md' +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9"] + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install mlcflow + - name: Pull MLOps repository + run: | + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + mlcr --quiet --tags=get,sys-utils-cm + - name: Test MLC Tutorial Retinanet + run: | + mlcr --tags=app,mlperf,inference,generic,_cpp,_retinanet,_onnxruntime,_cpu --adr.python.version_min=3.8 --adr.compiler.tags=gcc --adr.openimages-preprocessed.tags=_50 --scenario=Offline --mode=accuracy --test_query_count=10 --rerun --quiet + + mlcr --tags=app,mlperf,inference,generic,_cpp,_retinanet,_onnxruntime,_cpu --adr.python.version_min=3.8 --adr.compiler.tags=gcc --adr.openimages-preprocessed.tags=_50 --scenario=Offline --mode=performance --test_query_count=10 --rerun --quiet + + mlcr --tags=install,python-venv --version=3.10.8 --name=mlperf --quiet + + mlcr --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --adr.python.name=mlperf --adr.python.version_min=3.8 --adr.compiler.tags=gcc --adr.openimages-preprocessed.tags=_50 --submitter=Community --implementation=cpp --hw_name=default --model=retinanet --backend=onnxruntime --device=cpu --scenario=Offline --quiet diff --git a/.github/workflows/test-mlc-tutorial-tvm.yml b/.github/workflows/test-mlc-tutorial-tvm.yml new file mode 100644 index 000000000..90997c9c2 --- /dev/null +++ b/.github/workflows/test-mlc-tutorial-tvm.yml @@ -0,0 +1,38 @@ +name: MLC tutorial tvm + +on: + pull_request: + branches: [ "main", "dev" ] + paths: + - '.github/workflows/test-mlc-tutorial-tvm.yml' + - '**' + - '!**.md' + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9"] + extra-options: [ "", " --adr.tvm.tags=_pip-install", " --adr.tvm.tags=_pip-install --adr.tvm-model.tags=_graph-executor"] + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install mlcflow + - name: Pull MLOps repository + run: | + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + mlcr --quiet --tags=get,sys-utils-cm + - name: Test MLC Tutorial TVM + run: | + mlcr --tags=run-mlperf,inference,_submission,_short --adr.python.name=mlperf --adr.python.version_min=3.8 --submitter=Community --implementation=python --hw_name=default --model=resnet50 --backend=tvm-onnx --device=cpu --scenario=Offline --mode=accuracy --test_query_count=5 --clean --quiet ${{ matrix.extra-options }} diff --git a/.github/workflows/test-mlperf-inference-abtf-poc.yml b/.github/workflows/test-mlperf-inference-abtf-poc.yml index 598869814..5e4399f7e 100644 --- a/.github/workflows/test-mlperf-inference-abtf-poc.yml +++ b/.github/workflows/test-mlperf-inference-abtf-poc.yml @@ -21,7 +21,7 @@ jobs: backend: [ "pytorch" ] implementation: [ "python" ] docker: [ "", " --docker --docker_it=no --docker_cm_repo=mlcommons@mlperf-automations --docker_cm_repo_branch=dev --docker_dt=yes" ] - extra-args: [ "--adr.compiler.tags=gcc", "--env.CM_MLPERF_LOADGEN_BUILD_FROM_SRC=off" ] + extra-args: [ "", "--env.CM_MLPERF_LOADGEN_BUILD_FROM_SRC=off" ] exclude: - os: ubuntu-24.04 python-version: "3.8" @@ -51,17 +51,13 @@ jobs: if: matrix.os == 'windows-latest' run: | git config --system core.longpaths true - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' - run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; $env:PYTHONUTF8 = "1"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' + - name: Install mlcflow run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow + pip install tabulate - name: Pull MLOps repository run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} #cm pull repo mlcommons@cm4abtf --branch=poc - name: Install Docker on macos @@ -119,4 +115,4 @@ jobs: - name: Test MLPerf Inference ABTF POC using ${{ matrix.backend }} on ${{ matrix.os }} run: | - cm run script --tags=run-abtf,inference,_poc-demo --test_query_count=2 --adr.cocoeval.version_max=1.5.7 --adr.cocoeval.version_max_usable=1.5.7 --quiet ${{ matrix.extra-args }} ${{ matrix.docker }} -v + mlcr --tags=run-abtf,inference,_poc-demo --test_query_count=2 --adr.cocoeval.version_max=1.5.7 --adr.cocoeval.version_max_usable=1.5.7 --quiet ${{ matrix.extra-args }} ${{ matrix.docker }} -v diff --git a/.github/workflows/test-mlperf-inference-bert-deepsparse-tf-onnxruntime-pytorch.yml b/.github/workflows/test-mlperf-inference-bert-deepsparse-tf-onnxruntime-pytorch.yml index 0e6ebe596..120b17a7a 100644 --- a/.github/workflows/test-mlperf-inference-bert-deepsparse-tf-onnxruntime-pytorch.yml +++ b/.github/workflows/test-mlperf-inference-bert-deepsparse-tf-onnxruntime-pytorch.yml @@ -1,11 +1,8 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: MLPerf inference bert (deepsparse, tf, onnxruntime, pytorch) on: - pull_request_target: - branches: [ "main", "dev", "mlperf-inference" ] + pull_request: + branches: [ "main", "dev" ] paths: - '.github/workflows/test-mlperf-inference-bert-deepsparse-tf-onnxruntime-pytorch.yml' - '**' @@ -35,25 +32,21 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' - run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' + - name: Install mlcflow run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow + pip install tabulate - name: Pull MLOps repository run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - name: Test MLPerf Inference Bert ${{ matrix.backend }} on ${{ matrix.os }} if: matrix.os == 'windows-latest' run: | - cm run script --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --hw_name=gh_${{ matrix.os }} --model=bert-99 --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --adr.loadgen.tags=_from-pip --pip_loadgen=yes --precision=${{ matrix.precision }} --target_qps=1 -v --quiet + mlcr --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --hw_name=gh_${{ matrix.os }} --model=bert-99 --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --adr.loadgen.tags=_from-pip --pip_loadgen=yes --precision=${{ matrix.precision }} --target_qps=1 -v --quiet - name: Test MLPerf Inference Bert ${{ matrix.backend }} on ${{ matrix.os }} if: matrix.os != 'windows-latest' run: | - cm run script --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --hw_name=gh_${{ matrix.os }}_x86 --model=bert-99 --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --precision=${{ matrix.precision }} --target_qps=1 -v --quiet + mlcr --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --hw_name=gh_${{ matrix.os }}_x86 --model=bert-99 --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --precision=${{ matrix.precision }} --target_qps=1 -v --quiet - name: Push Results if: github.repository_owner == 'gateoverflow' env: @@ -67,4 +60,4 @@ jobs: git config --global credential.https://github.com.helper "!gh auth git-credential" git config --global credential.https://gist.github.com.helper "" git config --global credential.https://gist.github.com.helper "!gh auth git-credential" - cm run script --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=dev --commit_message="Results from Bert GH action on ${{ matrix.os }}" --quiet + mlcr --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=dev --commit_message="Results from Bert GH action on ${{ matrix.os }}" --quiet diff --git a/.github/workflows/test-mlperf-inference-mlcommons-cpp-resnet50.yml b/.github/workflows/test-mlperf-inference-mlcommons-cpp-resnet50.yml index 7a700f574..57be88642 100644 --- a/.github/workflows/test-mlperf-inference-mlcommons-cpp-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-mlcommons-cpp-resnet50.yml @@ -4,7 +4,7 @@ name: MLPerf inference MLCommons C++ ResNet50 on: - pull_request_target: + pull_request: branches: [ "main", "dev", "mlperf-inference" ] paths: - '.github/workflows/test-mlperf-inference-mlcommons-cpp-resnet50.yml' @@ -32,27 +32,22 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' - run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' + - name: Install mlcflow run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow - name: Pull MLOps repository run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} - cm run script --quiet --tags=get,sys-utils-cm - cm run script --quiet --tags=install,prebuilt,llvm --version=${{ matrix.llvm-version }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} + mlcr --quiet --tags=get,sys-utils-cm + mlcr --quiet --tags=install,prebuilt,llvm --version=${{ matrix.llvm-version }} - name: Test MLPerf Inference MLCommons C++ ResNet50 on ${{ matrix.os }} if: matrix.os == 'windows-latest' run: | - cm run script --tags=app,mlperf,inference,mlcommons,cpp --submitter="MLCommons" --hw_name=gh_${{ matrix.os }} --adr.loadgen.tags=_from-pip --pip_loadgen=yes -v --quiet + mlcr --tags=app,mlperf,inference,mlcommons,cpp --submitter="MLCommons" --hw_name=gh_${{ matrix.os }} --adr.loadgen.tags=_from-pip --pip_loadgen=yes -v --quiet - name: Test MLPerf Inference MLCommons C++ ResNet50 on ${{ matrix.os }} if: matrix.os != 'windows-latest' run: | - cmr "app mlperf inference mlcommons cpp" --submitter="MLCommons" --hw_name=gh_${{ matrix.os }} -v --quiet + mlcr --tags=app,mlperf,inference,mlcommons,cpp --submitter="MLCommons" --hw_name=gh_${{ matrix.os }} -v --quiet - name: Push Results if: github.repository_owner == 'gateoverflow' env: @@ -66,4 +61,4 @@ jobs: git config --global credential.https://github.com.helper "!gh auth git-credential" git config --global credential.https://gist.github.com.helper "" git config --global credential.https://gist.github.com.helper "!gh auth git-credential" - cm run script --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=dev --commit_message="Results from MLCommons C++ ResNet50 GH action on ${{ matrix.os }}" --quiet + mlcr --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=dev --commit_message="Results from MLCommons C++ ResNet50 GH action on ${{ matrix.os }}" --quiet diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-mlperf-inference-resnet50.yml index bdf573899..3a22167ef 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-mlperf-inference-resnet50.yml @@ -10,7 +10,7 @@ on: - '**' - '!**.md' jobs: - build: + mlperf-inference-r50: runs-on: ${{ matrix.os }} env: CM_INDEX: "on" @@ -39,27 +39,23 @@ jobs: run: | git config --system core.longpaths true - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' - run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' + - name: Install mlcflow run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow + pip install tabulate - name: Pull MLOps repo run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - name: Test MLPerf Inference ResNet50 (Windows) if: matrix.os == 'windows-latest' run: | - cm run script --tags=run-mlperf,inference,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }}_x86 --model=resnet50 --adr.loadgen.tags=_from-pip --pip_loadgen=yes --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --target_qps=1 -v --quiet + mlcr --tags=run-mlperf,inference,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }}_x86 --model=resnet50 --adr.loadgen.tags=_from-pip --pip_loadgen=yes --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --target_qps=1 -v --quiet - name: Test MLPerf Inference ResNet50 (Linux/macOS) if: matrix.os != 'windows-latest' run: | - cm run script --tags=run-mlperf,inference,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }}_x86 --model=resnet50 --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --target_qps=1 -v --quiet + mlcr --tags=run-mlperf,inference,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }}_x86 --model=resnet50 --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=500 --target_qps=1 -v --quiet - name: Retrieve secrets from Keeper id: ksecrets uses: Keeper-Security/ksm-action@master @@ -74,4 +70,4 @@ jobs: run: | git config --global user.name mlcommons-bot git config --global user.email "mlcommons-bot@users.noreply.github.com" - cm run script --tags=push,github,mlperf,inference,submission --env.CM_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 + mlcr --tags=push,github,mlperf,inference,submission --env.CM_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 diff --git a/.github/workflows/test-mlperf-inference-retinanet.yml b/.github/workflows/test-mlperf-inference-retinanet.yml index 182f04321..d101ea14e 100644 --- a/.github/workflows/test-mlperf-inference-retinanet.yml +++ b/.github/workflows/test-mlperf-inference-retinanet.yml @@ -3,7 +3,7 @@ name: MLPerf inference retinanet on: - pull_request_target: + pull_request: branches: [ "main", "dev" ] paths: - '.github/workflows/test-mlperf-inference-retinanet.yml' @@ -38,26 +38,22 @@ jobs: if: matrix.os == 'windows-latest' run: | git config --system core.longpaths true - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' - run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' + - name: Install mlcflow run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow + pip install tabulate - name: Pull MLOps repo run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - name: Test MLPerf Inference Retinanet using ${{ matrix.backend }} on ${{ matrix.os }} if: matrix.os == 'windows-latest' run: | - cm run script --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }} --model=retinanet --adr.loadgen.tags=_from-pip --pip_loadgen=yes --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --quiet -v --target_qps=1 + mlcr --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }} --model=retinanet --adr.loadgen.tags=_from-pip --pip_loadgen=yes --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --quiet -v --target_qps=1 - name: Test MLPerf Inference Retinanet using ${{ matrix.backend }} on ${{ matrix.os }} if: matrix.os != 'windows-latest' run: | - cm run script --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }}_x86 --model=retinanet --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --adr.compiler.tags=gcc --quiet -v --target_qps=1 + mlcr --tags=run,mlperf,inference,generate-run-cmds,_submission,_short --submitter="MLCommons" --pull_changes=yes --pull_inference_changes=yes --hw_name=gh_${{ matrix.os }}_x86 --model=retinanet --implementation=${{ matrix.implementation }} --backend=${{ matrix.backend }} --device=cpu --scenario=Offline --test_query_count=5 --quiet -v --target_qps=1 - name: Push Results if: github.repository_owner == 'gateoverflow' env: diff --git a/.github/workflows/test-mlperf-inference-rgat.yml b/.github/workflows/test-mlperf-inference-rgat.yml index 5511151eb..dc2a7eb5c 100644 --- a/.github/workflows/test-mlperf-inference-rgat.yml +++ b/.github/workflows/test-mlperf-inference-rgat.yml @@ -1,4 +1,4 @@ -name: MLPerf inference rgat +name: MLPerf inference R-GAT on: pull_request: @@ -25,20 +25,16 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install cm4mlops on Windows - if: matrix.os == 'windows-latest' + - name: Install mlcflow run: | - $env:CM_PULL_DEFAULT_MLOPS_REPO = "no"; pip install cm4mlops - - name: Install dependencies on Unix Platforms - if: matrix.os != 'windows-latest' - run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow + pip install tabulate - name: Pull MLOps repository run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - name: Test MLPerf Inference R-GAT using ${{ matrix.backend }} on ${{ matrix.os }} run: | - cm run script --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 + 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: @@ -52,4 +48,4 @@ jobs: git config --global credential.https://github.com.helper "!gh auth git-credential" git config --global credential.https://gist.github.com.helper "" git config --global credential.https://gist.github.com.helper "!gh auth git-credential" - cm run script --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=auto-update --commit_message="Results from R-GAT GH action on ${{ matrix.os }}" --quiet + mlcr --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/mlcommons/mlperf_inference_test_submissions_v5.0 --repo_branch=auto-update --commit_message="Results from R-GAT GH action on ${{ matrix.os }}" --quiet diff --git a/.github/workflows/test-mlperf-inference-tvm.yml b/.github/workflows/test-mlperf-inference-tvm.yml index 359b5be72..fa363d65c 100644 --- a/.github/workflows/test-mlperf-inference-tvm.yml +++ b/.github/workflows/test-mlperf-inference-tvm.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - # We are doing similar test on our tvm tutorial test. So, this test is not necessary name: MLPerf inference resnet50 using TVM. diff --git a/.github/workflows/test-mlperf-loadgen-onnx-huggingface-bert-fp32-squad.yml b/.github/workflows/test-mlperf-loadgen-onnx-huggingface-bert-fp32-squad.yml index 0055a1c31..ce579c8bd 100644 --- a/.github/workflows/test-mlperf-loadgen-onnx-huggingface-bert-fp32-squad.yml +++ b/.github/workflows/test-mlperf-loadgen-onnx-huggingface-bert-fp32-squad.yml @@ -1,11 +1,8 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: MLPerf loadgen with HuggingFace bert onnx fp32 squad model on: pull_request: - branches: [ "main", "dev", "mlperf-inference" ] + branches: [ "main", "dev" ] paths: - '.github/workflows/test-mlperf-loadgen-onnx-huggingface-bert-fp32-squad.yml' - '**' @@ -26,12 +23,13 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies on Unix Platforms + - name: Install dependencies run: | - CM_PULL_DEFAULT_MLOPS_REPO=no pip install cm4mlops + pip install mlcflow + pip install tabulate - name: Pull MLOps repository run: | - cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }} + mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} - name: Test MLPerf loadgen with HuggingFace bert onnx fp32 squad model run: | - cm run script --tags=python,app,loadgen-generic,_onnxruntime,_custom,_huggingface,_model-stub.ctuning/mlperf-inference-bert-onnx-fp32-squad-v1.1 --quiet + mlcr --tags=python,app,loadgen-generic,_onnxruntime,_custom,_huggingface,_model-stub.ctuning/mlperf-inference-bert-onnx-fp32-squad-v1.1 --quiet diff --git a/.github/workflows/test-cm4mlops-wheel-ubuntu.yml b/.github/workflows/test-mlperf-wheel.yml similarity index 54% rename from .github/workflows/test-cm4mlops-wheel-ubuntu.yml rename to .github/workflows/test-mlperf-wheel.yml index 6ec9905d6..2ff1595fb 100644 --- a/.github/workflows/test-cm4mlops-wheel-ubuntu.yml +++ b/.github/workflows/test-mlperf-wheel.yml @@ -6,7 +6,7 @@ on: - main - dev paths: - - '.github/workflows/test-cm4mlops-wheel-ubuntu.yml' + - '.github/workflows/test-mlperf-wheel.yml' - 'setup.py' jobs: @@ -14,11 +14,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-20.04] - python-version: ['3.8', '3.11', '3.12'] - exclude: - - os: ubuntu-latest - python-version: "3.8" + os: [macos-latest, ubuntu-latest, windows-latest] + python-version: [ '3.8', '3.13'] runs-on: ${{ matrix.os }} @@ -34,12 +31,22 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies + if: runner.os == 'linux' run: | - sudo apt-get update + sudo apt-get update sudo apt-get install -y python3 python3-pip python3-venv - name: Build the Python wheel + if: runner.os != 'Windows' run: | - python3 -m venv cm - source cm/bin/activate + python3 -m venv mlc + source mlc/bin/activate + python3 -m pip install . -v + + - name: Build the Python wheel + if: runner.os == 'Windows' + run: | + python3 -m venv mlc + mlc\Scripts\activate.bat + git config --system core.longpaths true python3 -m pip install . -v diff --git a/.github/workflows/test-scc24-sdxl.yaml b/.github/workflows/test-scc24-sdxl.yaml index 65e2e7510..50849e7b1 100644 --- a/.github/workflows/test-scc24-sdxl.yaml +++ b/.github/workflows/test-scc24-sdxl.yaml @@ -25,13 +25,13 @@ jobs: python3 -m venv gh_action source gh_action/bin/activate export CM_REPOS=$HOME/GH_CM - pip install --upgrade cm4mlops + pip install --upgrade mlcflow pip install tabulate - cm pull repo - cm run script --tags=run-mlperf,inference,_find-performance,_r4.1-dev,_short,_scc24-base --pull_changes=yes --pull_inference_changes=yes --model=sdxl --implementation=reference --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --clean - cm run script --tags=run-mlperf,inference,_r4.1-dev,_short,_scc24-base --model=sdxl --implementation=reference --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --clean - cm run script --tags=generate,inference,submission --clean --run-checker --tar=yes --env.CM_TAR_OUTFILE=submission.tar.gz --division=open --category=datacenter --run_style=test --adr.submission-checker.tags=_short-run --quiet --submitter=MLCommons --submission_dir=$HOME/scc_gh_action_submissions --results_dir=$HOME/scc_gh_action_results/test_results - cm run script --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/gateoverflow/cm4mlperf-inference --repo_branch=mlperf-inference-results-scc24 --commit_message="Results from self hosted Github actions - NVIDIARTX4090" --quiet --submission_dir=$HOME/scc_gh_action_submissions + mlc pull repo + mlcr --tags=run-mlperf,inference,_find-performance,_r4.1-dev,_short,_scc24-base --pull_changes=yes --pull_inference_changes=yes --model=sdxl --implementation=reference --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --clean + mlcr --tags=run-mlperf,inference,_r4.1-dev,_short,_scc24-base --model=sdxl --implementation=reference --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --clean + mlcr --tags=generate,inference,submission --clean --run-checker --tar=yes --env.CM_TAR_OUTFILE=submission.tar.gz --division=open --category=datacenter --run_style=test --adr.submission-checker.tags=_short-run --quiet --submitter=MLCommons --submission_dir=$HOME/scc_gh_action_submissions --results_dir=$HOME/scc_gh_action_results/test_results + mlcr --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/gateoverflow/cm4mlperf-inference --repo_branch=mlperf-inference-results-scc24 --commit_message="Results from self hosted Github actions - NVIDIARTX4090" --quiet --submission_dir=$HOME/scc_gh_action_submissions build_nvidia: if: github.repository_owner == 'gateoverflow' @@ -53,10 +53,10 @@ jobs: python3 -m venv gh_action source gh_action/bin/activate export CM_REPOS=$HOME/GH_CM - pip install --upgrade cm4mlops + pip install --upgrade mlcflow pip install tabulate - cm pull repo - cm run script --tags=run-mlperf,inference,_find-performance,_r4.1-dev,_short,_scc24-base --pull_changes=yes --model=sdxl --implementation=nvidia --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --pull_changes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --hw_name=go-spr --custom_system_nvidia=yes --clean - cm run script --tags=run-mlperf,inference,_r4.1-dev,_short,_scc24-base --model=sdxl --implementation=nvidia --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --clean - cm run script --tags=generate,inference,submission --clean --run-checker --tar=yes --env.CM_TAR_OUTFILE=submission.tar.gz --division=open --category=datacenter --run_style=test --adr.submission-checker.tags=_short-run --quiet --submitter=MLCommons --submission_dir=$HOME/scc_gh_action_submissions --results_dir=$HOME/scc_gh_action_results/test_results - cm run script --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/gateoverflow/cm4mlperf-inference --repo_branch=mlperf-inference-results-scc24 --commit_message="Results from self hosted Github actions - NVIDIARTX4090" --quiet --submission_dir=$HOME/scc_gh_action_submissions + mlc pull repo + mlcr --tags=run-mlperf,inference,_find-performance,_r4.1-dev,_short,_scc24-base --pull_changes=yes --model=sdxl --implementation=nvidia --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --pull_changes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --hw_name=go-spr --custom_system_nvidia=yes --clean + mlcr --tags=run-mlperf,inference,_r4.1-dev,_short,_scc24-base --model=sdxl --implementation=nvidia --backend=${{ matrix.backend }} --category=datacenter --scenario=Offline --execution_mode=test --device=${{ matrix.device }} --precision=${{ matrix.precision }} --docker --docker_it=no --docker_cm_repo=$CM_DOCKER_REPO --docker_cm_repo_branch=$CM_DOCKER_REPO_BRANCH --docker_dt=yes --quiet --results_dir=$HOME/scc_gh_action_results --submission_dir=$HOME/scc_gh_action_submissions --env.CM_MLPERF_MODEL_SDXL_DOWNLOAD_TO_HOST=yes --clean + mlcr --tags=generate,inference,submission --clean --run-checker --tar=yes --env.CM_TAR_OUTFILE=submission.tar.gz --division=open --category=datacenter --run_style=test --adr.submission-checker.tags=_short-run --quiet --submitter=MLCommons --submission_dir=$HOME/scc_gh_action_submissions --results_dir=$HOME/scc_gh_action_results/test_results + mlcr --tags=push,github,mlperf,inference,submission --repo_url=https://github.com/gateoverflow/cm4mlperf-inference --repo_branch=mlperf-inference-results-scc24 --commit_message="Results from self hosted Github actions - NVIDIARTX4090" --quiet --submission_dir=$HOME/scc_gh_action_submissions diff --git a/VERSION b/VERSION index ead87ff1c..8acdd82b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.26 +0.0.1 diff --git a/automation/__init__.py b/automation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/automation/cache/_cm.json b/automation/cache/meta.json similarity index 100% rename from automation/cache/_cm.json rename to automation/cache/meta.json diff --git a/automation/script/__init__.py b/automation/script/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/automation/script/docker.py b/automation/script/docker.py new file mode 100644 index 000000000..bd511d7e3 --- /dev/null +++ b/automation/script/docker.py @@ -0,0 +1,356 @@ +import os +from mlc import utils +from utils import * +import logging +from pathlib import PureWindowsPath, PurePosixPath +from script.docker_utils import * +import copy + + +def dockerfile(self_module, input_params): + + # Step 1: Prune and prepare input + prune_result = prune_input( + {'input': input_params, 'extra_keys_starts_with': ['docker_']}) + if prune_result['return'] > 0: + return prune_result + + run_command_arc = prune_result['new_input'] + current_directory = os.getcwd() + is_quiet_mode = input_params.get('quiet', False) + verbose = input_params.get('v', False) + is_console_output = input_params.get('out') == 'con' + + # Step 2: Search for scripts + search_result = self_module.search(input_params) + if search_result['return'] > 0: + return search_result + + scripts_list = search_result['list'] + if not scripts_list: + return {'return': 1, 'error': 'No scripts were found'} + + # Step 3: Process Dockerfile-related configurations + environment_vars = 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', {}) + tag_values = input_params.get('tags', '').split(",") + variation_tags = [tag[1:] for tag in tag_values if tag.startswith("_")] + + # Step 4: Iterate over scripts and generate Dockerfile + for script in sorted(scripts_list, key=lambda x: x.meta.get('alias', '')): + metadata = script.meta + script_directory = script.path + script_tags = metadata.get("tags", []) + script_alias = metadata.get('alias', '') + script_uid = metadata.get('uid', '') + + run_state = { + 'deps': [], + 'fake_deps': [], + 'parent': None, + 'script_id': f"{script_alias},{script_uid}", + 'script_variation_tags': variation_tags + } + docker_settings = metadata.get('docker', {}) + docker_settings['dockerfile_env'] = dockerfile_environment_vars + 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, + 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 + + 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, + deps=[], # Add your dependencies if needed + post_deps=[], # Add post dependencies if needed + prehook_deps=[], # Add prehook dependencies if needed + posthook_deps=[], # Add posthook dependencies if needed + new_env_keys_from_meta=[], # Add keys from meta if needed + new_state_keys_from_meta=[], # Add state keys from meta if needed + add_deps_recursive=add_deps_recursive, + run_state=run_state, + recursion_spaces='', + verbose=verbose # Set to True or False as needed + ) + if update_variations_result['return'] > 0: + return update_variations_result + + # Set Docker-specific configurations + docker_settings = state_data.get('docker', {}) + docker_settings['dockerfile_env'] = dockerfile_environment_vars + dockerfile_environment_vars['CM_RUN_STATE_DOCKER'] = True + + if not docker_settings.get('run', True) and not input_params.get( + 'docker_run_override', False): + logging.info("Docker 'run' is set to False in meta.json") + 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 + + # Prune temporary environment variables + run_command = copy.deepcopy(run_command_arc) + for key in list(run_command.get('env', {}).keys()): + if key.startswith("CM_TMP_"): + del run_command['env'][key] + + # Regenerate script command + regenerate_result = regenerate_script_cmd({ + 'script_uid': script_uid, + 'script_alias': script_alias, + 'run_cmd': run_command, + 'tags': script_tags, + 'fake_run': True, + 'docker_settings': docker_settings, + 'docker_run_cmd_prefix': input_params.get('docker_run_cmd_prefix', docker_settings.get('run_cmd_prefix', '')) + }) + if regenerate_result['return'] > 0: + return regenerate_result + + run_command_string = regenerate_result['run_cmd_string'] + + # Collect Dockerfile inputs + dockerfile_inputs = { + key: input_params.get( + f"docker_{key}", docker_settings.get( + key, get_docker_default(key))) + for key in [ + "mlc_repo", "mlc_repo_branch", "base_image", "os", "os_version", + "mlc_repos", "skip_mlc_sys_upgrade", "extra_sys_deps", + "gh_token", "fake_run_deps", "run_final_cmds", "real_run", "copy_files", "path" + ] + if (value := input_params.get(f"docker_{key}", docker_settings.get(key, get_docker_default(key)))) is not None + } + + # Determine Dockerfile suffix and path + docker_base_image = dockerfile_inputs.get('base_image') + docker_path = dockerfile_inputs.get('path') + if not docker_path: + docker_path = script_directory + docker_filename_suffix = ( + docker_base_image.replace('/', '-').replace(':', '-') + if docker_base_image else f"{dockerfile_inputs['os']}_{dockerfile_inputs['os_version']}" + ) + dockerfile_path = os.path.join( + docker_path, + 'dockerfiles', + f"{docker_filename_suffix}.Dockerfile") + + # Handle optional dependencies and comments + if input_params.get('print_deps'): + mlc_input = { + 'action': 'run', 'automation': 'script', 'tags': input_params.get('tags'), + 'print_deps': True, 'quiet': True, 'silent': True, + 'fake_run': True, 'fake_deps': True + } + deps_result = self_module.action_object.access(mlc_input) + if deps_result['return'] > 0: + return deps_result + comments = [ + f"#RUN {dep}" for dep in deps_result['new_state']['print_deps']] + else: + comments = [] + + # Push Docker image if specified + if input_params.get('docker_push_image') in [True, 'True', 'yes']: + environment_vars['CM_DOCKER_PUSH_IMAGE'] = 'yes' + + # Generate Dockerfile + mlc_docker_input = { + 'action': 'run', 'automation': 'script', 'tags': 'build,dockerfile', + 'fake_run_option': " " if dockerfile_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, + 'quiet': True, 'v': input_params.get('v', False), 'real_run': True + } + mlc_docker_input.update(dockerfile_inputs) + + dockerfile_result = self_module.action_object.access(mlc_docker_input) + if dockerfile_result['return'] > 0: + return dockerfile_result + + logging.info(f"Dockerfile generated at {dockerfile_path}") + + return {'return': 0} + + +def docker_run(self_module, i): + """ + Automates the execution of MLC scripts within a Docker container. + + Args: + self_module: Reference to the current module for internal calls. + i: Dictionary containing input parameters for the Docker execution. + + Returns: + Dictionary with the result of the operation. Keys: + - 'return': 0 on success, >0 on error. + - 'error': Error message (if any). + """ + + # Extract and handle basic inputs + quiet = i.get('quiet', False) + detached = i.get('docker_detached', i.get('docker_dt', 'no')) + interactive = i.get('docker_interactive', i.get('docker_it', '')) + verbose = i.get('v', False) + show_time = i.get('show_time', False) + + env = i.get('env', {}) + noregenerate_docker_file = i.get('docker_noregenerate', False) + norecreate_docker_image = not i.get('docker_recreate', False) + + if i.get('docker_skip_build', False): + noregenerate_docker_file = True + norecreate_docker_image = True + env['CM_DOCKER_SKIP_BUILD'] = 'yes' + + # Prune unnecessary Docker-related input keys + r = prune_input({'input': i, 'extra_keys_starts_with': ['docker_']}) + f_run_cmd = r['new_input'] + + # Regenerate Dockerfile if required + if not noregenerate_docker_file: + r = dockerfile(self_module, i) + if r['return'] > 0: + return r + + # Save current directory and prepare to search for scripts + cur_dir = os.getcwd() + r = self_module.search(i) + if r['return'] > 0: + return r + + lst = r['list'] + if not lst: + return {'return': 1, 'error': 'No scripts were found'} + + env['CM_RUN_STATE_DOCKER'] = False + state, const, const_state = i.get( + 'state', {}), i.get( + 'const', {}), i.get( + 'const_state', {}) + variation_tags = [t[1:] + for t in i.get('tags', '').split(",") if t.startswith("_")] + + docker_cache = i.get('docker_cache', "yes") + if docker_cache.lower() in ["no", "false"]: + env.setdefault('CM_DOCKER_CACHE', docker_cache) + + image_repo = i.get('docker_image_repo', '') + add_deps_recursive = i.get('add_deps_recursive') + + # Ensure Docker is available + r = self_module.action_object.access( + {'action': 'run', 'automation': 'script', 'tags': "get,docker"}) + if r['return'] > 0: + return r + + # Process each artifact + for artifact in sorted(lst, key=lambda x: x.meta.get('alias', '')): + meta, script_path = artifact.meta, artifact.path + tags, script_alias, script_uid = meta.get( + "tags", []), meta.get( + 'alias', ''), meta.get( + 'uid', '') + + mounts = copy.deepcopy(i.get('docker_mounts', [])) + variations = meta.get('variations', {}) + docker_settings = meta.get('docker', {}) + state['docker'] = docker_settings + run_state = { + 'deps': [], 'fake_deps': [], 'parent': None, + 'script_id': f"{script_alias},{script_uid}", + 'script_variation_tags': variation_tags + } + + # Update state and handle variations + r = self_module.update_state_from_meta(meta, env, state, const, const_state, deps=[], + post_deps=[], + prehook_deps=[], + posthook_deps=[], + new_env_keys=[], + new_state_keys=[], run_state=run_state, i=i) + if r['return'] > 0: + return r + + r = self_module._update_state_from_variations( + i, meta, variation_tags, variations, env, state, const, const_state, deps=[], + post_deps=[], + prehook_deps=[], + posthook_deps=[], + new_env_keys_from_meta=[], + new_state_keys_from_meta=[], + add_deps_recursive=add_deps_recursive, run_state=run_state, recursion_spaces='', + verbose=False) + if r['return'] > 0: + return r + + # Skip scripts marked as non-runnable + if not docker_settings.get('run', True) and not i.get( + 'docker_run_override', False): + logging.info("docker.run set to False in meta.yaml") + continue + + r = self_module._update_env_from_input(env, i) + if r['return'] > 0: + return r + + # Handle environment variable-based mounts + mounts = process_mounts(mounts, env, i, docker_settings) + if mounts is None: + return {'return': 1, 'error': 'Error processing mounts'} + + # Prepare Docker-specific inputs + docker_inputs, dockerfile_path = prepare_docker_inputs( + i, docker_settings, script_path) + if docker_inputs is None: + return {'return': 1, 'error': 'Error preparing Docker inputs'} + + # Generate the run command + r = regenerate_script_cmd({'script_uid': script_uid, + 'script_alias': script_alias, + 'tags': tags, + 'run_cmd': f_run_cmd}) + if r['return'] > 0: + return r + final_run_cmd = r['run_cmd_string'] + + # Execute the Docker container + mlc_docker_input = { + 'action': 'run', 'automation': 'script', 'tags': 'run,docker,container', + 'recreate': 'yes' if not norecreate_docker_image else 'no', + 'env': env, 'interactive': interactive, 'mounts': mounts, 'detached': detached, + 'script_tags': i.get('tags'), 'run_cmd': final_run_cmd, 'v': verbose, + 'quiet': True, 'real_run': True, 'add_deps_recursive': {'build-docker-image': {'dockerfile': dockerfile_path}}, + **docker_inputs + } + r = self_module.action_object.access(mlc_docker_input) + if r['return'] > 0: + return r + + return {'return': 0} diff --git a/automation/script/docker_utils.py b/automation/script/docker_utils.py new file mode 100644 index 000000000..2e1f40b9f --- /dev/null +++ b/automation/script/docker_utils.py @@ -0,0 +1,283 @@ +import os +from mlc import utils +from utils import * +import logging +from pathlib import PureWindowsPath, PurePosixPath +from script.docker_utils import * +import copy + + +def process_mounts(mounts, env, i, docker_settings): + """ + Processes and updates the Docker mounts based on the provided inputs and environment variables. + + Args: + mounts: List of existing mount configurations. + env: Current environment variables dictionary. + i: Input dictionary with user-specified overrides. + docker_settings: Docker-specific settings from the script's metadata. + + Returns: + Updated mounts list or None in case of an error. + """ + try: + # Add mounts specified via `env` variables + for mount_key in docker_settings.get('env_mounts', []): + mount_path = env.get(mount_key, '') + if mount_path: + mounts.append(mount_path) + + # Include user-specified additional mounts + if 'docker_additional_mounts' in i: + mounts.extend(i['docker_additional_mounts']) + + return mounts + except Exception as e: + logging.error(f"Error processing mounts: {e}") + return None + + +def prepare_docker_inputs(i, docker_settings, script_path): + """ + Prepares Docker-specific inputs such as Dockerfile path and runtime options. + + Args: + i: Input dictionary with user-specified overrides. + docker_settings: Docker-specific settings from the script's metadata. + script_path: Path to the script being executed. + + Returns: + Tuple with Docker inputs dictionary and Dockerfile path or None in case of an error. + """ + try: + dockerfile_path = os.path.join( + script_path, docker_settings.get( + 'dockerfile', 'Dockerfile')) + docker_args = docker_settings.get('args', {}) + docker_image = i.get('docker_image', docker_settings.get('image', '')) + + docker_inputs = { + 'dockerfile': dockerfile_path, + 'docker_image': docker_image, + 'docker_args': docker_args + } + + return docker_inputs, dockerfile_path + except Exception as e: + logging.error(f"Error preparing Docker inputs: {e}") + return None, None + + +def update_docker_paths(path, mounts=None, force_target_path=''): + """ + Update and return the absolute paths for a given host path and its container equivalent. + Optionally updates a mounts list with the mapping of host and container paths. + + :param path: The original host path. + :param mounts: A list to store host-to-container path mappings in the format "host_path:container_path". + :param force_target_path: Optional; overrides the default container path target. + :return: A tuple of (original_host_path, container_path). + """ + if not path: + return '', '' # Return empty paths if no path is provided. + + # Normalize and resolve the absolute path. + host_path = os.path.abspath(path) + container_path = host_path # Default to the same path for containers. + + # Handle Windows-specific path conversion for Docker. + if os.name == 'nt': + windows_path = PureWindowsPath(host_path) + container_path = str(PurePosixPath('/', *windows_path.parts[1:])) + + # Ensure the container path starts with a forward slash. + if not container_path.startswith('/'): + container_path = '/' + container_path + + # Prepend default container mount base unless overridden. + container_path = '/mlc-mount' + \ + container_path if not force_target_path else force_target_path + + # Determine the mount string based on whether the path is a file or + # directory. + if os.path.isfile(host_path) or not os.path.isdir(host_path): + mount_entry = f"{os.path.dirname(host_path)}:{os.path.dirname(container_path)}" + else: + mount_entry = f"{host_path}:{container_path}" + + # Add the mount entry to the mounts list if it's not already present. + if mounts is not None: + if all(mount.lower() != mount_entry.lower() for mount in mounts): + mounts.append(mount_entry) + + return host_path, container_path + + +def regenerate_script_cmd(i): + + script_uid = i['script_uid'] + script_alias = i['script_alias'] + tags = i['tags'] + docker_settings = i.get('docker_settings', {}) + fake_run = i.get('fake_run', False) + + i_run_cmd = i['run_cmd'] + + # Remove environment variables with host path values + if 'env' in i_run_cmd: + env = i_run_cmd['env'] + for key in list(env): + value = env[key] + + # Check if the value is a string containing the specified paths + if isinstance(value, str) and ( + os.path.join("local", "cache", "") in value or + os.path.join("MLC", "repos", "") in value + ): + del env[key] + + # Check if the value is a list and remove matching items + elif isinstance(value, list): + # Identify values to remove + values_to_remove = [ + val for val in value + if isinstance(val, str) and ( + os.path.join("local", "cache", "") in val or + os.path.join("MLC", "repos", "") in val + ) + ] + + # Remove key if all values match; otherwise, filter the list + if len(values_to_remove) == len(value): + del env[key] + else: + env[key] = [ + val for val in value if val not in values_to_remove] + + docker_run_cmd_prefix = i.get('docker_run_cmd_prefix', '') + + # Regenerate command from dictionary input + run_cmd = 'mlc run script' + + skip_input_for_fake_run = docker_settings.get( + 'skip_input_for_fake_run', []) + add_quotes_to_keys = docker_settings.get('add_quotes_to_keys', []) + + def rebuild_flags( + command_dict, + is_fake_run, + skip_keys_for_fake_run, + quote_keys, + prefix + ): + """ + Recursively rebuilds command-line flags from a dictionary of inputs. + + :param command_dict: Dictionary containing command-line keys and values. + :param is_fake_run: Boolean indicating if this is a fake run. + :param skip_keys_for_fake_run: List of keys to skip in fake run mode. + :param quote_keys: List of keys that require values to be quoted. + :param prefix: String to prepend to keys for hierarchical keys. + :return: A reconstructed command-line string. + """ + command_line = "" + + # Sort keys to ensure 'tags' appears first if present. + keys = sorted(command_dict.keys(), key=lambda x: x != "tags") + + for key in keys: + # Construct the full key with the prefix. + full_key = f"{prefix}.{key}" if prefix else key + + # Skip keys marked for exclusion in fake run mode. + if is_fake_run and full_key in skip_keys_for_fake_run: + continue + + value = command_dict[key] + quote = '\\"' if full_key in quote_keys else "" + + # Recursively process nested dictionaries. + if isinstance(value, dict): + command_line += rebuild_flags( + value, + is_fake_run, + skip_keys_for_fake_run, + quote_keys, + full_key + ) + # Process lists by concatenating values with commas. + elif isinstance(value, list): + list_values = ",".join( + f"{quote}{str(item)}{quote}" for item in value) + command_line += f" --{full_key},={list_values}" + # Process scalar values. + else: + command_line += f" --{full_key}={quote}{str(value)}{quote}" + + return command_line + + run_cmd += rebuild_flags(i_run_cmd, + fake_run, + skip_input_for_fake_run, + add_quotes_to_keys, + '') + + run_cmd = docker_run_cmd_prefix + ' && ' + \ + run_cmd if docker_run_cmd_prefix != '' else run_cmd + + return {'return': 0, 'run_cmd_string': run_cmd} + + +def get_docker_default(key): + defaults = { + "mlc_repo": "mlcommons@mlperf-automations", + "mlc_repo_branch": "mlc", + "os": "ubuntu", + "os_version": "24.04", + "fake_run_deps": False, + "run_final_cmds": [], + "skip_run_cmd": False, + "image_tag_extra": "-latest" + } + if key in defaults: + return defaults[key] + return None + + +def get_host_path(value): + path_split = value.split(os.sep) + if len(path_split) == 1: + return value + + new_value = '' + if "cache" in path_split and "local": + repo_entry_index = path_split.index("local") + if len(path_split) >= repo_entry_index + 3: + return os.sep.join(path_split[0:repo_entry_index + 3]) + + return value + + +def get_container_path_script(i): + tmp_dep_cached_path = i['tmp_dep_cached_path'] + value_mnt, value_env = get_container_path(tmp_dep_cached_path) + return {'return': 0, 'value_mnt': value_mnt, 'value_env': value_env} + + +def get_container_path(value): + path_split = value.split(os.sep) + if len(path_split) == 1: + return value + + new_value = '' + if "cache" in path_split and "local" in path_split: + new_path_split = ["", "home", "mlcuser", "MLC", "repos"] + repo_entry_index = path_split.index("local") + if len(path_split) >= repo_entry_index + 3: + new_path_split1 = new_path_split + \ + path_split[repo_entry_index:repo_entry_index + 3] + new_path_split2 = new_path_split + path_split[repo_entry_index:] + return "/".join(new_path_split1), "/".join(new_path_split2) + else: + orig_path, target_path = update_path_for_docker(path=value) + return target_path, target_path diff --git a/automation/script/_cm.json b/automation/script/meta.json similarity index 100% rename from automation/script/_cm.json rename to automation/script/meta.json diff --git a/automation/script/module.py b/automation/script/module.py index 2ddc59c67..bceca05d3 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -11,20 +11,24 @@ import os import logging -from cmind.automation import Automation -from cmind import utils -from cmind import __version__ as current_cm_version +from mlc.main import Automation +import mlc.utils as utils +from mlc.main import __version__ as current_mlc_version +from utils import * -class CAutomation(Automation): +class ScriptAutomation(Automation): + """ CM "script" automation actions (making native scripts more portable, deterministic, reusable and reproducible) """ ############################################################ - def __init__(self, cmind, automation_file): - super().__init__(cmind, __file__) + def __init__(self, action_object, automation_file): + # super().__init__(cmind, __file__) + super().__init__(action_object, "script", automation_file) + # print("Base init over") logging.basicConfig(level=logging.INFO) self.os_info = {} self.run_state = {} @@ -33,7 +37,6 @@ def __init__(self, cmind, automation_file): self.run_state['parent'] = None self.run_state['version_info'] = [] self.run_state['cache'] = False - self.file_with_cached_state = 'cm-cached-state.json' self.tmp_file_env = 'tmp-env' @@ -188,7 +191,7 @@ def run(self, i): (print_readme) (bool): if True, will print README with all CM steps (deps) to run a given script - (script_call_prefix) (str): how to call script in logs and READMEs (cm run script) + (script_call_prefix) (str): how to call script in logs and READMEs (mlc run script) (skip_sys_utils) (bool): if True, set env['CM_SKIP_SYS_UTILS']='yes' to skip CM sys installation @@ -224,7 +227,7 @@ def run(self, i): def _run(self, i): - from cmind import utils + # from cmind import utils import copy import time import shutil @@ -257,10 +260,11 @@ def _run(self, i): return { 'return': 1, 'error': 'Current directory "{}" is not writable - please change it'.format(os.getcwd())} + ''' # Check if has default config - r = self.cmind.access({'action': 'load', - 'automation': 'cfg,88dce9c160324c5d', - 'artifact': 'default'}) + r = self.action_object.access({'action': 'load', + 'automation': 'cfg,88dce9c160324c5d', + 'artifact': 'default'}) if r['return'] == 0: config = r['config'] @@ -268,7 +272,7 @@ def _run(self, i): if len(script_input) > 0: utils.merge_dicts({'dict1': i, 'dict2': script_input}) - + ''' recursion_int = int(i.get('recursion_int', 0)) + 1 start_time = time.time() @@ -289,16 +293,6 @@ def _run(self, i): 'append_lists': True, 'append_unique': True}) - # Check simplified CMD: cm run script "get compiler" - # If artifact has spaces, treat them as tags! - artifact = i.get('artifact', '') - if ' ' in artifact: # or ',' in artifact: - del (i['artifact']) - if 'parsed_artifact' in i: - del (i['parsed_artifact']) - # Force substitute tags - i['tags'] = artifact.replace(' ', ',') - # Check if has extra tags as a second artifact # Example: cmr . "_python _tiny" @@ -336,7 +330,9 @@ def _run(self, i): 'dict2': i['local_' + key], 'append_lists': True, 'append_unique': True}) + # print(f"Merged local {key}: {i[key]}") + # print(f"env = {env}") add_deps = i.get('ad', {}) if not add_deps: add_deps = i.get('add_deps', {}) @@ -475,8 +471,9 @@ def _run(self, i): # Get and cache minimal host OS info to be able to run scripts and # manage OS environment if len(self.os_info) == 0: - r = self.cmind.access({'action': 'get_host_os_info', - 'automation': 'utils,dc2743f8450541e3'}) + r = get_host_os_info() + # r = self.access({'action': 'get_host_os_info', + # 'automation': 'utils,dc2743f8450541e3'}) if r['return'] > 0: return r @@ -527,10 +524,15 @@ def _run(self, i): tags_string = i.get('tags', '').strip() - ii = utils.sub_input(i, self.cmind.cfg['artifact_keys']) + # ii = utils.sub_input(i, self.action_object.cfg['artifact_keys']) + ii = {} ii['tags'] = tags_string ii['out'] = None + for key in ["automation", "parsed_automation", + "artifact", "parsed_artifact"]: + if i.get(key): + ii[key] = i[key] # if cm run script without tags/artifact and with --help if len(ii.get('parsed_artifact', [])) == 0 and ii.get( @@ -551,78 +553,53 @@ def _run(self, i): variation_tags = r['variation_tags'] -# # Print what was searched! -# cm_script_info = 'CM script' -# -# x = 'with' -# if parsed_script_alias !='' : -# cm_script_info += ' '+x+' alias "{}"'.format(parsed_script_alias) -# x = 'and' -# -# if len(script_tags)>0: -# cm_script_info += ' '+x+' tags "{}"'.format(script_tags_string.replace(',',' ')) -# x = 'and' -# -# if len(variation_tags)>0: -# x_variation_tags = ['_'+v for v in variation_tags] -# cm_script_info += ' '+x+' variations "{}"'.format(" ".join(x_variation_tags)) -# -# if verbose: -# logging.info('') -# logging.info(recursion_spaces + '* Searching for ' + cm_script_info) -# else: -# logging.info(recursion_spaces + '* Running ' + cm_script_info) - - cm_script_info = i.get('script_call_prefix', '').strip() - if cm_script_info == '': - cm_script_info = 'cm run script' - if not cm_script_info.endswith(' '): - cm_script_info += ' ' - - x = '"' - y = ' ' + mlc_script_info = i.get('script_call_prefix', '').strip() + if mlc_script_info == '': + mlc_script_info = 'mlc run script' + if not mlc_script_info.endswith(' '): + mlc_script_info += ' ' + + x = '--tags=' + y = ',' if parsed_script_alias != '': - cm_script_info += parsed_script_alias - x = ' --tags="' - y = ',' + mlc_script_info += parsed_script_alias + x = '--tags="' if len(script_tags) > 0 or len(variation_tags) > 0: - cm_script_info += x + mlc_script_info += x if len(script_tags) > 0: - cm_script_info += script_tags_string.replace(',', y) + mlc_script_info += script_tags_string if len(variation_tags) > 0: if len(script_tags) > 0: - cm_script_info += ' ' + mlc_script_info += ',' x_variation_tags = ['_' + v for v in variation_tags] - cm_script_info += y.join(x_variation_tags) - - cm_script_info += '"' + mlc_script_info += y.join(x_variation_tags) # if verbose: # logging.info('') if not run_state.get('tmp_silent', False): - logging.info(recursion_spaces + '* ' + cm_script_info) + logging.info(recursion_spaces + '* ' + mlc_script_info) ####################################################################### # Report if scripts were not found or there is an ambiguity with UIDs if not r['found_scripts']: return { - 'return': 1, 'error': 'no scripts were found with above tags (when variations ignored)'} + 'return': 1, 'error': f"""no scripts were found with tags: {tags_string} (when variations ignored)"""} if len(list_of_found_scripts) == 0: return { - 'return': 16, 'error': 'no scripts were found with above tags and variations\n' + r.get('warning', '')} + 'return': 16, 'error': f"""no scripts were found with tags: {tags_string} \n {r.get('warning', '')}"""} # Sometimes there is an ambiguity when someone adds a script # while duplicating a UID. In such case, we will return >1 script # and will start searching in the cache ... # We are detecing such cases here: if len(list_of_found_scripts) > 1 and script_tags_string == '' and parsed_script_alias != '' and '?' not in parsed_script_alias and '*' not in parsed_script_alias: - x = 'Ambiguity in the following scripts have the same UID - please change that in _cm.json or _cm.yaml:\n' + x = 'Ambiguity in the following scripts have the same UID - please change that in meta.json or meta.yaml:\n' for y in list_of_found_scripts: x += ' * ' + y.path + '\n' @@ -706,7 +683,7 @@ def _run(self, i): search_cache = {'action': 'find', 'automation': self.meta['deps']['cache'], 'tags': cache_tags_without_tmp_string} - rc = self.cmind.access(search_cache) + rc = self.action_object.access(search_cache) if rc['return'] > 0: return rc @@ -725,7 +702,7 @@ def _run(self, i): if len(list_of_found_scripts) > 0: # If only tags are used, check if there are no cached scripts with tags - then we will reuse them - # The use case: cm run script --tags=get,compiler + # The use case: mlc run script --tags=get,compiler # CM script will always ask to select gcc,llvm,etc even if any of # them will be already cached if len(cache_list) > 0: @@ -791,27 +768,27 @@ def _run(self, i): # Set some useful local variables script_artifact = list_of_found_scripts[select_script] + # print(list_of_found_scripts) meta = script_artifact.meta + # print(meta) path = script_artifact.path # Check min CM version requirement - min_cm_version = meta.get('min_cm_version', '').strip() - if min_cm_version != '': - # Check compare version while avoiding craches for older version - if 'compare_versions' in dir(utils): - comparison = utils.compare_versions( - current_cm_version, min_cm_version) - if comparison < 0: - return {'return': 1, 'error': 'CM script requires CM version >= {} while current CM version is {} - please update using "pip install cmind -U"'.format( - min_cm_version, current_cm_version)} + min_mlc_version = meta.get('min_mlc_version', '').strip() + if min_mlc_version != '': + comparison = compare_versions( + current_mlc_version, min_mlc_version) + if comparison < 0: + return {'return': 1, 'error': 'This script requires MLC version >= {} while current MLC version is {} - please update using "pip install mlcflow -U"'.format( + min_mlc_version, current_mlc_version)} # Check path to repo - script_repo_path = script_artifact.repo_path + script_repo_path = script_artifact.repo.path - script_repo_path_with_prefix = script_artifact.repo_path - if script_artifact.repo_meta.get('prefix', '') != '': + script_repo_path_with_prefix = script_artifact.repo.path + if script_artifact.repo.meta.get('prefix', '') != '': script_repo_path_with_prefix = os.path.join( - script_repo_path, script_artifact.repo_meta['prefix']) + script_repo_path, script_artifact.repo.meta['prefix']) env['CM_TMP_CURRENT_SCRIPT_REPO_PATH'] = script_repo_path env['CM_TMP_CURRENT_SCRIPT_REPO_PATH_WITH_PREFIX'] = script_repo_path_with_prefix @@ -824,18 +801,18 @@ def _run(self, i): run_state['script_id'] = meta['alias'] + "," + meta['uid'] run_state['script_tags'] = script_tags run_state['script_variation_tags'] = variation_tags - run_state['script_repo_alias'] = script_artifact.repo_meta.get( + run_state['script_repo_alias'] = script_artifact.repo.meta.get( 'alias', '') - run_state['script_repo_git'] = script_artifact.repo_meta.get( + run_state['script_repo_git'] = script_artifact.repo.meta.get( 'git', False) run_state['cache'] = meta.get('cache', False) if not recursion: run_state['script_entry_repo_to_report_errors'] = meta.get( 'repo_to_report_errors', '') - run_state['script_entry_repo_alias'] = script_artifact.repo_meta.get( + run_state['script_entry_repo_alias'] = script_artifact.repo.meta.get( 'alias', '') - run_state['script_entry_repo_git'] = script_artifact.repo_meta.get( + run_state['script_entry_repo_git'] = script_artifact.repo.meta.get( 'git', False) deps = meta.get('deps', []) @@ -851,7 +828,7 @@ def _run(self, i): new_env_keys_from_meta = meta.get('new_env_keys', []) new_state_keys_from_meta = meta.get('new_state_keys', []) - found_script_artifact = utils.assemble_cm_object( + found_script_artifact = utils.assemble_object( meta['alias'], meta['uid']) found_script_tags = meta.get('tags', []) @@ -880,7 +857,10 @@ def _run(self, i): # Force env from meta['env'] as a CONST # (env OVERWRITE) script_artifact_env = meta.get('env', {}) + # print(f"script meta env= {script_artifact_env}") + env.update(script_artifact_env) + # print(f"env = {env}") script_artifact_state = meta.get('state', {}) utils.merge_dicts({'dict1': state, @@ -1326,9 +1306,12 @@ def _run(self, i): return r new_env = r['new_env'] + # print(f"env = {env}, new_env={new_env}") utils.merge_dicts( {'dict1': env, 'dict2': new_env, 'append_lists': True, 'append_unique': True}) + # print(f"merged_env:") + # utils.print_env(env) new_state = cached_state['new_state'] utils.merge_dicts({'dict1': state, 'dict2': new_state, @@ -1417,11 +1400,12 @@ def _run(self, i): ii = {'action': 'update', 'automation': self.meta['deps']['cache'], 'search_tags': tmp_tags, + 'script_alias': meta['alias'], 'tags': ','.join(tmp_tags), 'meta': cached_meta, 'force': True} - r = self.cmind.access(ii) + r = self.action_object.access(ii) if r['return'] > 0: return r @@ -1493,10 +1477,8 @@ def _run(self, i): version = default_version if version_min != '': - ry = self.cmind.access({'action': 'compare_versions', - 'automation': 'utils,dc2743f8450541e3', - 'version1': version, - 'version2': version_min}) + ry = compare_versions({'version1': version, + 'version2': version_min}) if ry['return'] > 0: return ry @@ -1504,10 +1486,8 @@ def _run(self, i): version = version_min if version_max != '': - ry = self.cmind.access({'action': 'compare_versions', - 'automation': 'utils,dc2743f8450541e3', - 'version1': version, - 'version2': version_max}) + ry = compare_versions({'version1': version, + 'version2': version_max}) if ry['return'] > 0: return ry @@ -1664,6 +1644,8 @@ def _run(self, i): return r # Check chain of dependencies on other CM scripts + # print(f"before deps: ") + # utils.print_env(env) if len(deps) > 0: logging.debug(recursion_spaces + ' - Checking dependencies on other CM scripts:') @@ -1681,6 +1663,8 @@ def _run(self, i): if r['return'] > 0: return r + # print(f"after deps:") + # utils.print_env(env) # Clean some output files clean_tmp_files(clean_files, recursion_spaces) @@ -1795,6 +1779,8 @@ def _run(self, i): if 'preprocess' in dir(customize_code) and not fake_run: logging.debug(recursion_spaces + ' - Running preprocess ...') + # print(f"preprocess_env:") + # utils.print_env(env) run_script_input['run_state'] = run_state @@ -1830,7 +1816,7 @@ def _run(self, i): ii = { 'action': 'run', - 'automation': utils.assemble_cm_object(self.meta['alias'], self.meta['uid']), + 'automation': utils.assemble_object(self.meta['alias'], self.meta['uid']), 'recursion_spaces': recursion_spaces + extra_recursion_spaces, 'recursion': True, 'remembered_selections': remembered_selections, @@ -1848,7 +1834,7 @@ def _run(self, i): os.chdir(current_path) ########################################################### - return self.cmind.access(ii) + return self.action_object.access(ii) # If return version if cache: @@ -1958,6 +1944,8 @@ def _run(self, i): new_state_keys = i['force_new_state_keys'] else: new_state_keys = new_state_keys_from_meta + # print("Env:") + # utils.print_env(env) r = detect_state_diff( env, @@ -2057,12 +2045,13 @@ def _run(self, i): ii = {'action': 'update', 'automation': self.meta['deps']['cache'], - 'artifact': cached_uid, + 'uid': cached_uid, 'meta': cached_meta, + 'script_alias': meta['alias'], 'replace_lists': True, # To replace tags 'tags': ','.join(cached_tags)} - r = self.cmind.access(ii) + r = self.action_object.access(ii) if r['return'] > 0: return r @@ -2285,11 +2274,14 @@ def _update_env_from_input(self, env, i): ########################################################################## def _fix_cache_paths(self, env): + ''' cm_repos_path = os.environ.get( 'CM_REPOS', os.path.join( os.path.expanduser("~"), "CM", "repos")) current_cache_path = os.path.realpath( os.path.join(cm_repos_path, "local", "cache")) + ''' + current_cache_path = self.action_object.local_cache_path new_env = env # just a reference @@ -2780,16 +2772,6 @@ def search(self, i): console = i.get('out') == 'con' - # Check simplified CMD: cm run script "get compiler" - # If artifact has spaces, treat them as tags! - artifact = i.get('artifact', '') - if ' ' in artifact: # or ',' in artifact: - del (i['artifact']) - if 'parsed_artifact' in i: - del (i['parsed_artifact']) - # Force substitute tags - i['tags'] = artifact.replace(' ', ',') - ####################################################################### # Process tags to find script(s) and separate variations # (not needed to find scripts) @@ -2836,7 +2818,8 @@ def search(self, i): i['out'] = None i['common'] = True - r = super(CAutomation, self).search(i) + i['target_name'] = "script" + r = super(ScriptAutomation, self).search(i) if r['return'] > 0: return r @@ -2934,13 +2917,9 @@ def test(self, i): import json - # Check parsed automation - if 'parsed_automation' not in i: - return {'return': 1, 'error': 'automation is not specified'} - console = i.get('out') == 'con' - # Find CM artifact(s) + # Find script item(s) i['out'] = None r = self.search(i) @@ -2992,7 +2971,7 @@ def test(self, i): continue ii = {'action': 'run', - 'automation': 'script', + 'target': 'script', 'quiet': i.get('quiet'), } test_all_variations = run_input.get( @@ -3059,7 +3038,7 @@ def test(self, i): import copy ii['env'] = copy.deepcopy(i_env) logging.info(ii) - r = self.cmind.access(ii) + r = self.action_object.access(ii) if r['return'] > 0: return r @@ -3185,7 +3164,15 @@ def add(self, i): console = i.get('out') == 'con' # Try to find script artifact by alias and/or tags - ii = utils.sub_input(i, self.cmind.cfg['artifact_keys']) + # ii = utils.sub_input(i, self.cmind.cfg['artifact_keys']) + ii = {} + ii['tags'] = tags_string + ii['out'] = None + + for key in ["automation", "parsed_automation", + "artifact", "parsed_artifact"]: + if i.get(key): + ii[key] = i[key] parsed_artifact = i.get('parsed_artifact', []) @@ -3203,7 +3190,10 @@ def add(self, i): 'error': 'file {} not found'.format(script_name)} # Move tags from input to meta of the newly created script artifact - tags_list = utils.convert_tags_to_list(i) + res = utils.convert_tags_to_list(i['tags']) + if res['return'] > 0: + return res + tags_list = res['tags'] if 'tags' in i: del (i['tags']) @@ -3262,7 +3252,9 @@ def add(self, i): # 'input_description':{} } - fmeta = os.path.join(template_path, self.cmind.cfg['file_cmeta']) + fmeta = os.path.join( + template_path, + self.action_object.cfg['file_cmeta']) r = utils.load_yaml_and_json(fmeta) if r['return'] == 0: @@ -3308,10 +3300,10 @@ def add(self, i): del ii[k] if artifact_repo is not None: - ii['artifact'] = utils.assemble_cm_object2( - artifact_repo) + ':' + utils.assemble_cm_object2(artifact_obj) + ii['artifact'] = utils.assemble_object2( + artifact_repo) + ':' + utils.assemble_object2(artifact_obj) - r_obj = self.cmind.access(ii) + r_obj = self.action_object.access(ii) if r_obj['return'] > 0: return r_obj @@ -3695,9 +3687,10 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a # Not very efficient but allows logging - can be optimized # later + # print(f"env about to call deps {d}= {env}") ii = { 'action': 'run', - 'automation': utils.assemble_cm_object(self.meta['alias'], self.meta['uid']), + 'automation': utils.assemble_object(self.meta['alias'], self.meta['uid']), 'recursion_spaces': recursion_spaces, # + extra_recursion_spaces, 'recursion': True, 'remembered_selections': remembered_selections, @@ -3719,10 +3712,11 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a if d.get(key): d[key] = {} + # print(f"ii = {ii}, d = {d}") utils.merge_dicts( {'dict1': ii, 'dict2': d, 'append_lists': True, 'append_unique': True}) - r = self.cmind.access(ii) + r = self.action_object.access(ii) if r['return'] > 0: return r @@ -3753,12 +3747,18 @@ def _merge_dicts_with_tags(self, dict1, dict2): return {'return': 0} for dep in dict1: if 'tags' in dict1[dep]: - dict1[dep]['tags_list'] = utils.convert_tags_to_list( - dict1[dep]) + res = utils.convert_tags_to_list( + dict1[dep]['tags']) + if res['return'] > 0: + return res + dict1[dep]['tags_list'] = res['tags'] for dep in dict2: if 'tags' in dict2[dep]: - dict2[dep]['tags_list'] = utils.convert_tags_to_list( - dict2[dep]) + res = utils.convert_tags_to_list( + dict2[dep]['tags']) + if res['return'] > 0: + return res + dict2[dep]['tags_list'] = res['tags'] utils.merge_dicts({'dict1': dict1, 'dict2': dict2, 'append_lists': True, 'append_unique': True}) for dep in dict1: @@ -3789,10 +3789,10 @@ def _get_readme(self, cmd_parts, run_state): content += """ *This README was automatically generated.* -## Install CM +## Install MLC ```bash -pip install cm4mlops +pip install mlcflow ``` Check [this readme](https://github.com/mlcommons/ck/blob/master/docs/installation.md) @@ -3801,20 +3801,20 @@ def _get_readme(self, cmd_parts, run_state): """ - current_cm_repo = run_state['script_repo_alias'] - if current_cm_repo not in [ - 'mlcommons@mlperf-automations', 'mlcommons@cm4mlops']: - content += '\ncm pull repo ' + \ + current_mlc_repo = run_state['script_repo_alias'] + if current_mlc_repo not in [ + 'mlcommons@mlperf-automations']: + content += '\nmlc pull repo ' + \ run_state['script_repo_alias'] + '\n' content += """``` -## Run CM script +## Run Automation script ```bash """ - cmd = "cm run script " + cmd = "mlc run script " for cmd_part in cmd_parts: x = '"' if ' ' in cmd_part and not cmd_part.startswith('-') else '' @@ -3824,7 +3824,7 @@ def _get_readme(self, cmd_parts, run_state): content += """``` -## Run individual CM scripts to customize dependencies (optional) +## Run individual Automation scripts to customize dependencies (optional) """ deps_ = '' @@ -3837,7 +3837,7 @@ def _get_readme(self, cmd_parts, run_state): xversion = ' --version={}\n'.format(version) content += "```bash\n" - content += "cm run script --tags=" + \ + content += "mlc run script --tags=" + \ dep_tags + "{}\n".format(xversion) content += "```\n\n" @@ -3900,7 +3900,7 @@ def _get_deps_run_cmds(self, deps): run_cmds = [] for dep_tags in deps: - run_cmds.append("cm run script --tags=" + dep_tags) + run_cmds.append("mlc run script --tags=" + dep_tags) return run_cmds @@ -4145,7 +4145,7 @@ def find_file_in_paths(self, i): 'version': version, 'version_min': version_min, 'version_max': version_max, - 'cmind': self.cmind}) + 'action_object': self.action_object}) if ry['return'] > 0: return ry @@ -4268,7 +4268,7 @@ def detect_version_using_script(self, i): 'version': version, 'version_min': version_min, 'version_max': version_max, - 'cmind': self.cmind}) + 'action_object': self.action_object}) if ry['return'] > 0: return ry @@ -4699,105 +4699,13 @@ def doc(self, i): ############################################################ def dockerfile(self, i): - """ - Generate Dockerfile for CM script. - - Args: - (CM input dict): - - (out) (str): if 'con', output to console - - parsed_artifact (list): prepared in CM CLI or CM access function - [ (artifact alias, artifact UID) ] or - [ (artifact alias, artifact UID), (artifact repo alias, artifact repo UID) ] - - (repos) (str): list of repositories to search for automations - - (output_dir) (str): output directory (./ by default) - - Returns: - (CM return dict): - - * return (int): return code == 0 if no error and >0 if error - * (error) (str): error string if return>0 - - """ - - return utils.call_internal_module( - self, __file__, 'module_misc', 'dockerfile', i) + from script.docker import dockerfile + return dockerfile(self, i) ############################################################ def docker(self, i): - """ - Run CM script in an automatically-generated container. - - Args: - (CM input dict): - - (out) (str): if 'con', output to console - - (repos) (str): list of repositories to search for automations - - (output_dir) (str): output directory (./ by default) - - (docker) (dict): convert keys into docker_{key} strings for CM >= 2.3.8.1 - - - (docker_skip_build) (bool): do not generate Dockerfiles and do not recreate Docker image (must exist) - (docker_noregenerate) (bool): do not generate Dockerfiles - (docker_norecreate) (bool): do not recreate Docker image - - (docker_cfg) (str): if True, show all available basic docker configurations, otherwise pre-select one - (docker_cfg_uid) (str): if True, select docker configuration with this UID - - (docker_path) (str): where to create or find Dockerfile - (docker_gh_token) (str): GitHub token for private repositories - (docker_save_script) (str): if !='' name of script to save docker command - (docker_interactive) (bool): if True, run in interactive mode - (docker_it) (bool): the same as `docker_interactive` - (docker_detached) (bool): detach Docker - (docker_dt) (bool) the same as `docker_detached` - - (docker_base_image) (str): force base image - (docker_os) (str): force docker OS (default: ubuntu) - (docker_os_version) (str): force docker OS version (default: 22.04) - (docker_image_tag_extra) (str): add extra tag (default:-latest) - - (docker_cm_repo) (str): force CM automation repository when building Docker (default: mlperf-automations) - (docker_cm_repos) - (docker_cm_repo_flags) - - (dockerfile_env) - - (docker_skip_cm_sys_upgrade) (bool): if True, do not install CM sys deps - - (docker_extra_sys_deps) - - (fake_run_deps) - (docker_run_final_cmds) - - (all_gpus) - (num_gpus) - - (docker_device) - - (docker_port_maps) - - (docker_shm_size) - - (docker_extra_run_args) - - - Returns: - (CM return dict): - - * return (int): return code == 0 if no error and >0 if error - * (error) (str): error string if return>0 - - """ - - return utils.call_internal_module( - self, __file__, 'module_misc', 'docker', i) + from script.docker import docker_run + return docker_run(self, i) ########################################################################## @@ -5003,9 +4911,9 @@ def find_cached_script(i): recursion_spaces + ' - Searching for cached script outputs with the following tags: {}'.format(search_tags)) - r = self_obj.cmind.access({'action': 'find', - 'automation': self_obj.meta['deps']['cache'], - 'tags': search_tags}) + r = self_obj.action_object.access({'action': 'find', + 'automation': self_obj.meta['deps']['cache'], + 'tags': search_tags}) if r['return'] > 0: return r @@ -5021,7 +4929,7 @@ def find_cached_script(i): 'version', '') skip_cached_script = check_versions( - self_obj.cmind, tmp_version_in_cached_script, version_min, version_max) + self_obj.action_object, tmp_version_in_cached_script, version_min, version_max) if skip_cached_script: return {'return': 2, 'error': 'The version of the previously remembered selection for a given script ({}) mismatches the newly requested one'.format( @@ -5048,8 +4956,8 @@ def find_cached_script(i): # TODO Need to restrict the below check to within container # env i['tmp_dep_cached_path'] = dependent_cached_path - r = utils.call_internal_module( - self_obj, __file__, 'module_misc', 'get_container_path_script', i) + import script.docker_utils + r = docker_utils.utils.get_container_path_script(i) if not os.path.exists(r['value_env']): # Need to rm this cache entry skip_cached_script = True @@ -5119,7 +5027,7 @@ def find_cached_script(i): continue skip_cached_script = check_versions( - self_obj.cmind, cached_script_version, version_min, version_max) + self_obj.action_object, cached_script_version, version_min, version_max) if not skip_cached_script: new_found_cached_scripts.append(cached_script) @@ -5287,7 +5195,7 @@ def check_version_constraints(i): version_min = i.get('version_min', '') version_max = i.get('version_max', '') - cmind = i['cmind'] + action_object = i['action_object'] skip = False @@ -5295,10 +5203,9 @@ def check_version_constraints(i): skip = True if not skip and detected_version != '' and version_min != '': - ry = cmind.access({'action': 'compare_versions', - 'automation': 'utils,dc2743f8450541e3', - 'version1': detected_version, - 'version2': version_min}) + ry = compare_versions({ + 'version1': detected_version, + 'version2': version_min}) if ry['return'] > 0: return ry @@ -5306,10 +5213,9 @@ def check_version_constraints(i): skip = True if not skip and detected_version != '' and version_max != '': - ry = cmind.access({'action': 'compare_versions', - 'automation': 'utils,dc2743f8450541e3', - 'version1': detected_version, - 'version2': version_max}) + ry = compare_versions({ + 'version1': detected_version, + 'version2': version_max}) if ry['return'] > 0: return ry @@ -6326,7 +6232,8 @@ def select_script_artifact(lst, text, recursion_spaces, ############################################################################## -def check_versions(cmind, cached_script_version, version_min, version_max): +def check_versions(action_object, cached_script_version, + version_min, version_max): """ Internal: check versions of the cached script """ @@ -6334,10 +6241,9 @@ def check_versions(cmind, cached_script_version, version_min, version_max): if cached_script_version != '': if version_min != '': - ry = cmind.access({'action': 'compare_versions', - 'automation': 'utils,dc2743f8450541e3', - 'version1': cached_script_version, - 'version2': version_min}) + ry = compare_versions({ + 'version1': cached_script_version, + 'version2': version_min}) if ry['return'] > 0: return ry @@ -6345,10 +6251,9 @@ def check_versions(cmind, cached_script_version, version_min, version_max): skip_cached_script = True if not skip_cached_script and version_max != '': - ry = cmind.access({'action': 'compare_versions', - 'automation': 'utils,dc2743f8450541e3', - 'version1': cached_script_version, - 'version2': version_max}) + ry = compare_versions({ + 'version1': cached_script_version, + 'version2': version_max}) if ry['return'] > 0: return ry @@ -6543,10 +6448,10 @@ def dump_repro(repro_prefix, rr, run_state): ############################################################################## -# Demo to show how to use CM components independently if needed +# Demo to show how to use ScriptAutomation independently if needed if __name__ == "__main__": - import cmind - auto = CAutomation(cmind, __file__) + import mlc + auto = ScriptAutomation(Action, __file__) r = auto.test({'x': 'y'}) diff --git a/automation/utils.py b/automation/utils.py new file mode 100644 index 000000000..95aa0b2e9 --- /dev/null +++ b/automation/utils.py @@ -0,0 +1,1094 @@ +from mlc.utils import * + + +def get_host_os_info(i={}): + """ + Get some host platform name (currently windows or linux) and OS bits + + Args: + (CM input dict): + + (bits) (str): force host platform bits + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + * info (dict): + * platform (str): "windows", "linux" or "darwin" + * bat_ext (str): ".bat" or ".sh" + * bits (str): 32 or 64 bits + * python_bits 9str): python bits + + """ + + import os + import platform + import struct + + info = {} + + pbits = str(8 * struct.calcsize("P")) + + if platform.system().lower().startswith('win'): + platform = 'windows' + info['bat_ext'] = '.bat' + info['set_env'] = 'set ${key}=${value}' + info['env_separator'] = ';' + info['env_var'] = '%env_var%' + info['bat_rem'] = 'rem ${rem}' + info['run_local_bat'] = 'call ${bat_file}' + info['run_local_bat_from_python'] = 'call ${bat_file}' + info['run_bat'] = 'call ${bat_file}' + info['start_script'] = ['@echo off', ''] + info['env'] = { + "CM_WINDOWS": "yes" + } + else: + if platform.system().lower().startswith('darwin'): + platform = 'darwin' + else: + platform = 'linux' + + info['bat_ext'] = '.sh' + info['set_env'] = 'export ${key}="${value}"' + info['env_separator'] = ':' + info['env_var'] = '${env_var}' + info['set_exec_file'] = 'chmod 755 "${file_name}"' + info['bat_rem'] = '# ${rem}' + info['run_local_bat'] = '. ./${bat_file}' + info['run_local_bat_from_python'] = 'bash -c ". ./${bat_file}"' + info['run_bat'] = '. ${bat_file}' + info['start_script'] = ['#!/bin/bash', ''] + info['env'] = {} + + info['platform'] = platform + + obits = i.get('bits', '') + if obits == '': + obits = '32' + if platform == 'windows': + # Trying to get fast way to detect bits + if os.environ.get('ProgramW6432', '') != '' or os.environ.get( + 'ProgramFiles(x86)', '') != '': # pragma: no cover + obits = '64' + else: + # On Linux use first getconf LONG_BIT and if doesn't work use + # python bits + + obits = pbits + + r = generate_temp_file({}) + if r['return'] > 0: + return r + + fn = r['file_name'] + + cmd = 'getconf LONG_BIT > ' + fn + rx = os.system(cmd) + + if rx == 0: + r = load_txt(file_name=fn, remove_after_read=True) + + if r['return'] == 0: + s = r['string'].strip() + if len(s) > 0 and len(s) < 4: + obits = s + else: + if os.path.isfile(fn): + os.remove(fn) + + info['bits'] = obits + info['python_bits'] = pbits + + return {'return': 0, 'info': info} + +########################################################################## + + +def download_file(i): + """ + Download file using requests + + Args: + (CM input dict): + + url (str): URL with file + (filename) (str): explicit file name + (path) (str): path to record file (or current if empty) + (chunk_size) (int): chunck size in bytes (65536 by default) + (text) (str): print text before downloaded status ("Downloaded: " by default) + (verify) (bool): verify SSL certificate if True (True by default) + can be switched by global env CM_UTILS_DOWNLOAD_VERIFY_SSL = no + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + * filename (str): file name + * path (str): path to file + * size (int): file size + + """ + + import requests + import time + import sys + from urllib import parse + + # Get URL + url = i['url'] + + # Check file name + file_name = i.get('filename', '') + if file_name == '': + parsed_url = parse.urlparse(url) + file_name = os.path.basename(parsed_url.path) + + # Check path + path = i.get('path', '') + if path is None or path == '': + path = os.getcwd() + + # Output file + path_to_file = os.path.join(path, file_name) + + if os.path.isfile(path_to_file): + os.remove(path_to_file) + + print('Downloading to {}'.format(path_to_file)) + print('') + + # Download + size = -1 + downloaded = 0 + chunk_size = i.get('chunk_size', 65536) + + text = i.get('text', 'Downloaded: ') + + if 'CM_UTILS_DOWNLOAD_VERIFY_SSL' in os.environ: + verify = os.environ['CM_UTILS_DOWNLOAD_VERIFY_SSL'] == 'yes' + else: + verify = i.get('verify', True) + + try: + with requests.get(url, stream=True, allow_redirects=True, verify=verify) as download: + download.raise_for_status() + + size_string = download.headers.get('Content-Length') + + if size_string is None: + transfer_encoding = download.headers.get( + 'Transfer-Encoding', '') + if transfer_encoding != 'chunked': + return {'return': 1, 'error': 'did not receive file'} + else: + size_string = "0" + + size = int(size_string) + + with open(path_to_file, 'wb') as output: + for chunk in download.iter_content(chunk_size=chunk_size): + + if chunk: + output.write(chunk) + if size == 0: + continue + downloaded += 1 + percent = downloaded * chunk_size * 100 / size + + sys.stdout.write("\r{}{:3.0f}%".format(text, percent)) + sys.stdout.flush() + + sys.stdout.write("\r{}{:3.0f}%".format(text, 100)) + sys.stdout.flush() + + except Exception as e: + return {'return': 1, 'error': format(e)} + + print('') + if size == 0: + file_stats = os.stat(path_to_file) + size = file_stats.st_size + + return {'return': 0, 'filename': file_name, + 'path': path_to_file, 'size': size} + +########################################################################## + + +def unzip_file(i): + """ + Unzip file + + Args: + (CM input dict): + + filename (str): explicit file name + (path) (str): path where to unzip file (current path otherwise) + (strip_folders) (int): strip first folders + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + """ + + import zipfile + + # Check file name + file_name = i['filename'] + + if not os.path.isfile(file_name): + return {'return': 1, + 'error': 'file {} not found'.format(file_name)} + + console = i.get('out') == 'con' + + # Attempt to read cmr.json + file_name_handle = open(file_name, 'rb') + file_name_zip = zipfile.ZipFile(file_name_handle) + + info_files = file_name_zip.infolist() + + path = i.get('path', '') + if path is None or path == '': + path = os.getcwd() + + strip_folders = i.get('strip_folders', 0) + + # Unpacking zip + for info in info_files: + f = info.filename + permissions = info.external_attr + + if not f.startswith('..') and not f.startswith( + '/') and not f.startswith('\\'): + f_zip = f + + if strip_folders > 0: + fsplit = f.split('/') # Zip standard on all OS + f = '/'.join(fsplit[strip_folders:]) + + file_path = os.path.join(path, f) + + if f.endswith('/'): + # create directory + if not os.path.exists(file_path): + os.makedirs(file_path) + else: + dir_name = os.path.dirname(file_path) + if not os.path.exists(dir_name): + os.makedirs(dir_name) + + # extract file + file_out = open(file_path, 'wb') + file_out.write(file_name_zip.read(f_zip)) + file_out.close() + + if permissions > 0xffff: + os.chmod(file_path, permissions >> 16) + + file_name_zip.close() + file_name_handle.close() + + return {'return': 0} + +########################################################################## + + +def compare_versions(i): + """ + Compare versions + + Args: + + version1 (str): version 1 + version2 (str): version 2 + + Returns: + (CM return dict): + + * comparison (int): 1 - version 1 > version 2 + 0 - version 1 == version 2 + -1 - version 1 < version 2 + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + version1 = i['version1'] + version2 = i['version2'] + + l_version1 = version1.split('.') + l_version2 = version2.split('.') + + # 3.9.6 vs 3.9 + # 3.9 vs 3.9.6 + + i_version1 = [int(v) if v.isdigit() else v for v in l_version1] + i_version2 = [int(v) if v.isdigit() else v for v in l_version2] + + comparison = 0 + + for index in range(max(len(i_version1), len(i_version2))): + v1 = i_version1[index] if index < len(i_version1) else 0 + v2 = i_version2[index] if index < len(i_version2) else 0 + + if v1 > v2: + comparison = 1 + break + elif v1 < v2: + comparison = -1 + break + + return {'return': 0, 'comparison': comparison} + +########################################################################## + + +def json2yaml(i): + """ + Convert JSON file to YAML + + Args: + + input (str): input file (.json) + (output) (str): output file (.yaml) + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + input_file = i.get('input', '') + + if input_file == '': + return {'return': 1, 'error': 'please specify --input={json file}'} + + output_file = i.get('output', '') + + r = load_json(input_file, check_if_exists=True) + if r['return'] > 0: + return r + + meta = r['meta'] + + if output_file == '': + output_file = input_file[:- + 5] if input_file.endswith('.json') else input_file + output_file += '.yaml' + + r = save_yaml(output_file, meta) + if r['return'] > 0: + return r + + return {'return': 0} + +########################################################################## + + +def yaml2json(i): + """ + Convert YAML file to JSON + + Args: + + input (str): input file (.yaml) + (output) (str): output file (.json) + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + input_file = i.get('input', '') + + if input_file == '': + return {'return': 1, 'error': 'please specify --input={yaml file}'} + + output_file = i.get('output', '') + + r = load_yaml(input_file, check_if_exists=True) + if r['return'] > 0: + return r + + meta = r['meta'] + + if output_file == '': + output_file = input_file[:- + 5] if input_file.endswith('.yaml') else input_file + output_file += '.json' + + r = save_json(output_file, meta) + if r['return'] > 0: + return r + + return {'return': 0} + +########################################################################## + + +def sort_json(i): + """ + Sort JSON file + + Args: + + input (str): input file (.json) + (output) (str): output file + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + input_file = i.get('input', '') + + if input_file == '': + return {'return': 1, 'error': 'please specify --input={json file}'} + + r = load_json(input_file, check_if_exists=True) + if r['return'] > 0: + return r + + meta = r['meta'] + + output_file = i.get('output', '') + + if output_file == '': + output_file = input_file + + r = save_json(output_file, meta, sort_keys=True) + if r['return'] > 0: + return r + + return {'return': 0} + +########################################################################## + + +def dos2unix(i): + """ + Convert DOS file to UNIX (remove \r) + + Args: + + input (str): input file (.txt) + (output) (str): output file + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + input_file = i.get('input', '') + + if input_file == '': + return {'return': 1, 'error': 'please specify --input={txt file}'} + + r = load_txt(input_file, check_if_exists=True) + if r['return'] > 0: + return r + + s = r['string'].replace('\r', '') + + output_file = i.get('output', '') + + if output_file == '': + output_file = input_file + + r = save_txt(output_file, s) + if r['return'] > 0: + return r + + return {'return': 0} + +########################################################################## + + +def replace_string_in_file(i): + """ + Convert DOS file to UNIX (remove \r) + + Args: + + input (str): input file (.txt) + (output) (str): output file + string (str): string to replace + replacement (str): replacement string + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + (update) (bool): True if file was upated + """ + + input_file = i.get('input', '') + if input_file == '': + return {'return': 1, 'error': 'please specify --input={txt file}'} + + string = i.get('string', '') + if string == '': + return {'return': 1, + 'error': 'please specify --string={string to replace}'} + + replacement = i.get('replacement', '') + if replacement == '': + return {'return': 1, + 'error': 'please specify --replacement={string to replace}'} + + output_file = i.get('output', '') + + if output_file == '': + output_file = input_file + + r = load_txt(input_file, check_if_exists=True) + if r['return'] > 0: + return r + + s = r['string'].replace('\r', '') + + s = s.replace(string, replacement) + + r = save_txt(output_file, s) + if r['return'] > 0: + return r + + return {'return': 0} + +########################################################################## + + +def create_toc_from_md(i): + """ + Convert DOS file to UNIX (remove \r) + + Args: + + input (str): input file (.md) + (output) (str): output file (input+'.toc) + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + input_file = i.get('input', '') + if input_file == '': + return {'return': 1, 'error': 'please specify --input={txt file}'} + + output_file = i.get('output', '') + + if output_file == '': + output_file = input_file + '.toc' + + r = load_txt(input_file, check_if_exists=True) + if r['return'] > 0: + return r + + lines = r['string'].split('\n') + + toc = [] + + toc.append('
') + toc.append('Click here to see the table of contents.') + toc.append('') + + for line in lines: + line = line.strip() + + if line.startswith('#'): + j = line.find(' ') + if j >= 0: + title = line[j:].strip() + + x = title.lower().replace(' ', '-') + + for k in range(0, 2): + if x.startswith('*'): + x = x[1:] + if x.endswith('*'): + x = x[:-1] + + for z in [':', '+', '.', '(', ')', ',']: + x = x.replace(z, '') + + y = ' ' * (2 * (j - 1)) + '* [' + title + '](#' + x + ')' + + toc.append(y) + + toc.append('') + toc.append('
') + + r = save_txt(output_file, '\n'.join(toc) + '\n') + if r['return'] > 0: + return r + + return {'return': 0} + +########################################################################## + + +def copy_to_clipboard(i): + """ + Copy string to a clipboard + + Args: + + string (str): string to copy to a clipboard + (add_quotes) (bool): add quotes to the string in a clipboard + (skip_fail) (bool): if True, do not fail + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + s = i.get('string', '') + + if i.get('add_quotes', False): + s = '"' + s + '"' + + failed = False + warning = '' + + # Try to load pyperclip (seems to work fine on Windows) + try: + import pyperclip + except Exception as e: + warning = format(e) + failed = True + pass + + if not failed: + pyperclip.copy(s) + else: + failed = False + + # Try to load Tkinter + try: + from Tkinter import Tk + except ImportError as e: + warning = format(e) + failed = True + pass + + if failed: + failed = False + try: + from tkinter import Tk + except ImportError as e: + warning = format(e) + failed = True + pass + + if not failed: + # Copy to clipboard + try: + r = Tk() + r.withdraw() + r.clipboard_clear() + r.clipboard_append(s) + r.update() + r.destroy() + except Exception as e: + failed = True + warning = format(e) + + rr = {'return': 0} + + if failed: + if not i.get('skip_fail', False): + return {'return': 1, 'error': warning} + + rr['warning'] = warning + + return rr + +########################################################################## + + +def list_files_recursively(i): + """ + List files and concatenate into string separate by comma + + Args: + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + files = os.walk('.') + + s = '' + + for (dir_path, dir_names, file_names) in files: + for f in file_names: + if s != '': + s += ',' + + if dir_path == '.': + dir_path2 = '' + else: + dir_path2 = dir_path[2:].replace('\\', '/') + '/' + + s += dir_path2 + f + + print(s) + + return {'return': 0} + +########################################################################## + + +def generate_secret(i): + """ + Generate secret for web apps + + Args: + + Returns: + (CM return dict): + + secret (str): secret + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + import secrets + s = secrets.token_urlsafe(16) + + print(s) + + return {'return': 0, 'secret': s} + +########################################################################## + + +def detect_tags_in_artifact(i): + """ + Detect if there are tags in an artifact name (spaces) and update input + + Args: + + input (dict) : original input + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + inp = i['input'] + + artifact = inp.get('artifact', '') + if artifact == '.': + del (inp['artifact']) + elif ' ' in artifact: # or ',' in artifact: + del (inp['artifact']) + if 'parsed_artifact' in inp: + del (inp['parsed_artifact']) + # Force substitute tags + inp['tags'] = artifact.replace(' ', ',') + + return {'return': 0} + +########################################################################## + + +def prune_input(i): + """ + Leave only input keys and remove the rest (to regenerate CM commands) + + Args: + + input (dict) : original input + (extra_keys_starts_with) (list): remove keys that starts + with the ones from this list + + Returns: + (CM return dict): + + new_input (dict): pruned input + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + """ + + import copy + + inp = i['input'] + extra_keys = i.get('extra_keys_starts_with', []) + + i_run_cmd_arc = copy.deepcopy(inp) + for k in inp: + remove = False + if k in ['action', 'automation', 'cmd', 'out', + 'parsed_automation', 'parsed_artifact', 'self_module']: + remove = True + if not remove: + for ek in extra_keys: + if k.startswith(ek): + remove = True + break + + if remove: + del (i_run_cmd_arc[k]) + + return {'return': 0, 'new_input': i_run_cmd_arc} + +########################################################################## + + +def uid(i): + """ + Generate CM UID. + + Args: + (CM input dict): empty dict + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + * uid (str): CM UID + """ + + console = i.get('out') == 'con' + + r = gen_uid() + + if console: + print(r['uid']) + + return r + +########################################################################## + + +def system(i): + """ + Run system command and redirect output to string. + + Args: + (CM input dict): + + * cmd (str): command line + * (path) (str): go to this directory and return back to current + * (stdout) (str): stdout file + * (stderr) (str): stderr file + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + * ret (int): return code + * std (str): stdout + stderr + * stdout (str): stdout + * stderr (str): stderr + """ + + cmd = i['cmd'] + + if cmd == '': + return {'return': 1, 'error': 'cmd is empty'} + + path = i.get('path', '') + if path != '' and os.path.isdir(path): + cur_dir = os.getcwd() + os.chdir(path) + + if i.get('stdout', '') != '': + fn1 = i['stdout'] + fn1_delete = False + else: + r = gen_tmp_file({}) + if r['return'] > 0: + return r + fn1 = r['file_name'] + fn1_delete = True + + if i.get('stderr', '') != '': + fn2 = i['stderr'] + fn2_delete = False + else: + r = gen_tmp_file({}) + if r['return'] > 0: + return r + fn2 = r['file_name'] + fn2_delete = True + + cmd += ' > ' + fn1 + ' 2> ' + fn2 + rx = os.system(cmd) + + std = '' + stdout = '' + stderr = '' + + if os.path.isfile(fn1): + r = load_txt(file_name=fn1, remove_after_read=fn1_delete) + if r['return'] == 0: + stdout = r['string'].strip() + + if os.path.isfile(fn2): + r = load_txt(file_name=fn2, remove_after_read=fn2_delete) + if r['return'] == 0: + stderr = r['string'].strip() + + std = stdout + if stderr != '': + if std != '': + std += '\n' + std += stderr + + if path != '' and os.path.isdir(path): + os.chdir(cur_dir) + + return {'return': 0, 'ret': rx, 'stdout': stdout, + 'stderr': stderr, 'std': std} + +############################################################ + + +def load_cfg(i): + """ + Load configuration artifacts and files + + Args: + (CM input dict): + + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + """ + + return call_internal_module( + self, __file__, 'module_cfg', 'load_cfg', i) + +############################################################ + + +def select_cfg(i): + """ + Select cfg interactively + + Args: + (CM input dict): + tags (str): list of tags to find cfg + alias (str): alias of a cfg file + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + """ + + i['self_module'] = self + + return call_internal_module( + self, __file__, 'module_cfg', 'select_cfg', i) + +############################################################ + + +def print_yaml(i): + """ + Print YAML file + + Args: + (CM input dict): + file (str): input file + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + """ + + filename = i.get('file', '') + if filename == '': + return {'return': 1, 'error': 'please specify --file={YAML file}'} + + r = load_yaml(filename, check_if_exists=True) + if r['return'] > 0: + return r + + meta = r['meta'] + + import json + print(json.dumps(meta, indent=2)) + + return {'return': 0} + +############################################################ + + +def print_json(i): + """ + Print YAML file + + Args: + (CM input dict): + file (str): input file + + Returns: + (CM return dict): + + * return (int): return code == 0 if no error and >0 if error + * (error) (str): error string if return>0 + + """ + + filename = i.get('file', '') + if filename == '': + return {'return': 1, 'error': 'please specify --file={JSON file}'} + + r = load_json(filename, check_if_exists=True) + if r['return'] > 0: + return r + + meta = r['meta'] + + import json + print(json.dumps(meta, indent=2)) + + return {'return': 0} diff --git a/cmr.yaml b/cmr.yaml deleted file mode 100644 index 226fd06b6..000000000 --- a/cmr.yaml +++ /dev/null @@ -1,12 +0,0 @@ -alias: mlcommons@cm4mlops -uid: 9e97bb72b0474657 - -git: true - -version: 2.3.9 - -deps: - - alias: mlcommons@ck - uid: a4705959af8e447a - conflict: True - diff --git a/flow.md b/flow.md new file mode 100644 index 000000000..052d8dc13 --- /dev/null +++ b/flow.md @@ -0,0 +1,9 @@ +# MLC script automation workflow + +```mermaid +flowchart TD + A[MLC interface] --> B{Script Automation} + A[MLC interface] --> C{Cache Automation} + B[Script Automation] --> C{Cache Automation} + B[Script Automation] --> D{MLPerf Scripts} +``` diff --git a/meta.yaml b/meta.yaml new file mode 100644 index 000000000..d9d752ffc --- /dev/null +++ b/meta.yaml @@ -0,0 +1,6 @@ +alias: mlcommons@mlperf-automations +uid: 9cf241afa6074c89 + +git: true + +version: 0.0.1 diff --git a/pyproject.toml b/pyproject.toml index decce5cf7..133c8d361 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,40 @@ [build-system] -requires = ["setuptools>=60", "wheel", "cmind @ git+https://git@github.com/gateoverflow/cm.git@mlperf-inference#egg=cmind&subdirectory=cm"] +requires = ["setuptools>=61.0", "wheel", "toml", "mlcflow"] +build-backend = "setuptools.build_meta" + +[project] +name = "mlperf" +version = "0.0.1" +description = "Automation scripts for running ML applications using MLC interface" +authors = [ + { name = "MLCommons", email = "systems@mlcommons.org" } +] +license = { file = "LICENSE.md" } +readme = "README.md" +requires-python = ">=3.7" +keywords = ["mlc", "mlcflow", "pypi", "package", "automation", "mlperf", "mlcr"] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", +] + +dependencies = [ + "requests", + "pyyaml", + "mlcflow", + "giturlparse" +] + +[project.urls] +Homepage = "https://github.com/mlcommons/mlperf-automations" +Documentation = "https://docs.mlcommons.org/mlperf-automations" +Repository = "https://github.com/mlcommons/mlperf-automations" +Issues = "https://github.com/mlcommons/mlperf-automations/issues" + +[tool.setuptools] +packages = [] +include-package-data = true + +[tool.setuptools.package-data] +"mlcr" = ["README.md", "VERSION", "git_commit_hash.txt"] diff --git a/script/activate-python-venv/customize.py b/script/activate-python-venv/customize.py index 5858212f9..1d0e96c3c 100644 --- a/script/activate-python-venv/customize.py +++ b/script/activate-python-venv/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/activate-python-venv/_cm.yaml b/script/activate-python-venv/meta.yaml similarity index 100% rename from script/activate-python-venv/_cm.yaml rename to script/activate-python-venv/meta.yaml diff --git a/script/add-custom-nvidia-system/customize.py b/script/add-custom-nvidia-system/customize.py index dbab0597e..714ce821d 100644 --- a/script/add-custom-nvidia-system/customize.py +++ b/script/add-custom-nvidia-system/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/add-custom-nvidia-system/_cm.yaml b/script/add-custom-nvidia-system/meta.yaml similarity index 100% rename from script/add-custom-nvidia-system/_cm.yaml rename to script/add-custom-nvidia-system/meta.yaml diff --git a/script/app-image-classification-onnx-py/customize.py b/script/app-image-classification-onnx-py/customize.py index 21b57daca..e3371f217 100644 --- a/script/app-image-classification-onnx-py/customize.py +++ b/script/app-image-classification-onnx-py/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-image-classification-onnx-py/_cm.yaml b/script/app-image-classification-onnx-py/meta.yaml similarity index 100% rename from script/app-image-classification-onnx-py/_cm.yaml rename to script/app-image-classification-onnx-py/meta.yaml diff --git a/script/app-image-classification-tf-onnx-cpp/_cm.yaml b/script/app-image-classification-tf-onnx-cpp/meta.yaml similarity index 100% rename from script/app-image-classification-tf-onnx-cpp/_cm.yaml rename to script/app-image-classification-tf-onnx-cpp/meta.yaml diff --git a/script/app-image-classification-torch-py/_cm.yaml b/script/app-image-classification-torch-py/meta.yaml similarity index 100% rename from script/app-image-classification-torch-py/_cm.yaml rename to script/app-image-classification-torch-py/meta.yaml diff --git a/script/app-image-classification-tvm-onnx-py/_cm.yaml b/script/app-image-classification-tvm-onnx-py/meta.yaml similarity index 100% rename from script/app-image-classification-tvm-onnx-py/_cm.yaml rename to script/app-image-classification-tvm-onnx-py/meta.yaml diff --git a/script/app-image-corner-detection/customize.py b/script/app-image-corner-detection/customize.py index de1e344ee..f27ee028a 100644 --- a/script/app-image-corner-detection/customize.py +++ b/script/app-image-corner-detection/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/app-image-corner-detection/_cm.yaml b/script/app-image-corner-detection/meta.yaml similarity index 100% rename from script/app-image-corner-detection/_cm.yaml rename to script/app-image-corner-detection/meta.yaml diff --git a/script/app-loadgen-generic-python/customize.py b/script/app-loadgen-generic-python/customize.py index 17c923552..55050fadb 100644 --- a/script/app-loadgen-generic-python/customize.py +++ b/script/app-loadgen-generic-python/customize.py @@ -1,6 +1,6 @@ # Developer: Grigori Fursin -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-loadgen-generic-python/_cm.yaml b/script/app-loadgen-generic-python/meta.yaml similarity index 100% rename from script/app-loadgen-generic-python/_cm.yaml rename to script/app-loadgen-generic-python/meta.yaml diff --git a/script/app-mlperf-automotive-mlcommons-python/customize.py b/script/app-mlperf-automotive-mlcommons-python/customize.py index 58ee04e1f..70ae33af2 100644 --- a/script/app-mlperf-automotive-mlcommons-python/customize.py +++ b/script/app-mlperf-automotive-mlcommons-python/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json import shutil diff --git a/script/app-mlperf-automotive-mlcommons-python/_cm.yaml b/script/app-mlperf-automotive-mlcommons-python/meta.yaml similarity index 100% rename from script/app-mlperf-automotive-mlcommons-python/_cm.yaml rename to script/app-mlperf-automotive-mlcommons-python/meta.yaml diff --git a/script/app-mlperf-automotive/customize.py b/script/app-mlperf-automotive/customize.py index 070f2b3c1..a9ea896d6 100644 --- a/script/app-mlperf-automotive/customize.py +++ b/script/app-mlperf-automotive/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json import shutil @@ -76,28 +76,28 @@ def postprocess(i): # result, valid, power_result = mlperf_utils.get_result_from_log(env['CM_MLPERF_LAST_RELEASE'], model, scenario, output_dir, mode) - if not state.get('cm-mlperf-inference-results'): - state['cm-mlperf-inference-results'] = {} - if not state.get('cm-mlperf-inference-results-last'): - state['cm-mlperf-inference-results-last'] = {} - if not state['cm-mlperf-inference-results'].get( + if not state.get('mlc-mlperf-inference-results'): + state['mlc-mlperf-inference-results'] = {} + if not state.get('mlc-mlperf-inference-results-last'): + state['mlc-mlperf-inference-results-last'] = {} + if not state['mlc-mlperf-inference-results'].get( state['CM_SUT_CONFIG_NAME']): - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']] = {} - if not state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ].get(model): - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']][model] = {} - if not state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model].get(scenario): - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario] = {} - - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario][mode] = result - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario][mode + '_valid'] = valid.get(mode, False) - - state['cm-mlperf-inference-results-last'][mode] = result - state['cm-mlperf-inference-results-last'][mode + - '_valid'] = valid.get(mode, False) + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']] = {} + if not state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ].get(model): + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']][model] = {} + if not state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model].get(scenario): + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario] = {} + + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario][mode] = result + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario][mode + '_valid'] = valid.get(mode, False) + + state['mlc-mlperf-inference-results-last'][mode] = result + state['mlc-mlperf-inference-results-last'][mode + + '_valid'] = valid.get(mode, False) return {'return': 0} diff --git a/script/app-mlperf-automotive/_cm.yaml b/script/app-mlperf-automotive/meta.yaml similarity index 99% rename from script/app-mlperf-automotive/_cm.yaml rename to script/app-mlperf-automotive/meta.yaml index cfb22101f..a999c0ee0 100644 --- a/script/app-mlperf-automotive/_cm.yaml +++ b/script/app-mlperf-automotive/meta.yaml @@ -67,7 +67,7 @@ new_env_keys: - CM_OUTPUT_PREDICTIONS_PATH new_state_keys: - - cm-mlperf-inference-results* + - mlc-mlperf-inference-results* # Dependencies on other CM scripts deps: diff --git a/script/app-mlperf-inference-amd/customize.py b/script/app-mlperf-inference-amd/customize.py index e1958e5a8..16d6245ee 100644 --- a/script/app-mlperf-inference-amd/customize.py +++ b/script/app-mlperf-inference-amd/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-amd/_cm.yaml b/script/app-mlperf-inference-amd/meta.yaml similarity index 100% rename from script/app-mlperf-inference-amd/_cm.yaml rename to script/app-mlperf-inference-amd/meta.yaml diff --git a/script/app-mlperf-inference-ctuning-cpp-tflite/customize.py b/script/app-mlperf-inference-ctuning-cpp-tflite/customize.py index f5c8e844c..8589a8241 100644 --- a/script/app-mlperf-inference-ctuning-cpp-tflite/customize.py +++ b/script/app-mlperf-inference-ctuning-cpp-tflite/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-ctuning-cpp-tflite/_cm.yaml b/script/app-mlperf-inference-ctuning-cpp-tflite/meta.yaml similarity index 100% rename from script/app-mlperf-inference-ctuning-cpp-tflite/_cm.yaml rename to script/app-mlperf-inference-ctuning-cpp-tflite/meta.yaml diff --git a/script/app-mlperf-inference-dummy/customize.py b/script/app-mlperf-inference-dummy/customize.py index 74ff72927..40e41f738 100644 --- a/script/app-mlperf-inference-dummy/customize.py +++ b/script/app-mlperf-inference-dummy/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-dummy/_cm.yaml b/script/app-mlperf-inference-dummy/meta.yaml similarity index 100% rename from script/app-mlperf-inference-dummy/_cm.yaml rename to script/app-mlperf-inference-dummy/meta.yaml diff --git a/script/app-mlperf-inference-intel/customize.py b/script/app-mlperf-inference-intel/customize.py index 57ab3887d..667e5fb86 100644 --- a/script/app-mlperf-inference-intel/customize.py +++ b/script/app-mlperf-inference-intel/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-intel/_cm.yaml b/script/app-mlperf-inference-intel/meta.yaml similarity index 100% rename from script/app-mlperf-inference-intel/_cm.yaml rename to script/app-mlperf-inference-intel/meta.yaml diff --git a/script/app-mlperf-inference-mlcommons-cpp/customize.py b/script/app-mlperf-inference-mlcommons-cpp/customize.py index 89356a270..1884a0798 100644 --- a/script/app-mlperf-inference-mlcommons-cpp/customize.py +++ b/script/app-mlperf-inference-mlcommons-cpp/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-mlcommons-cpp/_cm.yaml b/script/app-mlperf-inference-mlcommons-cpp/meta.yaml similarity index 100% rename from script/app-mlperf-inference-mlcommons-cpp/_cm.yaml rename to script/app-mlperf-inference-mlcommons-cpp/meta.yaml diff --git a/script/app-mlperf-inference-mlcommons-python/customize.py b/script/app-mlperf-inference-mlcommons-python/customize.py index cbb8b9bc3..0a4d22cdb 100644 --- a/script/app-mlperf-inference-mlcommons-python/customize.py +++ b/script/app-mlperf-inference-mlcommons-python/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json import shutil diff --git a/script/app-mlperf-inference-mlcommons-python/_cm.yaml b/script/app-mlperf-inference-mlcommons-python/meta.yaml similarity index 100% rename from script/app-mlperf-inference-mlcommons-python/_cm.yaml rename to script/app-mlperf-inference-mlcommons-python/meta.yaml diff --git a/script/app-mlperf-inference-nvidia/customize.py b/script/app-mlperf-inference-nvidia/customize.py index f9eb06822..851f9fa84 100644 --- a/script/app-mlperf-inference-nvidia/customize.py +++ b/script/app-mlperf-inference-nvidia/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-nvidia/_cm.yaml b/script/app-mlperf-inference-nvidia/meta.yaml similarity index 100% rename from script/app-mlperf-inference-nvidia/_cm.yaml rename to script/app-mlperf-inference-nvidia/meta.yaml diff --git a/script/app-mlperf-inference-qualcomm/customize.py b/script/app-mlperf-inference-qualcomm/customize.py index 53d0a44be..e14de6d5a 100644 --- a/script/app-mlperf-inference-qualcomm/customize.py +++ b/script/app-mlperf-inference-qualcomm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-qualcomm/_cm.yaml b/script/app-mlperf-inference-qualcomm/meta.yaml similarity index 100% rename from script/app-mlperf-inference-qualcomm/_cm.yaml rename to script/app-mlperf-inference-qualcomm/meta.yaml diff --git a/script/app-mlperf-inference-redhat/customize.py b/script/app-mlperf-inference-redhat/customize.py index add2a916f..d5d4ee85d 100644 --- a/script/app-mlperf-inference-redhat/customize.py +++ b/script/app-mlperf-inference-redhat/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/app-mlperf-inference-redhat/_cm.yaml b/script/app-mlperf-inference-redhat/meta.yaml similarity index 100% rename from script/app-mlperf-inference-redhat/_cm.yaml rename to script/app-mlperf-inference-redhat/meta.yaml diff --git a/script/app-mlperf-inference/build_dockerfiles.py b/script/app-mlperf-inference/build_dockerfiles.py index 72aeaf766..52f2726b8 100644 --- a/script/app-mlperf-inference/build_dockerfiles.py +++ b/script/app-mlperf-inference/build_dockerfiles.py @@ -1,4 +1,4 @@ -import cmind +import mlc import os import pathlib current_file_path = pathlib.Path(__file__).parent.resolve() @@ -64,41 +64,41 @@ version + file_name_ext + '.Dockerfile') - cm_input = {'action': 'run', - 'automation': 'script', - 'tags': 'app,mlperf,inference,generic' + variation_string, - 'adr': {'compiler': - {'tags': 'gcc'}, - 'inference-src': - {'tags': '_octoml'}, - 'openimages-preprocessed': - {'tags': '_50'} - }, - 'print_deps': True, - 'quiet': True, - 'silent': True, - 'fake_run': True - } - r = cmind.access(cm_input) + mlc_input = {'action': 'run', + 'automation': 'script', + 'tags': 'app,mlperf,inference,generic' + variation_string, + 'adr': {'compiler': + {'tags': 'gcc'}, + 'inference-src': + {'tags': '_octoml'}, + 'openimages-preprocessed': + {'tags': '_50'} + }, + 'print_deps': True, + 'quiet': True, + 'silent': True, + 'fake_run': True + } + r = mlc.access(mlc_input) print_deps = r['new_state']['print_deps'] comments = ["#RUN " + dep for dep in print_deps] comments.append("") comments.append( "# Run CM workflow for MLPerf inference") - cm_docker_input = {'action': 'run', - 'automation': 'script', - 'tags': 'build,dockerfile', - 'docker_os': _os, - 'docker_os_version': version, - 'file_path': dockerfile_path, - 'comments': comments, - 'run_cmd': 'cm run script --tags=app,mlperf,inference,generic' + variation_string + ' --adr.compiler.tags=gcc --adr.inference-src.tags=_octoml', - 'script_tags': 'app,mlperf,inference,generic', - 'quiet': True, - 'print_deps': True, - 'real_run': True - } - r = cmind.access(cm_docker_input) + mlc_docker_input = {'action': 'run', + 'automation': 'script', + 'tags': 'build,dockerfile', + 'docker_os': _os, + 'docker_os_version': version, + 'file_path': dockerfile_path, + 'comments': comments, + 'run_cmd': 'mlc run script --tags=app,mlperf,inference,generic' + variation_string + ' --adr.compiler.tags=gcc --adr.inference-src.tags=_octoml', + 'script_tags': 'app,mlperf,inference,generic', + 'quiet': True, + 'print_deps': True, + 'real_run': True + } + r = mlc.access(mlc_docker_input) if r['return'] > 0: print(r) exit(1) diff --git a/script/app-mlperf-inference/customize.py b/script/app-mlperf-inference/customize.py index 2c34dad70..976f5124b 100644 --- a/script/app-mlperf-inference/customize.py +++ b/script/app-mlperf-inference/customize.py @@ -1,11 +1,11 @@ -from cmind import utils +from mlc import utils import os import json import shutil import subprocess import copy -import cmind as cm +import mlc import platform import sys import mlperf_utils @@ -174,20 +174,20 @@ def postprocess(i): # {model}'} scenario = env['CM_MLPERF_LOADGEN_SCENARIO'] - if not state.get('cm-mlperf-inference-results'): - state['cm-mlperf-inference-results'] = {} - if not state.get('cm-mlperf-inference-results-last'): - state['cm-mlperf-inference-results-last'] = {} - if not state['cm-mlperf-inference-results'].get( + if not state.get('mlc-mlperf-inference-results'): + state['mlc-mlperf-inference-results'] = {} + if not state.get('mlc-mlperf-inference-results-last'): + state['mlc-mlperf-inference-results-last'] = {} + if not state['mlc-mlperf-inference-results'].get( state['CM_SUT_CONFIG_NAME']): - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']] = {} - if not state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ].get(model): - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']][model] = {} - if not state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model].get(scenario): - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario] = {} + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']] = {} + if not state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ].get(model): + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME']][model] = {} + if not state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model].get(scenario): + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario] = {} # if env.get("CM_MLPERF_FIND_PERFORMANCE_MODE", '') == "yes" and mode == # "performance" and scenario != "Server": @@ -328,33 +328,33 @@ def postprocess(i): power = power_result_split[0] power_efficiency = power_result_split[1] - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario][mode] = result - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario][mode + '_valid'] = valid.get(mode, False) + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario][mode] = result + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario][mode + '_valid'] = valid.get(mode, False) - state['cm-mlperf-inference-results-last'][mode] = result - state['cm-mlperf-inference-results-last'][mode + - '_valid'] = valid.get(mode, False) + state['mlc-mlperf-inference-results-last'][mode] = result + state['mlc-mlperf-inference-results-last'][mode + + '_valid'] = valid.get(mode, False) if power: - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario]['power'] = power - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario]['power_valid'] = valid['power'] - state['cm-mlperf-inference-results-last']['power'] = power - state['cm-mlperf-inference-results-last']['power_valid'] = valid['power'] + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario]['power'] = power + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario]['power_valid'] = valid['power'] + state['mlc-mlperf-inference-results-last']['power'] = power + state['mlc-mlperf-inference-results-last']['power_valid'] = valid['power'] if power_efficiency: - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario]['power_efficiency'] = power_efficiency - state['cm-mlperf-inference-results-last']['power_efficiency'] = power_efficiency + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario]['power_efficiency'] = power_efficiency + state['mlc-mlperf-inference-results-last']['power_efficiency'] = power_efficiency # Record basic host info host_info = { "os_version": platform.platform(), "cpu_version": platform.processor(), "python_version": sys.version, - "cm_version": cm.__version__ + "mlc_version": mlc.__version__ } x = '' @@ -371,8 +371,8 @@ def postprocess(i): # Check CM automation repository repo_name = 'mlcommons@mlperf-automations' repo_hash = '' - r = cm.access({'action': 'find', 'automation': 'repo', - 'artifact': 'mlcommons@cm4mlops,9e97bb72b0474657'}) + r = mlc.access({'action': 'find', 'automation': 'repo', + 'item': 'mlcommons@mlperf-automations,9e97bb72b0474657'}) if r['return'] == 0 and len(r['list']) == 1: repo_path = r['list'][0].path if os.path.isdir(repo_path): @@ -381,23 +381,22 @@ def postprocess(i): # Check dev # if repo_name == 'cm4mlops': repo_name = 'mlcommons@cm4mlops' - r = cm.access({'action': 'system', - 'automation': 'utils', - 'path': repo_path, - 'cmd': 'git rev-parse HEAD'}) - if r['return'] == 0 and r['ret'] == 0: - repo_hash = r['stdout'] + r = utils.run_system_cmd({ + 'path': repo_path, + 'cmd': 'git rev-parse HEAD'}) + if r['return'] == 0: + repo_hash = r['output'] - host_info['cm_repo_name'] = repo_name - host_info['cm_repo_git_hash'] = repo_hash + host_info['mlc_repo_name'] = repo_name + host_info['mlc_repo_git_hash'] = repo_hash - with open("cm-host-info.json", "w") as fp: + with open("mlc-host-info.json", "w") as fp: fp.write(json.dumps(host_info, indent=2) + '\n') # Prepare README if "cmd" in inp: - cmd = "cm run script \\\n\t" + " \\\n\t".join(inp['cmd']) - xcmd = "cm run script " + xsep + "\n\t" + \ + cmd = "mlc run script \\\n\t" + " \\\n\t".join(inp['cmd']) + xcmd = "mlc run script " + xsep + "\n\t" + \ (" " + xsep + "\n\t").join(inp['cmd']) else: cmd = "" @@ -405,41 +404,41 @@ def postprocess(i): readme_init = "*Check [CM MLPerf docs](https://docs.mlcommons.org/inference) for more details.*\n\n" - readme_body = "## Host platform\n\n* OS version: {}\n* CPU version: {}\n* Python version: {}\n* MLCommons CM version: {}\n\n".format(platform.platform(), - platform.processor(), sys.version, cm.__version__) + readme_body = "## Host platform\n\n* OS version: {}\n* CPU version: {}\n* Python version: {}\n* MLC version: {}\n\n".format(platform.platform(), + platform.processor(), sys.version, mlc.__version__) x = repo_name if repo_hash != '': x += ' --checkout=' + str(repo_hash) readme_body += "## CM Run Command\n\nSee [CM installation guide](https://docs.mlcommons.org/inference/install/).\n\n" + \ - "```bash\npip install -U cmind\n\ncm rm cache -f\n\ncm pull repo {}\n\n{}\n```".format( + "```bash\npip install -U mlcflow\n\nmlc rm cache -f\n\nmlc pull repo {}\n\n{}\n```".format( x, xcmd) - readme_body += "\n*Note that if you want to use the [latest automation recipes](https://docs.mlcommons.org/inference) for MLPerf (CM scripts),\n" + \ - " you should simply reload {} without checkout and clean CM cache as follows:*\n\n".format(repo_name) + \ - "```bash\ncm rm repo {}\ncm pull repo {}\ncm rm cache -f\n\n```".format( + readme_body += "\n*Note that if you want to use the [latest automation recipes](https://docs.mlcommons.org/inference) for MLPerf,\n" + \ + " you should simply reload {} without checkout and clean MLC cache as follows:*\n\n".format(repo_name) + \ + "```bash\nmlc rm repo {}\nmlc pull repo {}\nmlc rm cache -f\n\n```".format( repo_name, repo_name) extra_readme_init = '' extra_readme_body = '' - if env.get('CM_MLPERF_README', '') == "yes": - extra_readme_body += "\n## Dependent CM scripts\n\n" + if env.get('MLC_MLPERF_README', '') == "yes": + extra_readme_body += "\n## Dependent MLPerf Automation scripts\n\n" script_tags = inp['tags'] script_adr = inp.get('adr', {}) - cm_input = {'action': 'run', - 'automation': 'script', - 'tags': script_tags, - 'adr': script_adr, - 'print_deps': True, - 'env': env, - 'quiet': True, - 'silent': True, - 'fake_run': True - } - r = cm.access(cm_input) + mlc_input = {'action': 'run', + 'automation': 'script', + 'tags': script_tags, + 'adr': script_adr, + 'print_deps': True, + 'env': env, + 'quiet': True, + 'silent': True, + 'fake_run': True + } + r = mlc.access(mlc_input) if r['return'] > 0: return r @@ -452,7 +451,7 @@ def postprocess(i): if state.get( 'mlperf-inference-implementation') and state['mlperf-inference-implementation'].get('print_deps'): - extra_readme_body += "\n## Dependent CM scripts for the MLPerf Inference Implementation\n" + extra_readme_body += "\n## Dependent automation scripts for the MLPerf Inference Implementation\n" print_deps = state['mlperf-inference-implementation']['print_deps'] count = 1 @@ -556,8 +555,8 @@ def postprocess(i): import submission_checker as checker is_valid = checker.check_compliance_perf_dir( COMPLIANCE_DIR) if test != "TEST06" else True - state['cm-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] - ][model][scenario][test] = "passed" if is_valid else "failed" + state['mlc-mlperf-inference-results'][state['CM_SUT_CONFIG_NAME'] + ][model][scenario][test] = "passed" if is_valid else "failed" # portion of the code where the avg utilisation and system informations are extracted # NOTE: The section is under development and print statements are added @@ -611,12 +610,12 @@ def postprocess(i): if state.get( 'mlperf-inference-implementation') and state['mlperf-inference-implementation'].get('version_info'): env['CM_MLPERF_RUN_JSON_VERSION_INFO_FILE'] = os.path.join( - output_dir, "cm-version-info.json") + output_dir, "mlc-version-info.json") env['CM_MLPERF_RUN_DEPS_GRAPH'] = os.path.join( - output_dir, "cm-deps.png") + output_dir, "mlc-deps.png") env['CM_MLPERF_RUN_DEPS_MERMAID'] = os.path.join( - output_dir, "cm-deps.mmd") - with open(os.path.join(output_dir, "cm-version-info.json"), "w") as f: + output_dir, "mlc-deps.mmd") + with open(os.path.join(output_dir, "mlc-version-info.json"), "w") as f: f.write( json.dumps( state['mlperf-inference-implementation']['version_info'], @@ -655,15 +654,15 @@ def postprocess(i): def dump_script_output(script_tags, env, state, output_key, dump_file): - cm_input = {'action': 'run', - 'automation': 'script', - 'tags': script_tags, - 'env': env, - 'state': state, - 'quiet': True, - 'silent': True, - } - r = cm.access(cm_input) + mlc_input = {'action': 'run', + 'automation': 'script', + 'tags': script_tags, + 'env': env, + 'state': state, + 'quiet': True, + 'silent': True, + } + r = mlc.access(mlc_input) if r['return'] > 0: return r with open(dump_file, "w") as f: diff --git a/script/app-mlperf-inference/_cm.yaml b/script/app-mlperf-inference/meta.yaml similarity index 99% rename from script/app-mlperf-inference/_cm.yaml rename to script/app-mlperf-inference/meta.yaml index 7596b30ef..bf5057814 100644 --- a/script/app-mlperf-inference/_cm.yaml +++ b/script/app-mlperf-inference/meta.yaml @@ -80,7 +80,7 @@ new_env_keys: new_state_keys: - app_mlperf_inference_* - - cm-mlperf-inference-results* + - mlc-mlperf-inference-results* # Dependencies on other CM scripts deps: diff --git a/script/app-mlperf-training-nvidia/customize.py b/script/app-mlperf-training-nvidia/customize.py index 0d5c53c44..e1613cd75 100644 --- a/script/app-mlperf-training-nvidia/customize.py +++ b/script/app-mlperf-training-nvidia/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json import shutil diff --git a/script/app-mlperf-training-nvidia/_cm.yaml b/script/app-mlperf-training-nvidia/meta.yaml similarity index 100% rename from script/app-mlperf-training-nvidia/_cm.yaml rename to script/app-mlperf-training-nvidia/meta.yaml diff --git a/script/app-mlperf-training-reference/customize.py b/script/app-mlperf-training-reference/customize.py index 446939470..54a544fcb 100644 --- a/script/app-mlperf-training-reference/customize.py +++ b/script/app-mlperf-training-reference/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json import shutil diff --git a/script/app-mlperf-training-reference/_cm.yaml b/script/app-mlperf-training-reference/meta.yaml similarity index 100% rename from script/app-mlperf-training-reference/_cm.yaml rename to script/app-mlperf-training-reference/meta.yaml diff --git a/script/app-stable-diffusion-onnx-py/_cm.yaml b/script/app-stable-diffusion-onnx-py/meta.yaml similarity index 100% rename from script/app-stable-diffusion-onnx-py/_cm.yaml rename to script/app-stable-diffusion-onnx-py/meta.yaml diff --git a/script/authenticate-github-cli/customize.py b/script/authenticate-github-cli/customize.py index f4adae993..a4fb19772 100644 --- a/script/authenticate-github-cli/customize.py +++ b/script/authenticate-github-cli/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/authenticate-github-cli/_cm.yaml b/script/authenticate-github-cli/meta.yaml similarity index 100% rename from script/authenticate-github-cli/_cm.yaml rename to script/authenticate-github-cli/meta.yaml diff --git a/script/benchmark-any-mlperf-inference-implementation/customize.py b/script/benchmark-any-mlperf-inference-implementation/customize.py index e7f7acc79..b5961dbae 100644 --- a/script/benchmark-any-mlperf-inference-implementation/customize.py +++ b/script/benchmark-any-mlperf-inference-implementation/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/benchmark-any-mlperf-inference-implementation/_cm.yaml b/script/benchmark-any-mlperf-inference-implementation/meta.yaml similarity index 100% rename from script/benchmark-any-mlperf-inference-implementation/_cm.yaml rename to script/benchmark-any-mlperf-inference-implementation/meta.yaml diff --git a/script/benchmark-program-mlperf/customize.py b/script/benchmark-program-mlperf/customize.py index 23b4db324..fa8c7d627 100644 --- a/script/benchmark-program-mlperf/customize.py +++ b/script/benchmark-program-mlperf/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/benchmark-program-mlperf/_cm.yaml b/script/benchmark-program-mlperf/meta.yaml similarity index 100% rename from script/benchmark-program-mlperf/_cm.yaml rename to script/benchmark-program-mlperf/meta.yaml diff --git a/script/benchmark-program/customize.py b/script/benchmark-program/customize.py index 2dd6ffc1c..08e15863c 100644 --- a/script/benchmark-program/customize.py +++ b/script/benchmark-program/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/benchmark-program/_cm.yaml b/script/benchmark-program/meta.yaml similarity index 100% rename from script/benchmark-program/_cm.yaml rename to script/benchmark-program/meta.yaml diff --git a/script/build-docker-image/customize.py b/script/build-docker-image/customize.py index f674ea677..a231b6b09 100644 --- a/script/build-docker-image/customize.py +++ b/script/build-docker-image/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os from os.path import exists diff --git a/script/build-docker-image/_cm.yaml b/script/build-docker-image/meta.yaml similarity index 100% rename from script/build-docker-image/_cm.yaml rename to script/build-docker-image/meta.yaml diff --git a/script/build-dockerfile/customize.py b/script/build-dockerfile/customize.py index d6dbd061e..c95c2f96f 100644 --- a/script/build-dockerfile/customize.py +++ b/script/build-dockerfile/customize.py @@ -1,6 +1,6 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os +import mlc import json import re import shutil @@ -24,10 +24,12 @@ def preprocess(i): build_args_default = {} input_args = [] copy_files = [] + automation = i['automation'] + # print(env['CM_DOCKER_RUN_SCRIPT_TAGS']) if env.get('CM_DOCKER_RUN_SCRIPT_TAGS', '') != '': script_tags = env['CM_DOCKER_RUN_SCRIPT_TAGS'] - found_scripts = cm.access( + found_scripts = automation.action_object.access( {'action': 'search', 'automation': 'script', 'tags': script_tags}) scripts_list = found_scripts['list'] @@ -61,18 +63,18 @@ def preprocess(i): 'return': 1, 'error': f"Version \"{env['CM_DOCKER_OS_VERSION']}\" is not supported yet for \"{env['CM_DOCKER_OS']}\" "} # Handle cm_mlops Repository - if env.get("CM_REPO_PATH", "") != "": + if env.get("MLC_REPO_PATH", "") != "": use_copy_repo = True - cm_repo_path = os.path.abspath(env["CM_REPO_PATH"]) + mlc_repo_path = os.path.abspath(env["MLC_REPO_PATH"]) - if not os.path.exists(cm_repo_path): + if not os.path.exists(mlc_repo_path): return { - 'return': 1, 'error': f"Specified CM_REPO_PATH does not exist: {cm_repo_path}"} + 'return': 1, 'error': f"Specified MLC_REPO_PATH does not exist: {mlc_repo_path}"} - cmr_yml_path = os.path.join(cm_repo_path, "cmr.yaml") - if not os.path.isfile(cmr_yml_path): + meta_yml_path = os.path.join(mlc_repo_path, "meta.yaml") + if not os.path.isfile(meta_yml_path): return { - 'return': 1, 'error': f"cmr.yaml not found in CM_REPO_PATH: {cm_repo_path}"} + 'return': 1, 'error': f"meta.yaml not found in MLC_REPO_PATH: {mlc_repo_path}"} # Define the build context directory (where the Dockerfile will be) build_context_dir = os.path.dirname( @@ -83,8 +85,8 @@ def preprocess(i): "Dockerfile"))) os.makedirs(build_context_dir, exist_ok=True) - # Create cm_repo directory relative to the build context - repo_build_context_path = os.path.join(build_context_dir, "cm_repo") + # Create mlc_repo directory relative to the build context + repo_build_context_path = os.path.join(build_context_dir, "mlc_repo") # Remove existing directory if it exists if os.path.exists(repo_build_context_path): @@ -92,8 +94,8 @@ def preprocess(i): try: print( - f"Copying repository from {cm_repo_path} to {repo_build_context_path}") - shutil.copytree(cm_repo_path, repo_build_context_path) + f"Copying repository from {mlc_repo_path} to {repo_build_context_path}") + shutil.copytree(mlc_repo_path, repo_build_context_path) except Exception as e: return { 'return': 1, 'error': f"Failed to copy repository to build context: {str(e)}"} @@ -105,15 +107,15 @@ def preprocess(i): # (Optional) Verify the copy if not os.path.isdir(repo_build_context_path): return { - 'return': 1, 'error': f"cm_repo was not successfully copied to the build context at {repo_build_context_path}"} + 'return': 1, 'error': f"mlc_repo was not successfully copied to the build context at {repo_build_context_path}"} else: print( - f"cm_repo is present in the build context at {repo_build_context_path}") + f"mlc_repo is present in the build context at {repo_build_context_path}") relative_repo_path = os.path.relpath( repo_build_context_path, build_context_dir) else: - # CM_REPO_PATH is not set; use cm pull repo as before + # MLC_REPO_PATH is not set; use mlc pull repo as before use_copy_repo = False if env.get("CM_MLOPS_REPO", "") != "": @@ -154,9 +156,8 @@ def preprocess(i): # Maintainers f.write(EOL) f.write( - '# Automatically generated by the CM workflow automation meta-framework' + + '# Automatically generated by the MLC workflow automation meta-framework' + EOL) - f.write('# https://github.com/mlcommons/ck' + EOL) f.write(EOL) f.write('LABEL github=""' + EOL) @@ -247,8 +248,8 @@ def preprocess(i): f.write('RUN ' + cmd + EOL) f.write(EOL + '# Setup docker user' + EOL) - docker_user = get_value(env, config, 'USER', 'CM_DOCKER_USER') - docker_group = get_value(env, config, 'GROUP', 'CM_DOCKER_GROUP') + docker_user = get_value(env, config, 'USER', 'MLC_DOCKER_USER') + docker_group = get_value(env, config, 'GROUP', 'MLC_DOCKER_GROUP') if env.get('CM_CONTAINER_TOOL', '') == 'podman' and env.get( 'CM_DOCKER_USE_DEFAULT_USER', '') == '': @@ -271,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/cmuser' + EOL) + f.write('ENV HOME=/home/mlcuser' + EOL) else: f.write('ENV HOME=/root' + EOL) @@ -283,7 +284,7 @@ def preprocess(i): docker_env_key + "=" + str(dockerfile_env[docker_env_key]) workdir = get_value(env, config, 'WORKDIR', 'CM_DOCKER_WORKDIR') - if workdir and ("/home/cmuser" not in workdir or str(env.get('CM_DOCKER_USE_DEFAULT_USER', '')).lower() not in [ + if workdir and ("/home/mlcuser" not in workdir or str(env.get('CM_DOCKER_USE_DEFAULT_USER', '')).lower() not in [ "yes", "1", "true"]): f.write('WORKDIR ' + workdir + EOL) @@ -292,9 +293,9 @@ def preprocess(i): docker_use_virtual_python = env.get('CM_DOCKER_USE_VIRTUAL_PYTHON', "yes") if str(docker_use_virtual_python).lower() not in ["no", "0", "false"]: - f.write('RUN {} -m venv $HOME/venv/cm'.format(python) + " " + EOL) - f.write('ENV PATH="$HOME/venv/cm/bin:$PATH"' + EOL) - # f.write('RUN . /opt/venv/cm/bin/activate' + EOL) + 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( 'RUN {} -m pip install '.format(python) + @@ -308,26 +309,26 @@ def preprocess(i): ' ' + EOL) - f.write(EOL + '# Download CM repo for scripts' + EOL) + f.write(EOL + '# Download MLC repo for scripts' + EOL) if use_copy_repo: - docker_repo_dest = "$HOME/CM/repos/mlcommons@mlperf-automations" + docker_repo_dest = "$HOME/MLC/repos/mlcommons@mlperf-automations" f.write( - f'COPY --chown=cmuser:cm {relative_repo_path} {docker_repo_dest}' + + f'COPY --chown=mlcuser:mlc {relative_repo_path} {docker_repo_dest}' + EOL) - f.write(EOL + '# Register CM repository' + EOL) - f.write('RUN cm pull repo --url={} --quiet'.format(docker_repo_dest) + EOL) + f.write(EOL + '# Register MLC repository' + EOL) + f.write('RUN mlc pull repo --url={} --quiet'.format(docker_repo_dest) + EOL) f.write(EOL) else: - # Use cm pull repo as before + # Use mlc pull repo as before x = env.get('CM_DOCKER_ADD_FLAG_TO_CM_MLOPS_REPO', '') if x != '': x = ' ' + x f.write( - 'RUN cm pull repo ' + + 'RUN mlc pull repo ' + cm_mlops_repo + cm_mlops_repo_branch_string + x + @@ -342,7 +343,7 @@ def preprocess(i): if str(env.get('CM_DOCKER_SKIP_CM_SYS_UPGRADE', False) ).lower() not in ["true", "1", "yes"]: f.write(EOL + '# Install all system dependencies' + EOL) - f.write('RUN cm run script --tags=get,sys-utils-cm --quiet' + EOL) + f.write('RUN mlc run script --tags=get,sys-utils-cm --quiet' + EOL) if 'CM_DOCKER_PRE_RUN_COMMANDS' in env: for pre_run_cmd in env['CM_DOCKER_PRE_RUN_COMMANDS']: @@ -362,18 +363,18 @@ def preprocess(i): if 'CM_DOCKER_RUN_CMD' not in env: env['CM_DOCKER_RUN_CMD'] = "" if 'CM_DOCKER_RUN_SCRIPT_TAGS' not in env: - env['CM_DOCKER_RUN_CMD'] += "cm version" + env['CM_DOCKER_RUN_CMD'] += "mlc version" skip_extra = True else: if str(env.get('CM_DOCKER_NOT_PULL_UPDATE', 'False') ).lower() not in ["yes", "1", "true"]: - env['CM_DOCKER_RUN_CMD'] += "cm pull repo && " - env['CM_DOCKER_RUN_CMD'] += "cm run script --tags=" + \ + env['CM_DOCKER_RUN_CMD'] += "mlc pull repo && " + env['CM_DOCKER_RUN_CMD'] += "mlc run script --tags=" + \ env['CM_DOCKER_RUN_SCRIPT_TAGS'] + ' --quiet' else: if str(env.get('CM_DOCKER_NOT_PULL_UPDATE', 'False') ).lower() not in ["yes", "1", "true"]: - env['CM_DOCKER_RUN_CMD'] = "cm pull repo && " + \ + env['CM_DOCKER_RUN_CMD'] = "mlc pull repo && " + \ env['CM_DOCKER_RUN_CMD'] print(env['CM_DOCKER_RUN_CMD']) @@ -393,16 +394,16 @@ def preprocess(i): if env.get('CM_DOCKER_RUN_SCRIPT_TAGS', '') != '' and str(env.get( 'CM_DOCKER_ADD_DEPENDENT_SCRIPTS_RUN_COMMANDS', '')).lower() in ["yes", "1", "true"]: - cm_input = {'action': 'run', - 'automation': 'script', - 'tags': f"""{env['CM_DOCKER_RUN_SCRIPT_TAGS']}""", - 'print_deps': True, - 'quiet': True, - 'silent': True, - 'fake_run': True, - 'fake_deps': True - } - r = self_module.cmind.access(cm_input) + mlc_input = {'action': 'run', + 'automation': 'script', + 'tags': f"""{env['CM_DOCKER_RUN_SCRIPT_TAGS']}""", + 'print_deps': True, + 'quiet': True, + 'silent': True, + 'fake_run': True, + 'fake_deps': True + } + r = self_module.mlc.access(mlc_input) if r['return'] > 0: return r print_deps = r['new_state']['print_deps'] diff --git a/script/build-dockerfile/dockerinfo.json b/script/build-dockerfile/dockerinfo.json index df9c6c90a..4cc98e35c 100644 --- a/script/build-dockerfile/dockerinfo.json +++ b/script/build-dockerfile/dockerinfo.json @@ -1,9 +1,9 @@ { "python-packages": [ - "wheel", "cmind", "requests", "giturlparse", "tabulate" + "wheel", "mlcflow", "requests", "giturlparse", "tabulate" ], "ARGS": [ - "CM_GH_TOKEN" + "MLC_GH_TOKEN" ], "ARGS_DEFAULT": { "UID" : "1000", @@ -12,18 +12,18 @@ "ENTRYPOINT": "[\"/bin/bash\", \"-c\"]", "ENV": { "TZ": "US/Pacific", - "PATH": "${PATH}:/home/cmuser/.local/bin" + "PATH": "${PATH}:/home/mlcuser/.local/bin" }, "RUN_CMDS": [ "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone" ], "PYTHON": "python3", "UID": "", - "USER": "cmuser", + "USER": "mlcuser", "GID": "", - "GROUP": "cm", + "GROUP": "mlc", "SHELL": "[\"/bin/bash\", \"-c\"]", - "WORKDIR": "/home/cmuser", + "WORKDIR": "/home/mlcuser", "distros": { "ubuntu": { "package-manager-update-cmd": "apt-get update -y", @@ -65,7 +65,7 @@ "python39", "python39-pip", "git", "wget", "sudo", "binutils" ], "python-packages": [ - "cmind", "requests", "giturlparse", "tabulate" + "mlcflow", "requests", "giturlparse", "tabulate" ], "PYTHON": "python3.9" } diff --git a/script/build-dockerfile/_cm.yaml b/script/build-dockerfile/meta.yaml similarity index 98% rename from script/build-dockerfile/_cm.yaml rename to script/build-dockerfile/meta.yaml index 9f91c0775..cc81fe3c5 100644 --- a/script/build-dockerfile/_cm.yaml +++ b/script/build-dockerfile/meta.yaml @@ -19,7 +19,7 @@ default_env: ' CM_DOCKER_OS: ubuntu CM_DOCKER_NOT_PULL_UPDATE: False - CM_MLOPS_REPO_BRANCH: dev + CM_MLOPS_REPO_BRANCH: mlc input_mapping: build: CM_BUILD_DOCKER_IMAGE diff --git a/script/build-mlperf-inference-server-nvidia/customize.py b/script/build-mlperf-inference-server-nvidia/customize.py index 8d477fcc7..f150d930b 100644 --- a/script/build-mlperf-inference-server-nvidia/customize.py +++ b/script/build-mlperf-inference-server-nvidia/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/build-mlperf-inference-server-nvidia/_cm.yaml b/script/build-mlperf-inference-server-nvidia/meta.yaml similarity index 100% rename from script/build-mlperf-inference-server-nvidia/_cm.yaml rename to script/build-mlperf-inference-server-nvidia/meta.yaml diff --git a/script/calibrate-model-for.qaic/customize.py b/script/calibrate-model-for.qaic/customize.py index a77967c49..32ff19353 100644 --- a/script/calibrate-model-for.qaic/customize.py +++ b/script/calibrate-model-for.qaic/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import sys import yaml diff --git a/script/calibrate-model-for.qaic/_cm.yaml b/script/calibrate-model-for.qaic/meta.yaml similarity index 100% rename from script/calibrate-model-for.qaic/_cm.yaml rename to script/calibrate-model-for.qaic/meta.yaml diff --git a/script/clean-nvidia-mlperf-inference-scratch-space/customize.py b/script/clean-nvidia-mlperf-inference-scratch-space/customize.py index 11d224c59..149fe34e7 100644 --- a/script/clean-nvidia-mlperf-inference-scratch-space/customize.py +++ b/script/clean-nvidia-mlperf-inference-scratch-space/customize.py @@ -1,6 +1,5 @@ -from cmind import utils +from mlc import utils import os -import cmind as cm def preprocess(i): @@ -33,8 +32,8 @@ def preprocess(i): cache_rm_tags = cache_rm_tags + extra_cache_rm_tags if cache_rm_tags: - r = cm.access({'action': 'rm', 'automation': 'cache', - 'tags': cache_rm_tags, 'f': True}) + r = mlc.access({'action': 'rm', 'automation': 'cache', + 'tags': cache_rm_tags, 'f': True}) print(r) if r['return'] != 0 and r['return'] != 16: # ignore missing ones return r diff --git a/script/clean-nvidia-mlperf-inference-scratch-space/_cm.yaml b/script/clean-nvidia-mlperf-inference-scratch-space/meta.yaml similarity index 100% rename from script/clean-nvidia-mlperf-inference-scratch-space/_cm.yaml rename to script/clean-nvidia-mlperf-inference-scratch-space/meta.yaml diff --git a/script/compile-model-for.qaic/customize.py b/script/compile-model-for.qaic/customize.py index 3acf5b5cc..8f9f5717c 100644 --- a/script/compile-model-for.qaic/customize.py +++ b/script/compile-model-for.qaic/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/compile-model-for.qaic/_cm.yaml b/script/compile-model-for.qaic/meta.yaml similarity index 100% rename from script/compile-model-for.qaic/_cm.yaml rename to script/compile-model-for.qaic/meta.yaml diff --git a/script/compile-program/customize.py b/script/compile-program/customize.py index c5e2adabb..9fa65ee54 100644 --- a/script/compile-program/customize.py +++ b/script/compile-program/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/compile-program/_cm.yaml b/script/compile-program/meta.yaml similarity index 100% rename from script/compile-program/_cm.yaml rename to script/compile-program/meta.yaml diff --git a/script/convert-csv-to-md/customize.py b/script/convert-csv-to-md/customize.py index 5e63bcd93..872c2b678 100644 --- a/script/convert-csv-to-md/customize.py +++ b/script/convert-csv-to-md/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/convert-csv-to-md/_cm.yaml b/script/convert-csv-to-md/meta.yaml similarity index 100% rename from script/convert-csv-to-md/_cm.yaml rename to script/convert-csv-to-md/meta.yaml diff --git a/script/convert-ml-model-huggingface-to-onnx/customize.py b/script/convert-ml-model-huggingface-to-onnx/customize.py index 6ef39f0f8..90950b120 100644 --- a/script/convert-ml-model-huggingface-to-onnx/customize.py +++ b/script/convert-ml-model-huggingface-to-onnx/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -13,7 +13,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object path = os.getcwd() diff --git a/script/convert-ml-model-huggingface-to-onnx/_cm.yaml b/script/convert-ml-model-huggingface-to-onnx/meta.yaml similarity index 100% rename from script/convert-ml-model-huggingface-to-onnx/_cm.yaml rename to script/convert-ml-model-huggingface-to-onnx/meta.yaml diff --git a/script/copy-to-clipboard/_cm.yaml b/script/copy-to-clipboard/meta.yaml similarity index 100% rename from script/copy-to-clipboard/_cm.yaml rename to script/copy-to-clipboard/meta.yaml diff --git a/script/create-conda-env/customize.py b/script/create-conda-env/customize.py index c9fd8083b..ddc74fab9 100644 --- a/script/create-conda-env/customize.py +++ b/script/create-conda-env/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/create-conda-env/_cm.yaml b/script/create-conda-env/meta.yaml similarity index 100% rename from script/create-conda-env/_cm.yaml rename to script/create-conda-env/meta.yaml diff --git a/script/create-custom-cache-entry/customize.py b/script/create-custom-cache-entry/customize.py index f15a1e7fd..ce3e0a988 100644 --- a/script/create-custom-cache-entry/customize.py +++ b/script/create-custom-cache-entry/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/create-custom-cache-entry/_cm.yaml b/script/create-custom-cache-entry/meta.yaml similarity index 100% rename from script/create-custom-cache-entry/_cm.yaml rename to script/create-custom-cache-entry/meta.yaml diff --git a/script/create-fpgaconvnet-app-tinyml/customize.py b/script/create-fpgaconvnet-app-tinyml/customize.py index 5c6a448bc..a12f17f36 100644 --- a/script/create-fpgaconvnet-app-tinyml/customize.py +++ b/script/create-fpgaconvnet-app-tinyml/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/create-fpgaconvnet-app-tinyml/_cm.yaml b/script/create-fpgaconvnet-app-tinyml/meta.yaml similarity index 100% rename from script/create-fpgaconvnet-app-tinyml/_cm.yaml rename to script/create-fpgaconvnet-app-tinyml/meta.yaml diff --git a/script/create-fpgaconvnet-config-tinyml/customize.py b/script/create-fpgaconvnet-config-tinyml/customize.py index 6175a2bdd..90ed2d6f0 100644 --- a/script/create-fpgaconvnet-config-tinyml/customize.py +++ b/script/create-fpgaconvnet-config-tinyml/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/create-fpgaconvnet-config-tinyml/_cm.yaml b/script/create-fpgaconvnet-config-tinyml/meta.yaml similarity index 100% rename from script/create-fpgaconvnet-config-tinyml/_cm.yaml rename to script/create-fpgaconvnet-config-tinyml/meta.yaml diff --git a/script/create-patch/customize.py b/script/create-patch/customize.py index 0ebd63b99..14c64623d 100644 --- a/script/create-patch/customize.py +++ b/script/create-patch/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/create-patch/_cm.yaml b/script/create-patch/meta.yaml similarity index 100% rename from script/create-patch/_cm.yaml rename to script/create-patch/meta.yaml diff --git a/script/destroy-terraform/customize.py b/script/destroy-terraform/customize.py index e0bfa63b5..097f3c1a9 100644 --- a/script/destroy-terraform/customize.py +++ b/script/destroy-terraform/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/destroy-terraform/_cm.yaml b/script/destroy-terraform/meta.yaml similarity index 100% rename from script/destroy-terraform/_cm.yaml rename to script/destroy-terraform/meta.yaml diff --git a/script/detect-cpu/customize.py b/script/detect-cpu/customize.py index 2d5dfeeef..cd0c6dc95 100644 --- a/script/detect-cpu/customize.py +++ b/script/detect-cpu/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os lscpu_out = 'tmp-lscpu.out' @@ -21,7 +21,7 @@ def postprocess(i): os_info = i['os_info'] automation = i['automation'] - logger = automation.cmind.logger + logger = automation.action_object.logger if os_info['platform'] == 'windows': sys = [] diff --git a/script/detect-cpu/_cm.yaml b/script/detect-cpu/meta.yaml similarity index 100% rename from script/detect-cpu/_cm.yaml rename to script/detect-cpu/meta.yaml diff --git a/script/detect-os/customize.py b/script/detect-os/customize.py index c5a0b17c1..82ee00d7a 100644 --- a/script/detect-os/customize.py +++ b/script/detect-os/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess diff --git a/script/detect-os/_cm.yaml b/script/detect-os/meta.yaml similarity index 100% rename from script/detect-os/_cm.yaml rename to script/detect-os/meta.yaml diff --git a/script/detect-sudo/customize.py b/script/detect-sudo/customize.py index e14d2983c..bc5e92296 100644 --- a/script/detect-sudo/customize.py +++ b/script/detect-sudo/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess import select diff --git a/script/detect-sudo/_cm.yaml b/script/detect-sudo/meta.yaml similarity index 100% rename from script/detect-sudo/_cm.yaml rename to script/detect-sudo/meta.yaml diff --git a/script/download-and-extract/customize.py b/script/download-and-extract/customize.py index b3c570dbc..32cac6476 100644 --- a/script/download-and-extract/customize.py +++ b/script/download-and-extract/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import hashlib diff --git a/script/download-and-extract/_cm.yaml b/script/download-and-extract/meta.yaml similarity index 100% rename from script/download-and-extract/_cm.yaml rename to script/download-and-extract/meta.yaml diff --git a/script/download-file/customize.py b/script/download-file/customize.py index 6142c48a9..fc237635c 100644 --- a/script/download-file/customize.py +++ b/script/download-file/customize.py @@ -1,6 +1,7 @@ -from cmind import utils +from mlc import utils import os import subprocess +from utils import * def escape_special_chars(text, tool=None): @@ -167,12 +168,11 @@ def preprocess(i): cmutil_require_download = 1 if cmutil_require_download == 1: - cm = automation.cmind + cm = automation.action_object for i in range(1, 5): - r = cm.access({'action': 'download_file', - 'automation': 'utils,dc2743f8450541e3', - 'url': url, - 'verify': verify_ssl}) + r = download_file({ + 'url': url, + 'verify': verify_ssl}) if r['return'] == 0: break oldurl = url diff --git a/script/download-file/_cm.yaml b/script/download-file/meta.yaml similarity index 100% rename from script/download-file/_cm.yaml rename to script/download-file/meta.yaml diff --git a/script/download-torrent/customize.py b/script/download-torrent/customize.py index 3b4cb4c41..e194e7ff7 100644 --- a/script/download-torrent/customize.py +++ b/script/download-torrent/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/download-torrent/_cm.yaml b/script/download-torrent/meta.yaml similarity index 100% rename from script/download-torrent/_cm.yaml rename to script/download-torrent/meta.yaml diff --git a/script/draw-graph-from-json-data/customize.py b/script/draw-graph-from-json-data/customize.py index db1f64b1f..8fafad78f 100644 --- a/script/draw-graph-from-json-data/customize.py +++ b/script/draw-graph-from-json-data/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/draw-graph-from-json-data/_cm.yaml b/script/draw-graph-from-json-data/meta.yaml similarity index 100% rename from script/draw-graph-from-json-data/_cm.yaml rename to script/draw-graph-from-json-data/meta.yaml diff --git a/script/dump-pip-freeze/customize.py b/script/dump-pip-freeze/customize.py index e9e6ce6b7..9c2940d1e 100644 --- a/script/dump-pip-freeze/customize.py +++ b/script/dump-pip-freeze/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -36,10 +36,10 @@ def postprocess(i): # If was not created, sometimes issues on Windows # There is another workaround if os_info['platform'] == 'windows': - r = automation.cmind.access({'action': 'system', - 'automation': 'utils', - 'cmd': 'py -m pip freeze', - 'stdout': pip_freeze_file}) + r = automation.action_object.access({'action': 'system', + 'automation': 'utils', + 'cmd': 'py -m pip freeze', + 'stdout': pip_freeze_file}) # skip output if os.path.isfile(pip_freeze_file): diff --git a/script/dump-pip-freeze/_cm.yaml b/script/dump-pip-freeze/meta.yaml similarity index 100% rename from script/dump-pip-freeze/_cm.yaml rename to script/dump-pip-freeze/meta.yaml diff --git a/script/extract-file/customize.py b/script/extract-file/customize.py index dd0394189..f4489105d 100644 --- a/script/extract-file/customize.py +++ b/script/extract-file/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import hashlib diff --git a/script/extract-file/_cm.yaml b/script/extract-file/meta.yaml similarity index 100% rename from script/extract-file/_cm.yaml rename to script/extract-file/meta.yaml diff --git a/script/fail/customize.py b/script/fail/customize.py index 4168a3b7a..69ccec77e 100644 --- a/script/fail/customize.py +++ b/script/fail/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/fail/_cm.yaml b/script/fail/meta.yaml similarity index 100% rename from script/fail/_cm.yaml rename to script/fail/meta.yaml diff --git a/script/flash-tinyml-binary/customize.py b/script/flash-tinyml-binary/customize.py index bc0c3bd18..ab0d7e5a3 100644 --- a/script/flash-tinyml-binary/customize.py +++ b/script/flash-tinyml-binary/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/flash-tinyml-binary/_cm.yaml b/script/flash-tinyml-binary/meta.yaml similarity index 100% rename from script/flash-tinyml-binary/_cm.yaml rename to script/flash-tinyml-binary/meta.yaml diff --git a/script/generate-mlperf-inference-submission/customize.py b/script/generate-mlperf-inference-submission/customize.py index d3ab67a2b..a6f5167aa 100644 --- a/script/generate-mlperf-inference-submission/customize.py +++ b/script/generate-mlperf-inference-submission/customize.py @@ -1,8 +1,8 @@ -from cmind import utils +from mlc import utils import os import json import shutil -import cmind +import mlc import sys from tabulate import tabulate import mlperf_utils @@ -203,19 +203,19 @@ def generate_submission(env, state, inp, submission_division): # check whether the root folder contains the sut infos # if yes then there is no need to check for meta files inside # individual model folders - if "cm-sut-info.json" in os.listdir(result_path): + if "mlc-sut-info.json" in os.listdir(result_path): sut_info = fill_from_json( os.path.join( result_path, - "cm-sut-info.json"), + "mlc-sut-info.json"), sut_info.keys(), sut_info) if sut_info == -1: return { - 'return': 1, 'error': f"key value mismatch. Refer the populating dictionary:\n{sut_info}\n and file {os.path.join(result_path, 'cm-sut-info.json')}"} + 'return': 1, 'error': f"key value mismatch. Refer the populating dictionary:\n{sut_info}\n and file {os.path.join(result_path, 'mlc-sut-info.json')}"} if check_dict_filled(sut_info.keys(), sut_info): print( - f"sut info completely filled from {os.path.join(result_path, 'cm-sut-info.json')}!") + f"sut info completely filled from {os.path.join(result_path, 'mlc-sut-info.json')}!") # Check whether the root folder contains the model mapping file # expects json file in the format: @@ -597,7 +597,7 @@ def generate_submission(env, state, inp, submission_division): files.append(f) elif f == "spl.txt": files.append(f) - elif f in ["README.md", "README-extra.md", "cm-version-info.json", "os_info.json", "cpu_info.json", "pip_freeze.json", "system_info.txt", "cm-deps.png", "cm-deps.mmd"] and mode == "performance": + elif f in ["README.md", "README-extra.md", "mlc-version-info.json", "os_info.json", "cpu_info.json", "pip_freeze.json", "system_info.txt", "mlc-deps.png", "mlc-deps.mmd"] and mode == "performance": shutil.copy( os.path.join( result_mode_path, f), os.path.join( @@ -694,13 +694,13 @@ def generate_submission(env, state, inp, submission_division): "system_info.txt")) else: if env.get('CM_GET_PLATFORM_DETAILS', '') == "yes": - cm_input = {'action': 'run', - 'automation': 'script', - 'tags': 'get,platform,details', - 'env': {'CM_PLATFORM_DETAILS_FILE_PATH': os.path.join(measurement_path, "system_info.txt")}, - 'quiet': True - } - r = cmind.access(cm_input) + mlc_input = {'action': 'run', + 'automation': 'script', + 'tags': 'get,platform,details', + 'env': {'CM_PLATFORM_DETAILS_FILE_PATH': os.path.join(measurement_path, "system_info.txt")}, + 'quiet': True + } + r = mlc.access(mlc_input) if r['return'] > 0: return r diff --git a/script/generate-mlperf-inference-submission/_cm.yaml b/script/generate-mlperf-inference-submission/meta.yaml similarity index 100% rename from script/generate-mlperf-inference-submission/_cm.yaml rename to script/generate-mlperf-inference-submission/meta.yaml diff --git a/script/generate-mlperf-inference-user-conf/customize.py b/script/generate-mlperf-inference-user-conf/customize.py index 1972092fd..88255718c 100644 --- a/script/generate-mlperf-inference-user-conf/customize.py +++ b/script/generate-mlperf-inference-user-conf/customize.py @@ -1,9 +1,8 @@ -from cmind import utils +from mlc import utils import os import json import shutil import subprocess -import cmind as cm import sys diff --git a/script/generate-mlperf-inference-user-conf/_cm.yaml b/script/generate-mlperf-inference-user-conf/meta.yaml similarity index 100% rename from script/generate-mlperf-inference-user-conf/_cm.yaml rename to script/generate-mlperf-inference-user-conf/meta.yaml diff --git a/script/generate-mlperf-tiny-report/customize.py b/script/generate-mlperf-tiny-report/customize.py index 03fdf1c3d..6efd29616 100644 --- a/script/generate-mlperf-tiny-report/customize.py +++ b/script/generate-mlperf-tiny-report/customize.py @@ -1,5 +1,4 @@ -import cmind as cm -from cmind import utils +from mlc import utils import os import subprocess @@ -17,9 +16,9 @@ def preprocess(i): env_repo_tags = env.get('CM_IMPORT_TINYMLPERF_REPO_TAGS', '').strip() xtags = '' if env_repo_tags == '' else ',version-' + env_repo_tags - r = cm.access({'action': 'find', + r = mlc.access({'action': 'find', 'automation': 'cache,541d6f712a6b464e', - 'tags': 'get,repo,mlperf-tiny-results' + xtags}) + 'tags': 'get,repo,mlperf-tiny-results' + xtags}) if r['return'] > 0: return r diff --git a/script/generate-mlperf-tiny-report/_cm.yaml b/script/generate-mlperf-tiny-report/meta.yaml similarity index 100% rename from script/generate-mlperf-tiny-report/_cm.yaml rename to script/generate-mlperf-tiny-report/meta.yaml diff --git a/script/generate-mlperf-tiny-submission/customize.py b/script/generate-mlperf-tiny-submission/customize.py index 75bd43832..45e7f2d84 100644 --- a/script/generate-mlperf-tiny-submission/customize.py +++ b/script/generate-mlperf-tiny-submission/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json import shutil diff --git a/script/generate-mlperf-tiny-submission/_cm.yaml b/script/generate-mlperf-tiny-submission/meta.yaml similarity index 100% rename from script/generate-mlperf-tiny-submission/_cm.yaml rename to script/generate-mlperf-tiny-submission/meta.yaml diff --git a/script/generate-nvidia-engine/customize.py b/script/generate-nvidia-engine/customize.py index efa6eb7e6..832e32e6c 100644 --- a/script/generate-nvidia-engine/customize.py +++ b/script/generate-nvidia-engine/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/generate-nvidia-engine/_cm.yaml b/script/generate-nvidia-engine/meta.yaml similarity index 100% rename from script/generate-nvidia-engine/_cm.yaml rename to script/generate-nvidia-engine/meta.yaml diff --git a/script/get-android-sdk/customize.py b/script/get-android-sdk/customize.py index 85b190bb1..c1f7aea5d 100644 --- a/script/get-android-sdk/customize.py +++ b/script/get-android-sdk/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -78,7 +78,7 @@ def preprocess(i): print('') print('Downloading from {} ...'.format(package_url)) - cm = automation.cmind + cm = automation.action_object r = cm.access({'action': 'download_file', 'automation': 'utils,dc2743f8450541e3', diff --git a/script/get-android-sdk/_cm.yaml b/script/get-android-sdk/meta.yaml similarity index 100% rename from script/get-android-sdk/_cm.yaml rename to script/get-android-sdk/meta.yaml diff --git a/script/get-aocl/customize.py b/script/get-aocl/customize.py index 285ed97e6..67b95ed28 100644 --- a/script/get-aocl/customize.py +++ b/script/get-aocl/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-aocl/_cm.yaml b/script/get-aocl/meta.yaml similarity index 100% rename from script/get-aocl/_cm.yaml rename to script/get-aocl/meta.yaml diff --git a/script/get-aria2/customize.py b/script/get-aria2/customize.py index b7198b30b..c45449430 100644 --- a/script/get-aria2/customize.py +++ b/script/get-aria2/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-aria2/_cm.yaml b/script/get-aria2/meta.yaml similarity index 100% rename from script/get-aria2/_cm.yaml rename to script/get-aria2/meta.yaml diff --git a/script/get-aws-cli/customize.py b/script/get-aws-cli/customize.py index 9376577a1..281127a9b 100644 --- a/script/get-aws-cli/customize.py +++ b/script/get-aws-cli/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-aws-cli/_cm.yaml b/script/get-aws-cli/meta.yaml similarity index 100% rename from script/get-aws-cli/_cm.yaml rename to script/get-aws-cli/meta.yaml diff --git a/script/get-bazel/customize.py b/script/get-bazel/customize.py index 39ac03e64..416a20477 100644 --- a/script/get-bazel/customize.py +++ b/script/get-bazel/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-bazel/_cm.yaml b/script/get-bazel/meta.yaml similarity index 100% rename from script/get-bazel/_cm.yaml rename to script/get-bazel/meta.yaml diff --git a/script/get-blis/customize.py b/script/get-blis/customize.py index 0582e4bd2..3bfe968fc 100644 --- a/script/get-blis/customize.py +++ b/script/get-blis/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-blis/_cm.yaml b/script/get-blis/meta.yaml similarity index 100% rename from script/get-blis/_cm.yaml rename to script/get-blis/meta.yaml diff --git a/script/get-brew/_cm.yaml b/script/get-brew/meta.yaml similarity index 100% rename from script/get-brew/_cm.yaml rename to script/get-brew/meta.yaml diff --git a/script/get-cache-dir/customize.py b/script/get-cache-dir/customize.py index d1a3edd74..bd5bd1468 100644 --- a/script/get-cache-dir/customize.py +++ b/script/get-cache-dir/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-cache-dir/_cm.yaml b/script/get-cache-dir/meta.yaml similarity index 100% rename from script/get-cache-dir/_cm.yaml rename to script/get-cache-dir/meta.yaml diff --git a/script/get-ck/_cm.yaml b/script/get-ck/meta.yaml similarity index 100% rename from script/get-ck/_cm.yaml rename to script/get-ck/meta.yaml diff --git a/script/get-cl/customize.py b/script/get-cl/customize.py index e36b2c674..2bae685a2 100644 --- a/script/get-cl/customize.py +++ b/script/get-cl/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-cl/_cm.yaml b/script/get-cl/meta.yaml similarity index 100% rename from script/get-cl/_cm.yaml rename to script/get-cl/meta.yaml diff --git a/script/get-cmake/customize.py b/script/get-cmake/customize.py index cea759b2e..b0201bed6 100644 --- a/script/get-cmake/customize.py +++ b/script/get-cmake/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-cmake/_cm.yaml b/script/get-cmake/meta.yaml similarity index 100% rename from script/get-cmake/_cm.yaml rename to script/get-cmake/meta.yaml diff --git a/script/get-cmsis_5/customize.py b/script/get-cmsis_5/customize.py index 9f9ebc556..e5fac8d7e 100644 --- a/script/get-cmsis_5/customize.py +++ b/script/get-cmsis_5/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-cmsis_5/_cm.yaml b/script/get-cmsis_5/meta.yaml similarity index 100% rename from script/get-cmsis_5/_cm.yaml rename to script/get-cmsis_5/meta.yaml diff --git a/script/get-compiler-flags/customize.py b/script/get-compiler-flags/customize.py index e9fc57301..dd7ee775a 100644 --- a/script/get-compiler-flags/customize.py +++ b/script/get-compiler-flags/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess diff --git a/script/get-compiler-flags/_cm.yaml b/script/get-compiler-flags/meta.yaml similarity index 100% rename from script/get-compiler-flags/_cm.yaml rename to script/get-compiler-flags/meta.yaml diff --git a/script/get-compiler-rust/customize.py b/script/get-compiler-rust/customize.py index 2a1b202f8..01bf84b37 100644 --- a/script/get-compiler-rust/customize.py +++ b/script/get-compiler-rust/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-compiler-rust/_cm.yaml b/script/get-compiler-rust/meta.yaml similarity index 100% rename from script/get-compiler-rust/_cm.yaml rename to script/get-compiler-rust/meta.yaml diff --git a/script/get-conda/customize.py b/script/get-conda/customize.py index 7e9cd9236..3c44af161 100644 --- a/script/get-conda/customize.py +++ b/script/get-conda/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-conda/_cm.yaml b/script/get-conda/meta.yaml similarity index 100% rename from script/get-conda/_cm.yaml rename to script/get-conda/meta.yaml diff --git a/script/get-croissant/customize.py b/script/get-croissant/customize.py index afa821465..344ee1d4b 100644 --- a/script/get-croissant/customize.py +++ b/script/get-croissant/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-croissant/_cm.yaml b/script/get-croissant/meta.yaml similarity index 100% rename from script/get-croissant/_cm.yaml rename to script/get-croissant/meta.yaml diff --git a/script/get-cuda-devices/customize.py b/script/get-cuda-devices/customize.py index ba66b8904..26969185d 100644 --- a/script/get-cuda-devices/customize.py +++ b/script/get-cuda-devices/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess diff --git a/script/get-cuda-devices/_cm.yaml b/script/get-cuda-devices/meta.yaml similarity index 100% rename from script/get-cuda-devices/_cm.yaml rename to script/get-cuda-devices/meta.yaml diff --git a/script/get-cuda/customize.py b/script/get-cuda/customize.py index 925e1e8b9..c8a68c4a7 100644 --- a/script/get-cuda/customize.py +++ b/script/get-cuda/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json diff --git a/script/get-cuda/_cm.yaml b/script/get-cuda/meta.yaml similarity index 100% rename from script/get-cuda/_cm.yaml rename to script/get-cuda/meta.yaml diff --git a/script/get-cudnn/customize.py b/script/get-cudnn/customize.py index 7d6984cbe..ed64cd241 100644 --- a/script/get-cudnn/customize.py +++ b/script/get-cudnn/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import tarfile import shutil diff --git a/script/get-cudnn/_cm.yaml b/script/get-cudnn/meta.yaml similarity index 100% rename from script/get-cudnn/_cm.yaml rename to script/get-cudnn/meta.yaml diff --git a/script/get-dataset-cifar10/customize.py b/script/get-dataset-cifar10/customize.py index d000dc407..4ceebf821 100644 --- a/script/get-dataset-cifar10/customize.py +++ b/script/get-dataset-cifar10/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dataset-cifar10/_cm.yaml b/script/get-dataset-cifar10/meta.yaml similarity index 100% rename from script/get-dataset-cifar10/_cm.yaml rename to script/get-dataset-cifar10/meta.yaml diff --git a/script/get-dataset-cnndm/customize.py b/script/get-dataset-cnndm/customize.py index 25966d850..a6cf2d476 100644 --- a/script/get-dataset-cnndm/customize.py +++ b/script/get-dataset-cnndm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dataset-cnndm/_cm.yaml b/script/get-dataset-cnndm/meta.yaml similarity index 100% rename from script/get-dataset-cnndm/_cm.yaml rename to script/get-dataset-cnndm/meta.yaml diff --git a/script/get-dataset-coco/customize.py b/script/get-dataset-coco/customize.py index 60e4a3ae9..b7ee135ee 100644 --- a/script/get-dataset-coco/customize.py +++ b/script/get-dataset-coco/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dataset-coco/_cm.yaml b/script/get-dataset-coco/meta.yaml similarity index 100% rename from script/get-dataset-coco/_cm.yaml rename to script/get-dataset-coco/meta.yaml diff --git a/script/get-dataset-coco2014/customize.py b/script/get-dataset-coco2014/customize.py index 3f80e76f0..90a502219 100644 --- a/script/get-dataset-coco2014/customize.py +++ b/script/get-dataset-coco2014/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dataset-coco2014/_cm.yaml b/script/get-dataset-coco2014/meta.yaml similarity index 100% rename from script/get-dataset-coco2014/_cm.yaml rename to script/get-dataset-coco2014/meta.yaml diff --git a/script/get-dataset-cognata-mlcommons/customize.py b/script/get-dataset-cognata-mlcommons/customize.py index d4791c60a..471a44cbc 100644 --- a/script/get-dataset-cognata-mlcommons/customize.py +++ b/script/get-dataset-cognata-mlcommons/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json @@ -9,7 +9,12 @@ def preprocess(i): cm_cache_dataset_path = env.get( 'CM_CUSTOM_CACHE_ENTRY_DATASET_MLCOMMONS_COGNATA_PATH', '').strip() - cfg = utils.safe_load_json(cm_cache_dataset_path, 'cfg.json')['meta'] + + res = utils.load_json( + os.path.join( + cm_cache_dataset_path, + 'cfg.json')) + cfg = res.get('meta', {}) if cfg.get('imported', False): env['CM_DATASET_MLCOMMONS_COGNATA_IMPORTED'] = 'yes' @@ -56,7 +61,7 @@ def postprocess(i): env = i['env'] automation = i['automation'] - cm = automation.cmind + mlc = automation.action_object cur_dir = os.getcwd() @@ -78,7 +83,8 @@ def postprocess(i): cm_cache_dataset_cfg_file = os.path.join(cm_cache_dataset_path, 'cfg.json') env['CM_DATASET_MLCOMMONS_COGNATA_CFG_FILE'] = cm_cache_dataset_cfg_file - cfg = utils.safe_load_json('', cm_cache_dataset_cfg_file)['meta'] + res = utils.load_json(cm_cache_dataset_cfg_file) + cfg = res.get('meta', {}) dataset_path = cfg.get('real_path', '') dataset_path_requested = env.get('CM_DATASET_MLCOMMONS_COGNATA_PATH', '') @@ -172,13 +178,13 @@ def postprocess(i): return { 'return': 1, 'error': 'can\'t parse URL for export: {}'.format(first_url)} - r = cm.access({'action': 'run', + r = mlc.access({'action': 'run', 'automation': 'script', - 'tags': 'download,file,_wget', - 'verify': 'no', - 'url': first_url_export, - 'output_file': file_first_xlsx, - 'store': dataset_path1}) + 'tags': 'download,file,_wget', + 'verify': 'no', + 'url': first_url_export, + 'output_file': file_first_xlsx, + 'store': dataset_path1}) if r['return'] > 0: return r @@ -248,13 +254,13 @@ def postprocess(i): print('') print('Downloading {} ...'.format(url_export)) - r = cm.access({'action': 'run', + r = mlc.access({'action': 'run', 'automation': 'script', - 'tags': 'download,file,_wget', - 'verify': 'no', - 'url': url_export, - 'output_file': serial_file, - 'store': dataset_path1}) + 'tags': 'download,file,_wget', + 'verify': 'no', + 'url': url_export, + 'output_file': serial_file, + 'store': dataset_path1}) if r['return'] > 0: return r diff --git a/script/get-dataset-cognata-mlcommons/_cm.yaml b/script/get-dataset-cognata-mlcommons/meta.yaml similarity index 100% rename from script/get-dataset-cognata-mlcommons/_cm.yaml rename to script/get-dataset-cognata-mlcommons/meta.yaml diff --git a/script/get-dataset-criteo/_cm.yaml b/script/get-dataset-criteo/meta.yaml similarity index 100% rename from script/get-dataset-criteo/_cm.yaml rename to script/get-dataset-criteo/meta.yaml diff --git a/script/get-dataset-igbh/customize.py b/script/get-dataset-igbh/customize.py index de85bd900..c454d415d 100644 --- a/script/get-dataset-igbh/customize.py +++ b/script/get-dataset-igbh/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-igbh/_cm.yaml b/script/get-dataset-igbh/meta.yaml similarity index 100% rename from script/get-dataset-igbh/_cm.yaml rename to script/get-dataset-igbh/meta.yaml diff --git a/script/get-dataset-imagenet-aux/_cm.yaml b/script/get-dataset-imagenet-aux/meta.yaml similarity index 100% rename from script/get-dataset-imagenet-aux/_cm.yaml rename to script/get-dataset-imagenet-aux/meta.yaml diff --git a/script/get-dataset-imagenet-calibration/_cm.yaml b/script/get-dataset-imagenet-calibration/meta.yaml similarity index 100% rename from script/get-dataset-imagenet-calibration/_cm.yaml rename to script/get-dataset-imagenet-calibration/meta.yaml diff --git a/script/get-dataset-imagenet-helper/customize.py b/script/get-dataset-imagenet-helper/customize.py index b9dd841f5..911411db4 100644 --- a/script/get-dataset-imagenet-helper/customize.py +++ b/script/get-dataset-imagenet-helper/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-imagenet-helper/_cm.yaml b/script/get-dataset-imagenet-helper/meta.yaml similarity index 100% rename from script/get-dataset-imagenet-helper/_cm.yaml rename to script/get-dataset-imagenet-helper/meta.yaml diff --git a/script/get-dataset-imagenet-train/customize.py b/script/get-dataset-imagenet-train/customize.py index b1f8aea1e..5a760c895 100644 --- a/script/get-dataset-imagenet-train/customize.py +++ b/script/get-dataset-imagenet-train/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-imagenet-train/_cm.yaml b/script/get-dataset-imagenet-train/meta.yaml similarity index 100% rename from script/get-dataset-imagenet-train/_cm.yaml rename to script/get-dataset-imagenet-train/meta.yaml diff --git a/script/get-dataset-imagenet-val/customize.py b/script/get-dataset-imagenet-val/customize.py index 2f3243735..e11648adf 100644 --- a/script/get-dataset-imagenet-val/customize.py +++ b/script/get-dataset-imagenet-val/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-imagenet-val/_cm.yaml b/script/get-dataset-imagenet-val/meta.yaml similarity index 100% rename from script/get-dataset-imagenet-val/_cm.yaml rename to script/get-dataset-imagenet-val/meta.yaml diff --git a/script/get-dataset-kits19/customize.py b/script/get-dataset-kits19/customize.py index bf5462d9b..5f95125c0 100644 --- a/script/get-dataset-kits19/customize.py +++ b/script/get-dataset-kits19/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dataset-kits19/_cm.yaml b/script/get-dataset-kits19/meta.yaml similarity index 100% rename from script/get-dataset-kits19/_cm.yaml rename to script/get-dataset-kits19/meta.yaml diff --git a/script/get-dataset-librispeech/customize.py b/script/get-dataset-librispeech/customize.py index 0da64539e..969b4b4ad 100644 --- a/script/get-dataset-librispeech/customize.py +++ b/script/get-dataset-librispeech/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-librispeech/_cm.yaml b/script/get-dataset-librispeech/meta.yaml similarity index 100% rename from script/get-dataset-librispeech/_cm.yaml rename to script/get-dataset-librispeech/meta.yaml diff --git a/script/get-dataset-mlperf-inference-llama3/customize.py b/script/get-dataset-mlperf-inference-llama3/customize.py index 745dc52fe..827dcd2cd 100644 --- a/script/get-dataset-mlperf-inference-llama3/customize.py +++ b/script/get-dataset-mlperf-inference-llama3/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-mlperf-inference-llama3/_cm.yaml b/script/get-dataset-mlperf-inference-llama3/meta.yaml similarity index 100% rename from script/get-dataset-mlperf-inference-llama3/_cm.yaml rename to script/get-dataset-mlperf-inference-llama3/meta.yaml diff --git a/script/get-dataset-mlperf-inference-mixtral/customize.py b/script/get-dataset-mlperf-inference-mixtral/customize.py index 38825cfdb..dc46a6661 100644 --- a/script/get-dataset-mlperf-inference-mixtral/customize.py +++ b/script/get-dataset-mlperf-inference-mixtral/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-mlperf-inference-mixtral/_cm.yaml b/script/get-dataset-mlperf-inference-mixtral/meta.yaml similarity index 100% rename from script/get-dataset-mlperf-inference-mixtral/_cm.yaml rename to script/get-dataset-mlperf-inference-mixtral/meta.yaml diff --git a/script/get-dataset-openimages-annotations/customize.py b/script/get-dataset-openimages-annotations/customize.py index f42ee200d..286ba3fa8 100644 --- a/script/get-dataset-openimages-annotations/customize.py +++ b/script/get-dataset-openimages-annotations/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-openimages-annotations/_cm.yaml b/script/get-dataset-openimages-annotations/meta.yaml similarity index 100% rename from script/get-dataset-openimages-annotations/_cm.yaml rename to script/get-dataset-openimages-annotations/meta.yaml diff --git a/script/get-dataset-openimages-calibration/customize.py b/script/get-dataset-openimages-calibration/customize.py index 032065bc8..5fc459075 100644 --- a/script/get-dataset-openimages-calibration/customize.py +++ b/script/get-dataset-openimages-calibration/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-openimages-calibration/_cm.yaml b/script/get-dataset-openimages-calibration/meta.yaml similarity index 100% rename from script/get-dataset-openimages-calibration/_cm.yaml rename to script/get-dataset-openimages-calibration/meta.yaml diff --git a/script/get-dataset-openimages/customize.py b/script/get-dataset-openimages/customize.py index ae53a85f5..0f68a45c2 100644 --- a/script/get-dataset-openimages/customize.py +++ b/script/get-dataset-openimages/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dataset-openimages/_cm.yaml b/script/get-dataset-openimages/meta.yaml similarity index 100% rename from script/get-dataset-openimages/_cm.yaml rename to script/get-dataset-openimages/meta.yaml diff --git a/script/get-dataset-openorca/customize.py b/script/get-dataset-openorca/customize.py index db4c116ea..6daca4bf6 100644 --- a/script/get-dataset-openorca/customize.py +++ b/script/get-dataset-openorca/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dataset-openorca/_cm.yaml b/script/get-dataset-openorca/meta.yaml similarity index 100% rename from script/get-dataset-openorca/_cm.yaml rename to script/get-dataset-openorca/meta.yaml diff --git a/script/get-dataset-squad-vocab/customize.py b/script/get-dataset-squad-vocab/customize.py index 40d3c5dd5..538250b19 100644 --- a/script/get-dataset-squad-vocab/customize.py +++ b/script/get-dataset-squad-vocab/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-squad-vocab/_cm.yaml b/script/get-dataset-squad-vocab/meta.yaml similarity index 100% rename from script/get-dataset-squad-vocab/_cm.yaml rename to script/get-dataset-squad-vocab/meta.yaml diff --git a/script/get-dataset-squad/customize.py b/script/get-dataset-squad/customize.py index 3af4c8553..c372a75d8 100644 --- a/script/get-dataset-squad/customize.py +++ b/script/get-dataset-squad/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dataset-squad/_cm.yaml b/script/get-dataset-squad/meta.yaml similarity index 100% rename from script/get-dataset-squad/_cm.yaml rename to script/get-dataset-squad/meta.yaml diff --git a/script/get-dlrm-data-mlperf-inference/customize.py b/script/get-dlrm-data-mlperf-inference/customize.py index ebec12749..2684d2594 100644 --- a/script/get-dlrm-data-mlperf-inference/customize.py +++ b/script/get-dlrm-data-mlperf-inference/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-dlrm-data-mlperf-inference/_cm.yaml b/script/get-dlrm-data-mlperf-inference/meta.yaml similarity index 100% rename from script/get-dlrm-data-mlperf-inference/_cm.yaml rename to script/get-dlrm-data-mlperf-inference/meta.yaml diff --git a/script/get-dlrm/customize.py b/script/get-dlrm/customize.py index 561545c67..e7c634f3c 100644 --- a/script/get-dlrm/customize.py +++ b/script/get-dlrm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-dlrm/_cm.yaml b/script/get-dlrm/meta.yaml similarity index 100% rename from script/get-dlrm/_cm.yaml rename to script/get-dlrm/meta.yaml diff --git a/script/get-docker/customize.py b/script/get-docker/customize.py index fbf0a5bbf..08975cf52 100644 --- a/script/get-docker/customize.py +++ b/script/get-docker/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-docker/_cm.yaml b/script/get-docker/meta.yaml similarity index 100% rename from script/get-docker/_cm.yaml rename to script/get-docker/meta.yaml diff --git a/script/get-gcc/customize.py b/script/get-gcc/customize.py index 9dc79c3ee..2b8b33cc4 100644 --- a/script/get-gcc/customize.py +++ b/script/get-gcc/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-gcc/_cm.yaml b/script/get-gcc/meta.yaml similarity index 100% rename from script/get-gcc/_cm.yaml rename to script/get-gcc/meta.yaml diff --git a/script/get-generic-python-lib/customize.py b/script/get-generic-python-lib/customize.py index 57f25127f..2b259feca 100644 --- a/script/get-generic-python-lib/customize.py +++ b/script/get-generic-python-lib/customize.py @@ -1,6 +1,5 @@ -from cmind import utils +from mlc import utils import os -import cmind as cm def preprocess(i): diff --git a/script/get-generic-python-lib/_cm.yaml b/script/get-generic-python-lib/meta.yaml similarity index 100% rename from script/get-generic-python-lib/_cm.yaml rename to script/get-generic-python-lib/meta.yaml diff --git a/script/get-generic-sys-util/customize.py b/script/get-generic-sys-util/customize.py index 18f85a750..81f2bf76b 100644 --- a/script/get-generic-sys-util/customize.py +++ b/script/get-generic-sys-util/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import re diff --git a/script/get-generic-sys-util/_cm.yaml b/script/get-generic-sys-util/meta.yaml similarity index 100% rename from script/get-generic-sys-util/_cm.yaml rename to script/get-generic-sys-util/meta.yaml diff --git a/script/get-gh-actions-runner/customize.py b/script/get-gh-actions-runner/customize.py index ea87909ae..5fa54e71f 100644 --- a/script/get-gh-actions-runner/customize.py +++ b/script/get-gh-actions-runner/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import cmind as cm diff --git a/script/get-gh-actions-runner/_cm.yaml b/script/get-gh-actions-runner/meta.yaml similarity index 100% rename from script/get-gh-actions-runner/_cm.yaml rename to script/get-gh-actions-runner/meta.yaml diff --git a/script/get-git-repo/customize.py b/script/get-git-repo/customize.py index a4bf81720..603340e47 100644 --- a/script/get-git-repo/customize.py +++ b/script/get-git-repo/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-git-repo/_cm.yaml b/script/get-git-repo/meta.yaml similarity index 100% rename from script/get-git-repo/_cm.yaml rename to script/get-git-repo/meta.yaml diff --git a/script/get-github-cli/customize.py b/script/get-github-cli/customize.py index b69878bf0..bf6a19089 100644 --- a/script/get-github-cli/customize.py +++ b/script/get-github-cli/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-github-cli/_cm.yaml b/script/get-github-cli/meta.yaml similarity index 100% rename from script/get-github-cli/_cm.yaml rename to script/get-github-cli/meta.yaml diff --git a/script/get-go/customize.py b/script/get-go/customize.py index c343442f7..b3ccee3cc 100644 --- a/script/get-go/customize.py +++ b/script/get-go/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-go/_cm.yaml b/script/get-go/meta.yaml similarity index 100% rename from script/get-go/_cm.yaml rename to script/get-go/meta.yaml diff --git a/script/get-google-saxml/customize.py b/script/get-google-saxml/customize.py index 983d681f4..a2acfde43 100644 --- a/script/get-google-saxml/customize.py +++ b/script/get-google-saxml/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-google-saxml/_cm.yaml b/script/get-google-saxml/meta.yaml similarity index 100% rename from script/get-google-saxml/_cm.yaml rename to script/get-google-saxml/meta.yaml diff --git a/script/get-google-test/customize.py b/script/get-google-test/customize.py index 67cbf331d..a22c59349 100644 --- a/script/get-google-test/customize.py +++ b/script/get-google-test/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-google-test/_cm.yaml b/script/get-google-test/meta.yaml similarity index 100% rename from script/get-google-test/_cm.yaml rename to script/get-google-test/meta.yaml diff --git a/script/get-huggingface-cli/customize.py b/script/get-huggingface-cli/customize.py index d9e63e42c..56fcb0761 100644 --- a/script/get-huggingface-cli/customize.py +++ b/script/get-huggingface-cli/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-huggingface-cli/_cm.yaml b/script/get-huggingface-cli/meta.yaml similarity index 100% rename from script/get-huggingface-cli/_cm.yaml rename to script/get-huggingface-cli/meta.yaml diff --git a/script/get-ipol-src/customize.py b/script/get-ipol-src/customize.py index 3fb3504f6..9291872cf 100644 --- a/script/get-ipol-src/customize.py +++ b/script/get-ipol-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -12,7 +12,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object path = os.getcwd() diff --git a/script/get-ipol-src/_cm.yaml b/script/get-ipol-src/meta.yaml similarity index 100% rename from script/get-ipol-src/_cm.yaml rename to script/get-ipol-src/meta.yaml diff --git a/script/get-java/customize.py b/script/get-java/customize.py index e103ac4ff..b82010d8d 100644 --- a/script/get-java/customize.py +++ b/script/get-java/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-java/_cm.yaml b/script/get-java/meta.yaml similarity index 100% rename from script/get-java/_cm.yaml rename to script/get-java/meta.yaml diff --git a/script/get-javac/customize.py b/script/get-javac/customize.py index a5a97c62d..4a1aa03f9 100644 --- a/script/get-javac/customize.py +++ b/script/get-javac/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-javac/_cm.yaml b/script/get-javac/meta.yaml similarity index 100% rename from script/get-javac/_cm.yaml rename to script/get-javac/meta.yaml diff --git a/script/get-lib-armnn/customize.py b/script/get-lib-armnn/customize.py index 4fe934f3b..c365543c7 100644 --- a/script/get-lib-armnn/customize.py +++ b/script/get-lib-armnn/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-lib-armnn/_cm.yaml b/script/get-lib-armnn/meta.yaml similarity index 100% rename from script/get-lib-armnn/_cm.yaml rename to script/get-lib-armnn/meta.yaml diff --git a/script/get-lib-dnnl/customize.py b/script/get-lib-dnnl/customize.py index 8b834eb29..051595167 100644 --- a/script/get-lib-dnnl/customize.py +++ b/script/get-lib-dnnl/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-lib-dnnl/_cm.yaml b/script/get-lib-dnnl/meta.yaml similarity index 100% rename from script/get-lib-dnnl/_cm.yaml rename to script/get-lib-dnnl/meta.yaml diff --git a/script/get-lib-protobuf/customize.py b/script/get-lib-protobuf/customize.py index dc9a423c2..e8e6ea450 100644 --- a/script/get-lib-protobuf/customize.py +++ b/script/get-lib-protobuf/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-lib-protobuf/_cm.yaml b/script/get-lib-protobuf/meta.yaml similarity index 100% rename from script/get-lib-protobuf/_cm.yaml rename to script/get-lib-protobuf/meta.yaml diff --git a/script/get-lib-qaic-api/customize.py b/script/get-lib-qaic-api/customize.py index 4d9b73865..6c829ae86 100644 --- a/script/get-lib-qaic-api/customize.py +++ b/script/get-lib-qaic-api/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-lib-qaic-api/_cm.yaml b/script/get-lib-qaic-api/meta.yaml similarity index 100% rename from script/get-lib-qaic-api/_cm.yaml rename to script/get-lib-qaic-api/meta.yaml diff --git a/script/get-llvm/customize.py b/script/get-llvm/customize.py index 9b2ff3d5f..c8bb004d6 100644 --- a/script/get-llvm/customize.py +++ b/script/get-llvm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-llvm/_cm.yaml b/script/get-llvm/meta.yaml similarity index 100% rename from script/get-llvm/_cm.yaml rename to script/get-llvm/meta.yaml diff --git a/script/get-microtvm/customize.py b/script/get-microtvm/customize.py index db61f8d73..8572322f4 100644 --- a/script/get-microtvm/customize.py +++ b/script/get-microtvm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-microtvm/_cm.yaml b/script/get-microtvm/meta.yaml similarity index 100% rename from script/get-microtvm/_cm.yaml rename to script/get-microtvm/meta.yaml diff --git a/script/get-ml-model-3d-unet-kits19/customize.py b/script/get-ml-model-3d-unet-kits19/customize.py index dc3d4c605..d24b386c9 100644 --- a/script/get-ml-model-3d-unet-kits19/customize.py +++ b/script/get-ml-model-3d-unet-kits19/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -10,7 +10,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object path = os.path.dirname(env['CM_ML_MODEL_FILE_WITH_PATH']) diff --git a/script/get-ml-model-3d-unet-kits19/_cm.yaml b/script/get-ml-model-3d-unet-kits19/meta.yaml similarity index 100% rename from script/get-ml-model-3d-unet-kits19/_cm.yaml rename to script/get-ml-model-3d-unet-kits19/meta.yaml diff --git a/script/get-ml-model-abtf-ssd-pytorch/customize.py b/script/get-ml-model-abtf-ssd-pytorch/customize.py index 10a3a7f83..7d20952a2 100644 --- a/script/get-ml-model-abtf-ssd-pytorch/customize.py +++ b/script/get-ml-model-abtf-ssd-pytorch/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-abtf-ssd-pytorch/_cm.yaml b/script/get-ml-model-abtf-ssd-pytorch/meta.yaml similarity index 100% rename from script/get-ml-model-abtf-ssd-pytorch/_cm.yaml rename to script/get-ml-model-abtf-ssd-pytorch/meta.yaml diff --git a/script/get-ml-model-bert-base-squad/_cm.yaml b/script/get-ml-model-bert-base-squad/meta.yaml similarity index 100% rename from script/get-ml-model-bert-base-squad/_cm.yaml rename to script/get-ml-model-bert-base-squad/meta.yaml diff --git a/script/get-ml-model-bert-large-squad/customize.py b/script/get-ml-model-bert-large-squad/customize.py index c58448455..76eddaaed 100644 --- a/script/get-ml-model-bert-large-squad/customize.py +++ b/script/get-ml-model-bert-large-squad/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-bert-large-squad/_cm.yaml b/script/get-ml-model-bert-large-squad/meta.yaml similarity index 100% rename from script/get-ml-model-bert-large-squad/_cm.yaml rename to script/get-ml-model-bert-large-squad/meta.yaml diff --git a/script/get-ml-model-dlrm-terabyte/_cm.yaml b/script/get-ml-model-dlrm-terabyte/meta.yaml similarity index 100% rename from script/get-ml-model-dlrm-terabyte/_cm.yaml rename to script/get-ml-model-dlrm-terabyte/meta.yaml diff --git a/script/get-ml-model-efficientnet-lite/customize.py b/script/get-ml-model-efficientnet-lite/customize.py index c0d8dd73c..59f3c580e 100644 --- a/script/get-ml-model-efficientnet-lite/customize.py +++ b/script/get-ml-model-efficientnet-lite/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -10,7 +10,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object path = os.getcwd() diff --git a/script/get-ml-model-efficientnet-lite/_cm.yaml b/script/get-ml-model-efficientnet-lite/meta.yaml similarity index 100% rename from script/get-ml-model-efficientnet-lite/_cm.yaml rename to script/get-ml-model-efficientnet-lite/meta.yaml diff --git a/script/get-ml-model-gptj/customize.py b/script/get-ml-model-gptj/customize.py index 90343764d..d4fc749e5 100644 --- a/script/get-ml-model-gptj/customize.py +++ b/script/get-ml-model-gptj/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-gptj/_cm.yaml b/script/get-ml-model-gptj/meta.yaml similarity index 100% rename from script/get-ml-model-gptj/_cm.yaml rename to script/get-ml-model-gptj/meta.yaml diff --git a/script/get-ml-model-huggingface-zoo/customize.py b/script/get-ml-model-huggingface-zoo/customize.py index cd0b5a5c0..e117df4e3 100644 --- a/script/get-ml-model-huggingface-zoo/customize.py +++ b/script/get-ml-model-huggingface-zoo/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -10,7 +10,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object script_path = i['run_script_input']['path'] diff --git a/script/get-ml-model-huggingface-zoo/_cm.yaml b/script/get-ml-model-huggingface-zoo/meta.yaml similarity index 100% rename from script/get-ml-model-huggingface-zoo/_cm.yaml rename to script/get-ml-model-huggingface-zoo/meta.yaml diff --git a/script/get-ml-model-llama2/customize.py b/script/get-ml-model-llama2/customize.py index 1f5949312..1c091c12b 100644 --- a/script/get-ml-model-llama2/customize.py +++ b/script/get-ml-model-llama2/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-llama2/_cm.yaml b/script/get-ml-model-llama2/meta.yaml similarity index 100% rename from script/get-ml-model-llama2/_cm.yaml rename to script/get-ml-model-llama2/meta.yaml diff --git a/script/get-ml-model-llama3/customize.py b/script/get-ml-model-llama3/customize.py index 9ec7edecd..71d309b3a 100644 --- a/script/get-ml-model-llama3/customize.py +++ b/script/get-ml-model-llama3/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-llama3/_cm.yaml b/script/get-ml-model-llama3/meta.yaml similarity index 100% rename from script/get-ml-model-llama3/_cm.yaml rename to script/get-ml-model-llama3/meta.yaml diff --git a/script/get-ml-model-mixtral/customize.py b/script/get-ml-model-mixtral/customize.py index a21036883..15ca81033 100644 --- a/script/get-ml-model-mixtral/customize.py +++ b/script/get-ml-model-mixtral/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-mixtral/_cm.yaml b/script/get-ml-model-mixtral/meta.yaml similarity index 100% rename from script/get-ml-model-mixtral/_cm.yaml rename to script/get-ml-model-mixtral/meta.yaml diff --git a/script/get-ml-model-mobilenet/customize.py b/script/get-ml-model-mobilenet/customize.py index c0d8dd73c..59f3c580e 100644 --- a/script/get-ml-model-mobilenet/customize.py +++ b/script/get-ml-model-mobilenet/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -10,7 +10,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object path = os.getcwd() diff --git a/script/get-ml-model-mobilenet/_cm.yaml b/script/get-ml-model-mobilenet/meta.yaml similarity index 100% rename from script/get-ml-model-mobilenet/_cm.yaml rename to script/get-ml-model-mobilenet/meta.yaml diff --git a/script/get-ml-model-neuralmagic-zoo/customize.py b/script/get-ml-model-neuralmagic-zoo/customize.py index 797932c14..685eaae6f 100644 --- a/script/get-ml-model-neuralmagic-zoo/customize.py +++ b/script/get-ml-model-neuralmagic-zoo/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -10,7 +10,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object path = os.getcwd() diff --git a/script/get-ml-model-neuralmagic-zoo/_cm.yaml b/script/get-ml-model-neuralmagic-zoo/meta.yaml similarity index 100% rename from script/get-ml-model-neuralmagic-zoo/_cm.yaml rename to script/get-ml-model-neuralmagic-zoo/meta.yaml diff --git a/script/get-ml-model-resnet50/customize.py b/script/get-ml-model-resnet50/customize.py index 3aced7756..d4095dc65 100644 --- a/script/get-ml-model-resnet50/customize.py +++ b/script/get-ml-model-resnet50/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-resnet50/_cm.yaml b/script/get-ml-model-resnet50/meta.yaml similarity index 100% rename from script/get-ml-model-resnet50/_cm.yaml rename to script/get-ml-model-resnet50/meta.yaml diff --git a/script/get-ml-model-retinanet-nvidia/customize.py b/script/get-ml-model-retinanet-nvidia/customize.py index 52fce9129..67be9d6a7 100644 --- a/script/get-ml-model-retinanet-nvidia/customize.py +++ b/script/get-ml-model-retinanet-nvidia/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-retinanet-nvidia/_cm.yaml b/script/get-ml-model-retinanet-nvidia/meta.yaml similarity index 100% rename from script/get-ml-model-retinanet-nvidia/_cm.yaml rename to script/get-ml-model-retinanet-nvidia/meta.yaml diff --git a/script/get-ml-model-retinanet/customize.py b/script/get-ml-model-retinanet/customize.py index 63a42a72e..71ab2852e 100644 --- a/script/get-ml-model-retinanet/customize.py +++ b/script/get-ml-model-retinanet/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-retinanet/_cm.yaml b/script/get-ml-model-retinanet/meta.yaml similarity index 100% rename from script/get-ml-model-retinanet/_cm.yaml rename to script/get-ml-model-retinanet/meta.yaml diff --git a/script/get-ml-model-rgat/customize.py b/script/get-ml-model-rgat/customize.py index 3cda5a7a8..469cb3943 100644 --- a/script/get-ml-model-rgat/customize.py +++ b/script/get-ml-model-rgat/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-rgat/_cm.yaml b/script/get-ml-model-rgat/meta.yaml similarity index 100% rename from script/get-ml-model-rgat/_cm.yaml rename to script/get-ml-model-rgat/meta.yaml diff --git a/script/get-ml-model-rnnt/customize.py b/script/get-ml-model-rnnt/customize.py index f41646dba..0fc024cdd 100644 --- a/script/get-ml-model-rnnt/customize.py +++ b/script/get-ml-model-rnnt/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -10,7 +10,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object path = os.getcwd() diff --git a/script/get-ml-model-rnnt/_cm.yaml b/script/get-ml-model-rnnt/meta.yaml similarity index 100% rename from script/get-ml-model-rnnt/_cm.yaml rename to script/get-ml-model-rnnt/meta.yaml diff --git a/script/get-ml-model-stable-diffusion/customize.py b/script/get-ml-model-stable-diffusion/customize.py index cdaf6b90c..1049ac703 100644 --- a/script/get-ml-model-stable-diffusion/customize.py +++ b/script/get-ml-model-stable-diffusion/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-stable-diffusion/_cm.yaml b/script/get-ml-model-stable-diffusion/meta.yaml similarity index 100% rename from script/get-ml-model-stable-diffusion/_cm.yaml rename to script/get-ml-model-stable-diffusion/meta.yaml diff --git a/script/get-ml-model-tiny-resnet/customize.py b/script/get-ml-model-tiny-resnet/customize.py index d936088ba..fac34716f 100644 --- a/script/get-ml-model-tiny-resnet/customize.py +++ b/script/get-ml-model-tiny-resnet/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-ml-model-tiny-resnet/_cm.yaml b/script/get-ml-model-tiny-resnet/meta.yaml similarity index 100% rename from script/get-ml-model-tiny-resnet/_cm.yaml rename to script/get-ml-model-tiny-resnet/meta.yaml diff --git a/script/get-ml-model-using-imagenet-from-model-zoo/customize.py b/script/get-ml-model-using-imagenet-from-model-zoo/customize.py index 884be0170..fa2e1a85a 100644 --- a/script/get-ml-model-using-imagenet-from-model-zoo/customize.py +++ b/script/get-ml-model-using-imagenet-from-model-zoo/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -10,7 +10,7 @@ def preprocess(i): automation = i['automation'] - cm = automation.cmind + cm = automation.action_object return {'return': 0} diff --git a/script/get-ml-model-using-imagenet-from-model-zoo/_cm.yaml b/script/get-ml-model-using-imagenet-from-model-zoo/meta.yaml similarity index 100% rename from script/get-ml-model-using-imagenet-from-model-zoo/_cm.yaml rename to script/get-ml-model-using-imagenet-from-model-zoo/meta.yaml diff --git a/script/get-mlperf-automotive-scratch-space/customize.py b/script/get-mlperf-automotive-scratch-space/customize.py index 057acd2c4..9c3cda605 100644 --- a/script/get-mlperf-automotive-scratch-space/customize.py +++ b/script/get-mlperf-automotive-scratch-space/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-automotive-scratch-space/_cm.yaml b/script/get-mlperf-automotive-scratch-space/meta.yaml similarity index 100% rename from script/get-mlperf-automotive-scratch-space/_cm.yaml rename to script/get-mlperf-automotive-scratch-space/meta.yaml diff --git a/script/get-mlperf-inference-intel-scratch-space/customize.py b/script/get-mlperf-inference-intel-scratch-space/customize.py index b88245660..8862e1adf 100644 --- a/script/get-mlperf-inference-intel-scratch-space/customize.py +++ b/script/get-mlperf-inference-intel-scratch-space/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-inference-intel-scratch-space/_cm.yaml b/script/get-mlperf-inference-intel-scratch-space/meta.yaml similarity index 100% rename from script/get-mlperf-inference-intel-scratch-space/_cm.yaml rename to script/get-mlperf-inference-intel-scratch-space/meta.yaml diff --git a/script/get-mlperf-inference-loadgen/customize.py b/script/get-mlperf-inference-loadgen/customize.py index 524521e42..c6747af04 100644 --- a/script/get-mlperf-inference-loadgen/customize.py +++ b/script/get-mlperf-inference-loadgen/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-inference-loadgen/_cm.yaml b/script/get-mlperf-inference-loadgen/meta.yaml similarity index 100% rename from script/get-mlperf-inference-loadgen/_cm.yaml rename to script/get-mlperf-inference-loadgen/meta.yaml diff --git a/script/get-mlperf-inference-nvidia-common-code/customize.py b/script/get-mlperf-inference-nvidia-common-code/customize.py index 4edd4cbde..a8b61cf0e 100644 --- a/script/get-mlperf-inference-nvidia-common-code/customize.py +++ b/script/get-mlperf-inference-nvidia-common-code/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-inference-nvidia-common-code/_cm.yaml b/script/get-mlperf-inference-nvidia-common-code/meta.yaml similarity index 100% rename from script/get-mlperf-inference-nvidia-common-code/_cm.yaml rename to script/get-mlperf-inference-nvidia-common-code/meta.yaml diff --git a/script/get-mlperf-inference-nvidia-scratch-space/customize.py b/script/get-mlperf-inference-nvidia-scratch-space/customize.py index 533536389..0e21e01ab 100644 --- a/script/get-mlperf-inference-nvidia-scratch-space/customize.py +++ b/script/get-mlperf-inference-nvidia-scratch-space/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-inference-nvidia-scratch-space/_cm.yaml b/script/get-mlperf-inference-nvidia-scratch-space/meta.yaml similarity index 100% rename from script/get-mlperf-inference-nvidia-scratch-space/_cm.yaml rename to script/get-mlperf-inference-nvidia-scratch-space/meta.yaml diff --git a/script/get-mlperf-inference-results-dir/customize.py b/script/get-mlperf-inference-results-dir/customize.py index f1beabcaa..997a0564d 100644 --- a/script/get-mlperf-inference-results-dir/customize.py +++ b/script/get-mlperf-inference-results-dir/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-inference-results-dir/_cm.yaml b/script/get-mlperf-inference-results-dir/meta.yaml similarity index 100% rename from script/get-mlperf-inference-results-dir/_cm.yaml rename to script/get-mlperf-inference-results-dir/meta.yaml diff --git a/script/get-mlperf-inference-results/customize.py b/script/get-mlperf-inference-results/customize.py index 36f71224d..b1e054dac 100644 --- a/script/get-mlperf-inference-results/customize.py +++ b/script/get-mlperf-inference-results/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-mlperf-inference-results/_cm.yaml b/script/get-mlperf-inference-results/meta.yaml similarity index 100% rename from script/get-mlperf-inference-results/_cm.yaml rename to script/get-mlperf-inference-results/meta.yaml diff --git a/script/get-mlperf-inference-src/customize.py b/script/get-mlperf-inference-src/customize.py index 8c545d678..dee74bdaf 100644 --- a/script/get-mlperf-inference-src/customize.py +++ b/script/get-mlperf-inference-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-mlperf-inference-src/_cm.yaml b/script/get-mlperf-inference-src/meta.yaml similarity index 100% rename from script/get-mlperf-inference-src/_cm.yaml rename to script/get-mlperf-inference-src/meta.yaml diff --git a/script/get-mlperf-inference-submission-dir/customize.py b/script/get-mlperf-inference-submission-dir/customize.py index f0f95f62f..e7e7eae85 100644 --- a/script/get-mlperf-inference-submission-dir/customize.py +++ b/script/get-mlperf-inference-submission-dir/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-inference-submission-dir/_cm.yaml b/script/get-mlperf-inference-submission-dir/meta.yaml similarity index 100% rename from script/get-mlperf-inference-submission-dir/_cm.yaml rename to script/get-mlperf-inference-submission-dir/meta.yaml diff --git a/script/get-mlperf-inference-sut-configs/customize.py b/script/get-mlperf-inference-sut-configs/customize.py index 8adbdc3b8..8bc64be4c 100644 --- a/script/get-mlperf-inference-sut-configs/customize.py +++ b/script/get-mlperf-inference-sut-configs/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import yaml import shutil diff --git a/script/get-mlperf-inference-sut-configs/_cm.yaml b/script/get-mlperf-inference-sut-configs/meta.yaml similarity index 100% rename from script/get-mlperf-inference-sut-configs/_cm.yaml rename to script/get-mlperf-inference-sut-configs/meta.yaml diff --git a/script/get-mlperf-inference-sut-description/customize.py b/script/get-mlperf-inference-sut-description/customize.py index 0f7693fa0..3490f4580 100644 --- a/script/get-mlperf-inference-sut-description/customize.py +++ b/script/get-mlperf-inference-sut-description/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import json import shutil diff --git a/script/get-mlperf-inference-sut-description/_cm.yaml b/script/get-mlperf-inference-sut-description/meta.yaml similarity index 100% rename from script/get-mlperf-inference-sut-description/_cm.yaml rename to script/get-mlperf-inference-sut-description/meta.yaml diff --git a/script/get-mlperf-inference-utils/customize.py b/script/get-mlperf-inference-utils/customize.py index 179342fc7..2f0310932 100644 --- a/script/get-mlperf-inference-utils/customize.py +++ b/script/get-mlperf-inference-utils/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import sys diff --git a/script/get-mlperf-inference-utils/_cm.yaml b/script/get-mlperf-inference-utils/meta.yaml similarity index 100% rename from script/get-mlperf-inference-utils/_cm.yaml rename to script/get-mlperf-inference-utils/meta.yaml diff --git a/script/get-mlperf-logging/customize.py b/script/get-mlperf-logging/customize.py index fea70fc38..318a83d0a 100644 --- a/script/get-mlperf-logging/customize.py +++ b/script/get-mlperf-logging/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-mlperf-logging/_cm.yaml b/script/get-mlperf-logging/meta.yaml similarity index 100% rename from script/get-mlperf-logging/_cm.yaml rename to script/get-mlperf-logging/meta.yaml diff --git a/script/get-mlperf-power-dev/customize.py b/script/get-mlperf-power-dev/customize.py index d091365bb..1cf439730 100644 --- a/script/get-mlperf-power-dev/customize.py +++ b/script/get-mlperf-power-dev/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-mlperf-power-dev/_cm.yaml b/script/get-mlperf-power-dev/meta.yaml similarity index 100% rename from script/get-mlperf-power-dev/_cm.yaml rename to script/get-mlperf-power-dev/meta.yaml diff --git a/script/get-mlperf-tiny-eembc-energy-runner-src/customize.py b/script/get-mlperf-tiny-eembc-energy-runner-src/customize.py index a2e524315..477df85b1 100644 --- a/script/get-mlperf-tiny-eembc-energy-runner-src/customize.py +++ b/script/get-mlperf-tiny-eembc-energy-runner-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-mlperf-tiny-eembc-energy-runner-src/_cm.yaml b/script/get-mlperf-tiny-eembc-energy-runner-src/meta.yaml similarity index 100% rename from script/get-mlperf-tiny-eembc-energy-runner-src/_cm.yaml rename to script/get-mlperf-tiny-eembc-energy-runner-src/meta.yaml diff --git a/script/get-mlperf-tiny-src/customize.py b/script/get-mlperf-tiny-src/customize.py index f07ee475d..58eba296d 100644 --- a/script/get-mlperf-tiny-src/customize.py +++ b/script/get-mlperf-tiny-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-mlperf-tiny-src/_cm.yaml b/script/get-mlperf-tiny-src/meta.yaml similarity index 100% rename from script/get-mlperf-tiny-src/_cm.yaml rename to script/get-mlperf-tiny-src/meta.yaml diff --git a/script/get-mlperf-training-nvidia-code/customize.py b/script/get-mlperf-training-nvidia-code/customize.py index 4a2d1f33d..14c0ba345 100644 --- a/script/get-mlperf-training-nvidia-code/customize.py +++ b/script/get-mlperf-training-nvidia-code/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-mlperf-training-nvidia-code/_cm.yaml b/script/get-mlperf-training-nvidia-code/meta.yaml similarity index 100% rename from script/get-mlperf-training-nvidia-code/_cm.yaml rename to script/get-mlperf-training-nvidia-code/meta.yaml diff --git a/script/get-mlperf-training-src/customize.py b/script/get-mlperf-training-src/customize.py index 1af8336a8..baf805882 100644 --- a/script/get-mlperf-training-src/customize.py +++ b/script/get-mlperf-training-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-mlperf-training-src/_cm.yaml b/script/get-mlperf-training-src/meta.yaml similarity index 100% rename from script/get-mlperf-training-src/_cm.yaml rename to script/get-mlperf-training-src/meta.yaml diff --git a/script/get-nvidia-docker/_cm.yaml b/script/get-nvidia-docker/meta.yaml similarity index 100% rename from script/get-nvidia-docker/_cm.yaml rename to script/get-nvidia-docker/meta.yaml diff --git a/script/get-nvidia-mitten/customize.py b/script/get-nvidia-mitten/customize.py index 983d681f4..a2acfde43 100644 --- a/script/get-nvidia-mitten/customize.py +++ b/script/get-nvidia-mitten/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-nvidia-mitten/_cm.yaml b/script/get-nvidia-mitten/meta.yaml similarity index 100% rename from script/get-nvidia-mitten/_cm.yaml rename to script/get-nvidia-mitten/meta.yaml diff --git a/script/get-onnxruntime-prebuilt/customize.py b/script/get-onnxruntime-prebuilt/customize.py index ebb13a72f..2184b54de 100644 --- a/script/get-onnxruntime-prebuilt/customize.py +++ b/script/get-onnxruntime-prebuilt/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-onnxruntime-prebuilt/_cm.yaml b/script/get-onnxruntime-prebuilt/meta.yaml similarity index 100% rename from script/get-onnxruntime-prebuilt/_cm.yaml rename to script/get-onnxruntime-prebuilt/meta.yaml diff --git a/script/get-openssl/customize.py b/script/get-openssl/customize.py index 2ac5ac73b..2cc8ff2e5 100644 --- a/script/get-openssl/customize.py +++ b/script/get-openssl/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-openssl/_cm.yaml b/script/get-openssl/meta.yaml similarity index 100% rename from script/get-openssl/_cm.yaml rename to script/get-openssl/meta.yaml diff --git a/script/get-platform-details/customize.py b/script/get-platform-details/customize.py index 485e5cee6..5db915829 100644 --- a/script/get-platform-details/customize.py +++ b/script/get-platform-details/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess diff --git a/script/get-platform-details/_cm.yaml b/script/get-platform-details/meta.yaml similarity index 100% rename from script/get-platform-details/_cm.yaml rename to script/get-platform-details/meta.yaml diff --git a/script/get-preprocessed-dataset-criteo/customize.py b/script/get-preprocessed-dataset-criteo/customize.py index bb60894f6..7200d4795 100644 --- a/script/get-preprocessed-dataset-criteo/customize.py +++ b/script/get-preprocessed-dataset-criteo/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-preprocessed-dataset-criteo/_cm.yaml b/script/get-preprocessed-dataset-criteo/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-criteo/_cm.yaml rename to script/get-preprocessed-dataset-criteo/meta.yaml diff --git a/script/get-preprocessed-dataset-generic/customize.py b/script/get-preprocessed-dataset-generic/customize.py index c470734b9..9a2abdde0 100644 --- a/script/get-preprocessed-dataset-generic/customize.py +++ b/script/get-preprocessed-dataset-generic/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-preprocessed-dataset-generic/_cm.yaml b/script/get-preprocessed-dataset-generic/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-generic/_cm.yaml rename to script/get-preprocessed-dataset-generic/meta.yaml diff --git a/script/get-preprocessed-dataset-imagenet/customize.py b/script/get-preprocessed-dataset-imagenet/customize.py index 60fd02198..0b5a6f0d6 100644 --- a/script/get-preprocessed-dataset-imagenet/customize.py +++ b/script/get-preprocessed-dataset-imagenet/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os from os.path import exists import shutil diff --git a/script/get-preprocessed-dataset-imagenet/_cm.yaml b/script/get-preprocessed-dataset-imagenet/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-imagenet/_cm.yaml rename to script/get-preprocessed-dataset-imagenet/meta.yaml diff --git a/script/get-preprocessed-dataset-kits19/customize.py b/script/get-preprocessed-dataset-kits19/customize.py index 3b108f88a..6b3ce5c02 100644 --- a/script/get-preprocessed-dataset-kits19/customize.py +++ b/script/get-preprocessed-dataset-kits19/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-preprocessed-dataset-kits19/_cm.yaml b/script/get-preprocessed-dataset-kits19/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-kits19/_cm.yaml rename to script/get-preprocessed-dataset-kits19/meta.yaml diff --git a/script/get-preprocessed-dataset-librispeech/customize.py b/script/get-preprocessed-dataset-librispeech/customize.py index 7a3f6c73f..70389e904 100644 --- a/script/get-preprocessed-dataset-librispeech/customize.py +++ b/script/get-preprocessed-dataset-librispeech/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-preprocessed-dataset-librispeech/_cm.yaml b/script/get-preprocessed-dataset-librispeech/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-librispeech/_cm.yaml rename to script/get-preprocessed-dataset-librispeech/meta.yaml diff --git a/script/get-preprocessed-dataset-openimages/customize.py b/script/get-preprocessed-dataset-openimages/customize.py index cec47ecea..f502bf1b2 100644 --- a/script/get-preprocessed-dataset-openimages/customize.py +++ b/script/get-preprocessed-dataset-openimages/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil import glob diff --git a/script/get-preprocessed-dataset-openimages/_cm.yaml b/script/get-preprocessed-dataset-openimages/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-openimages/_cm.yaml rename to script/get-preprocessed-dataset-openimages/meta.yaml diff --git a/script/get-preprocessed-dataset-openorca/customize.py b/script/get-preprocessed-dataset-openorca/customize.py index 7c042c839..49b1a8ae4 100644 --- a/script/get-preprocessed-dataset-openorca/customize.py +++ b/script/get-preprocessed-dataset-openorca/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/get-preprocessed-dataset-openorca/_cm.yaml b/script/get-preprocessed-dataset-openorca/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-openorca/_cm.yaml rename to script/get-preprocessed-dataset-openorca/meta.yaml diff --git a/script/get-preprocessed-dataset-squad/customize.py b/script/get-preprocessed-dataset-squad/customize.py index 1f72f139f..7f89c2275 100644 --- a/script/get-preprocessed-dataset-squad/customize.py +++ b/script/get-preprocessed-dataset-squad/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-preprocessed-dataset-squad/_cm.yaml b/script/get-preprocessed-dataset-squad/meta.yaml similarity index 100% rename from script/get-preprocessed-dataset-squad/_cm.yaml rename to script/get-preprocessed-dataset-squad/meta.yaml diff --git a/script/get-python3/customize.py b/script/get-python3/customize.py index 1f05701a4..e6598804d 100644 --- a/script/get-python3/customize.py +++ b/script/get-python3/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-python3/_cm.yaml b/script/get-python3/meta.yaml similarity index 100% rename from script/get-python3/_cm.yaml rename to script/get-python3/meta.yaml diff --git a/script/get-qaic-apps-sdk/customize.py b/script/get-qaic-apps-sdk/customize.py index 5fd343f71..023b9809d 100644 --- a/script/get-qaic-apps-sdk/customize.py +++ b/script/get-qaic-apps-sdk/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import xml.etree.ElementTree as et diff --git a/script/get-qaic-apps-sdk/_cm.yaml b/script/get-qaic-apps-sdk/meta.yaml similarity index 100% rename from script/get-qaic-apps-sdk/_cm.yaml rename to script/get-qaic-apps-sdk/meta.yaml diff --git a/script/get-qaic-platform-sdk/customize.py b/script/get-qaic-platform-sdk/customize.py index 33e9548ba..9e2079a98 100644 --- a/script/get-qaic-platform-sdk/customize.py +++ b/script/get-qaic-platform-sdk/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import xml.etree.ElementTree as et diff --git a/script/get-qaic-platform-sdk/_cm.yaml b/script/get-qaic-platform-sdk/meta.yaml similarity index 100% rename from script/get-qaic-platform-sdk/_cm.yaml rename to script/get-qaic-platform-sdk/meta.yaml diff --git a/script/get-qaic-software-kit/customize.py b/script/get-qaic-software-kit/customize.py index 77edac769..6826e2ea2 100644 --- a/script/get-qaic-software-kit/customize.py +++ b/script/get-qaic-software-kit/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-qaic-software-kit/_cm.yaml b/script/get-qaic-software-kit/meta.yaml similarity index 100% rename from script/get-qaic-software-kit/_cm.yaml rename to script/get-qaic-software-kit/meta.yaml diff --git a/script/get-rclone-config/customize.py b/script/get-rclone-config/customize.py index 10893238f..68c1f59a0 100644 --- a/script/get-rclone-config/customize.py +++ b/script/get-rclone-config/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-rclone-config/_cm.yaml b/script/get-rclone-config/meta.yaml similarity index 100% rename from script/get-rclone-config/_cm.yaml rename to script/get-rclone-config/meta.yaml diff --git a/script/get-rclone/customize.py b/script/get-rclone/customize.py index 7dec29c71..197e75f1e 100644 --- a/script/get-rclone/customize.py +++ b/script/get-rclone/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import configparser diff --git a/script/get-rclone/_cm.yaml b/script/get-rclone/meta.yaml similarity index 100% rename from script/get-rclone/_cm.yaml rename to script/get-rclone/meta.yaml diff --git a/script/get-rocm-devices/customize.py b/script/get-rocm-devices/customize.py index 0b0d0d9ce..69cb82ff1 100644 --- a/script/get-rocm-devices/customize.py +++ b/script/get-rocm-devices/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess diff --git a/script/get-rocm-devices/_cm.yaml b/script/get-rocm-devices/meta.yaml similarity index 100% rename from script/get-rocm-devices/_cm.yaml rename to script/get-rocm-devices/meta.yaml diff --git a/script/get-rocm/customize.py b/script/get-rocm/customize.py index 1e9c5071c..f864221df 100644 --- a/script/get-rocm/customize.py +++ b/script/get-rocm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-rocm/_cm.yaml b/script/get-rocm/meta.yaml similarity index 100% rename from script/get-rocm/_cm.yaml rename to script/get-rocm/meta.yaml diff --git a/script/get-spec-ptd/customize.py b/script/get-spec-ptd/customize.py index 6e88200dd..3607fa621 100644 --- a/script/get-spec-ptd/customize.py +++ b/script/get-spec-ptd/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil import stat diff --git a/script/get-spec-ptd/_cm.yaml b/script/get-spec-ptd/meta.yaml similarity index 100% rename from script/get-spec-ptd/_cm.yaml rename to script/get-spec-ptd/meta.yaml diff --git a/script/get-sys-utils-cm/customize.py b/script/get-sys-utils-cm/customize.py index 994f9f46b..0582e9a5e 100644 --- a/script/get-sys-utils-cm/customize.py +++ b/script/get-sys-utils-cm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -9,7 +9,7 @@ def preprocess(i): env = i['env'] automation = i['automation'] - cm = automation.cmind + cm = automation.action_object if env.get('CM_HOST_OS_FLAVOR', '') == 'amzn': env['CM_PACKAGE_TOOL'] = "yum" diff --git a/script/get-sys-utils-cm/_cm.yaml b/script/get-sys-utils-cm/meta.yaml similarity index 100% rename from script/get-sys-utils-cm/_cm.yaml rename to script/get-sys-utils-cm/meta.yaml diff --git a/script/get-sys-utils-min/customize.py b/script/get-sys-utils-min/customize.py index 6efb11fa0..9c91e0d90 100644 --- a/script/get-sys-utils-min/customize.py +++ b/script/get-sys-utils-min/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -9,7 +9,7 @@ def preprocess(i): env = i['env'] automation = i['automation'] - cm = automation.cmind + cm = automation.action_object # If windows, download here otherwise use run.sh if os_info['platform'] == 'windows': @@ -38,27 +38,16 @@ def preprocess(i): print('') print('Downloading from {}'.format(url)) - - r = cm.access({'action': 'download_file', - 'automation': 'utils,dc2743f8450541e3', + env['CM_DAE_FINAL_ENV_NAME'] = 'FILENAME' + env['CM_OUTDIRNAME'] = os.getcwd() + r = cm.access({'action': 'run', + 'target': 'script', + 'env': env, + 'tags': 'download-and-extract,_extract', 'url': url}) if r['return'] > 0: return r - filename = r['filename'] - - print('Unzipping file {}'.format(filename)) - - r = cm.access({'action': 'unzip_file', - 'automation': 'utils,dc2743f8450541e3', - 'filename': filename}) - if r['return'] > 0: - return r - - if os.path.isfile(filename): - print('Removing file {}'.format(filename)) - os.remove(filename) - print('') # Add to path diff --git a/script/get-sys-utils-min/_cm.yaml b/script/get-sys-utils-min/meta.yaml similarity index 100% rename from script/get-sys-utils-min/_cm.yaml rename to script/get-sys-utils-min/meta.yaml diff --git a/script/get-tensorrt/customize.py b/script/get-tensorrt/customize.py index 263c645e8..2da2a3b2e 100644 --- a/script/get-tensorrt/customize.py +++ b/script/get-tensorrt/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import tarfile diff --git a/script/get-tensorrt/_cm.yaml b/script/get-tensorrt/meta.yaml similarity index 100% rename from script/get-tensorrt/_cm.yaml rename to script/get-tensorrt/meta.yaml diff --git a/script/get-terraform/customize.py b/script/get-terraform/customize.py index 1ec8af5c6..8b051f01f 100644 --- a/script/get-terraform/customize.py +++ b/script/get-terraform/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-terraform/_cm.yaml b/script/get-terraform/meta.yaml similarity index 100% rename from script/get-terraform/_cm.yaml rename to script/get-terraform/meta.yaml diff --git a/script/get-tvm-model/customize.py b/script/get-tvm-model/customize.py index ce883ce36..5869374bc 100644 --- a/script/get-tvm-model/customize.py +++ b/script/get-tvm-model/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-tvm-model/_cm.yaml b/script/get-tvm-model/meta.yaml similarity index 100% rename from script/get-tvm-model/_cm.yaml rename to script/get-tvm-model/meta.yaml diff --git a/script/get-tvm/customize.py b/script/get-tvm/customize.py index b7995264b..9bb912f88 100644 --- a/script/get-tvm/customize.py +++ b/script/get-tvm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-tvm/_cm.yaml b/script/get-tvm/meta.yaml similarity index 100% rename from script/get-tvm/_cm.yaml rename to script/get-tvm/meta.yaml diff --git a/script/get-xilinx-sdk/customize.py b/script/get-xilinx-sdk/customize.py index 52922d29c..f14b9797d 100644 --- a/script/get-xilinx-sdk/customize.py +++ b/script/get-xilinx-sdk/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-xilinx-sdk/_cm.yaml b/script/get-xilinx-sdk/meta.yaml similarity index 100% rename from script/get-xilinx-sdk/_cm.yaml rename to script/get-xilinx-sdk/meta.yaml diff --git a/script/get-zendnn/customize.py b/script/get-zendnn/customize.py index 5310eea52..706398a08 100644 --- a/script/get-zendnn/customize.py +++ b/script/get-zendnn/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-zendnn/_cm.yaml b/script/get-zendnn/meta.yaml similarity index 100% rename from script/get-zendnn/_cm.yaml rename to script/get-zendnn/meta.yaml diff --git a/script/get-zephyr-sdk/customize.py b/script/get-zephyr-sdk/customize.py index d0b05d675..950a479ec 100644 --- a/script/get-zephyr-sdk/customize.py +++ b/script/get-zephyr-sdk/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-zephyr-sdk/_cm.yaml b/script/get-zephyr-sdk/meta.yaml similarity index 100% rename from script/get-zephyr-sdk/_cm.yaml rename to script/get-zephyr-sdk/meta.yaml diff --git a/script/get-zephyr/customize.py b/script/get-zephyr/customize.py index 74b8a9fec..4bbcf5316 100644 --- a/script/get-zephyr/customize.py +++ b/script/get-zephyr/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/get-zephyr/_cm.yaml b/script/get-zephyr/meta.yaml similarity index 100% rename from script/get-zephyr/_cm.yaml rename to script/get-zephyr/meta.yaml diff --git a/script/install-apt-package/customize.py b/script/install-apt-package/customize.py index 21e27eeda..911067966 100644 --- a/script/install-apt-package/customize.py +++ b/script/install-apt-package/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import re diff --git a/script/install-apt-package/_cm.yaml b/script/install-apt-package/meta.yaml similarity index 100% rename from script/install-apt-package/_cm.yaml rename to script/install-apt-package/meta.yaml diff --git a/script/install-aws-cli/customize.py b/script/install-aws-cli/customize.py index 032a4f3bf..f4a90798c 100644 --- a/script/install-aws-cli/customize.py +++ b/script/install-aws-cli/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-aws-cli/_cm.yaml b/script/install-aws-cli/meta.yaml similarity index 100% rename from script/install-aws-cli/_cm.yaml rename to script/install-aws-cli/meta.yaml diff --git a/script/install-bazel/customize.py b/script/install-bazel/customize.py index 4bd79760b..f18929e25 100644 --- a/script/install-bazel/customize.py +++ b/script/install-bazel/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-bazel/_cm.yaml b/script/install-bazel/meta.yaml similarity index 100% rename from script/install-bazel/_cm.yaml rename to script/install-bazel/meta.yaml diff --git a/script/install-cmake-prebuilt/customize.py b/script/install-cmake-prebuilt/customize.py index 2f5c4c4f1..5eef0848a 100644 --- a/script/install-cmake-prebuilt/customize.py +++ b/script/install-cmake-prebuilt/customize.py @@ -1,5 +1,6 @@ -from cmind import utils +from mlc import utils import os +from utils import download_file, unzip_file def preprocess(i): @@ -70,11 +71,10 @@ def preprocess(i): print('') print('Downloading from {} ...'.format(package_url)) - cm = automation.cmind + cm = automation.action_object - r = cm.access({'action': 'download_file', - 'automation': 'utils,dc2743f8450541e3', - 'url': package_url}) + r = download_file({ + 'url': package_url}) if r['return'] > 0: return r @@ -84,10 +84,9 @@ def preprocess(i): if os_info['platform'] == 'windows': print('Unzipping file {}'.format(filename)) - r = cm.access({'action': 'unzip_file', - 'automation': 'utils,dc2743f8450541e3', - 'strip_folders': 1, - 'filename': filename}) + r = unzip_file({ + 'strip_folders': 1, + 'filename': filename}) if r['return'] > 0: return r diff --git a/script/install-cmake-prebuilt/_cm.yaml b/script/install-cmake-prebuilt/meta.yaml similarity index 100% rename from script/install-cmake-prebuilt/_cm.yaml rename to script/install-cmake-prebuilt/meta.yaml diff --git a/script/install-cuda-package-manager/customize.py b/script/install-cuda-package-manager/customize.py index fb84652e3..96100616a 100644 --- a/script/install-cuda-package-manager/customize.py +++ b/script/install-cuda-package-manager/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-cuda-package-manager/_cm.yaml b/script/install-cuda-package-manager/meta.yaml similarity index 100% rename from script/install-cuda-package-manager/_cm.yaml rename to script/install-cuda-package-manager/meta.yaml diff --git a/script/install-cuda-prebuilt/customize.py b/script/install-cuda-prebuilt/customize.py index db49f81b3..ddaae605c 100644 --- a/script/install-cuda-prebuilt/customize.py +++ b/script/install-cuda-prebuilt/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-cuda-prebuilt/_cm.yaml b/script/install-cuda-prebuilt/meta.yaml similarity index 100% rename from script/install-cuda-prebuilt/_cm.yaml rename to script/install-cuda-prebuilt/meta.yaml diff --git a/script/install-diffusers-from-src/customize.py b/script/install-diffusers-from-src/customize.py index 6d5e7f9db..300164858 100644 --- a/script/install-diffusers-from-src/customize.py +++ b/script/install-diffusers-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-diffusers-from-src/_cm.yaml b/script/install-diffusers-from-src/meta.yaml similarity index 100% rename from script/install-diffusers-from-src/_cm.yaml rename to script/install-diffusers-from-src/meta.yaml diff --git a/script/install-gcc-src/customize.py b/script/install-gcc-src/customize.py index a368cdfb8..ff13be8e2 100644 --- a/script/install-gcc-src/customize.py +++ b/script/install-gcc-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-gcc-src/_cm.yaml b/script/install-gcc-src/meta.yaml similarity index 100% rename from script/install-gcc-src/_cm.yaml rename to script/install-gcc-src/meta.yaml diff --git a/script/install-generic-conda-package/customize.py b/script/install-generic-conda-package/customize.py index 5310923d6..2fe548677 100644 --- a/script/install-generic-conda-package/customize.py +++ b/script/install-generic-conda-package/customize.py @@ -1,6 +1,5 @@ -from cmind import utils +from mlc import utils import os -import cmind as cm def preprocess(i): diff --git a/script/install-generic-conda-package/_cm.yaml b/script/install-generic-conda-package/meta.yaml similarity index 100% rename from script/install-generic-conda-package/_cm.yaml rename to script/install-generic-conda-package/meta.yaml diff --git a/script/install-gflags-from-src/customize.py b/script/install-gflags-from-src/customize.py index 030b0b8b4..c7ad1faa0 100644 --- a/script/install-gflags-from-src/customize.py +++ b/script/install-gflags-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-gflags-from-src/_cm.yaml b/script/install-gflags-from-src/meta.yaml similarity index 100% rename from script/install-gflags-from-src/_cm.yaml rename to script/install-gflags-from-src/meta.yaml diff --git a/script/install-gflags/customize.py b/script/install-gflags/customize.py index d9caffb60..97f3d2c06 100644 --- a/script/install-gflags/customize.py +++ b/script/install-gflags/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-gflags/_cm.yaml b/script/install-gflags/meta.yaml similarity index 100% rename from script/install-gflags/_cm.yaml rename to script/install-gflags/meta.yaml diff --git a/script/install-github-cli/customize.py b/script/install-github-cli/customize.py index 5079c4d74..08370ecbd 100644 --- a/script/install-github-cli/customize.py +++ b/script/install-github-cli/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-github-cli/_cm.yaml b/script/install-github-cli/meta.yaml similarity index 100% rename from script/install-github-cli/_cm.yaml rename to script/install-github-cli/meta.yaml diff --git a/script/install-intel-neural-speed-from-src/customize.py b/script/install-intel-neural-speed-from-src/customize.py index 9ac64a4f8..f6cae5a37 100644 --- a/script/install-intel-neural-speed-from-src/customize.py +++ b/script/install-intel-neural-speed-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-intel-neural-speed-from-src/_cm.yaml b/script/install-intel-neural-speed-from-src/meta.yaml similarity index 100% rename from script/install-intel-neural-speed-from-src/_cm.yaml rename to script/install-intel-neural-speed-from-src/meta.yaml diff --git a/script/install-ipex-from-src/customize.py b/script/install-ipex-from-src/customize.py index d25749304..7521bc3c5 100644 --- a/script/install-ipex-from-src/customize.py +++ b/script/install-ipex-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-ipex-from-src/_cm.yaml b/script/install-ipex-from-src/meta.yaml similarity index 100% rename from script/install-ipex-from-src/_cm.yaml rename to script/install-ipex-from-src/meta.yaml diff --git a/script/install-llvm-prebuilt/customize.py b/script/install-llvm-prebuilt/customize.py index 23c116ee9..058714522 100644 --- a/script/install-llvm-prebuilt/customize.py +++ b/script/install-llvm-prebuilt/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from utils import * import os @@ -169,11 +169,14 @@ def preprocess(i): print('') print('Downloading from {} ...'.format(package_url)) - cm = automation.cmind + cm = automation.action_object + r = download_file({'url': package_url}) + ''' r = cm.access({'action': 'download_file', 'automation': 'utils,dc2743f8450541e3', 'url': package_url}) + ''' if r['return'] > 0: return r diff --git a/script/install-llvm-prebuilt/_cm.yaml b/script/install-llvm-prebuilt/meta.yaml similarity index 100% rename from script/install-llvm-prebuilt/_cm.yaml rename to script/install-llvm-prebuilt/meta.yaml diff --git a/script/install-llvm-src/customize.py b/script/install-llvm-src/customize.py index 5a359ac7e..c3ec8e0c8 100644 --- a/script/install-llvm-src/customize.py +++ b/script/install-llvm-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-llvm-src/_cm.yaml b/script/install-llvm-src/meta.yaml similarity index 100% rename from script/install-llvm-src/_cm.yaml rename to script/install-llvm-src/meta.yaml diff --git a/script/install-mlperf-logging-from-src/customize.py b/script/install-mlperf-logging-from-src/customize.py index 273999d46..3df1d0660 100644 --- a/script/install-mlperf-logging-from-src/customize.py +++ b/script/install-mlperf-logging-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-mlperf-logging-from-src/_cm.yaml b/script/install-mlperf-logging-from-src/meta.yaml similarity index 100% rename from script/install-mlperf-logging-from-src/_cm.yaml rename to script/install-mlperf-logging-from-src/meta.yaml diff --git a/script/install-nccl-libs/customize.py b/script/install-nccl-libs/customize.py index 273999d46..3df1d0660 100644 --- a/script/install-nccl-libs/customize.py +++ b/script/install-nccl-libs/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-nccl-libs/_cm.yaml b/script/install-nccl-libs/meta.yaml similarity index 100% rename from script/install-nccl-libs/_cm.yaml rename to script/install-nccl-libs/meta.yaml diff --git a/script/install-numactl-from-src/customize.py b/script/install-numactl-from-src/customize.py index 5605e99b0..9f662f3a8 100644 --- a/script/install-numactl-from-src/customize.py +++ b/script/install-numactl-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-numactl-from-src/_cm.yaml b/script/install-numactl-from-src/meta.yaml similarity index 100% rename from script/install-numactl-from-src/_cm.yaml rename to script/install-numactl-from-src/meta.yaml diff --git a/script/install-onednn-from-src/customize.py b/script/install-onednn-from-src/customize.py index facd107df..18444917d 100644 --- a/script/install-onednn-from-src/customize.py +++ b/script/install-onednn-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-onednn-from-src/_cm.yaml b/script/install-onednn-from-src/meta.yaml similarity index 100% rename from script/install-onednn-from-src/_cm.yaml rename to script/install-onednn-from-src/meta.yaml diff --git a/script/install-onnxruntime-from-src/customize.py b/script/install-onnxruntime-from-src/customize.py index 0f11967a0..23a0b15de 100644 --- a/script/install-onnxruntime-from-src/customize.py +++ b/script/install-onnxruntime-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-onnxruntime-from-src/_cm.yaml b/script/install-onnxruntime-from-src/meta.yaml similarity index 100% rename from script/install-onnxruntime-from-src/_cm.yaml rename to script/install-onnxruntime-from-src/meta.yaml diff --git a/script/install-opencv-from-src/customize.py b/script/install-opencv-from-src/customize.py index bc4ebf61f..459536d29 100644 --- a/script/install-opencv-from-src/customize.py +++ b/script/install-opencv-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-opencv-from-src/_cm.yaml b/script/install-opencv-from-src/meta.yaml similarity index 100% rename from script/install-opencv-from-src/_cm.yaml rename to script/install-opencv-from-src/meta.yaml diff --git a/script/install-openssl/customize.py b/script/install-openssl/customize.py index 23ece8afb..d2c747014 100644 --- a/script/install-openssl/customize.py +++ b/script/install-openssl/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-openssl/_cm.yaml b/script/install-openssl/meta.yaml similarity index 100% rename from script/install-openssl/_cm.yaml rename to script/install-openssl/meta.yaml diff --git a/script/install-pip-package-for-cmind-python/customize.py b/script/install-pip-package-for-cmind-python/customize.py index 05960de84..be33639d1 100644 --- a/script/install-pip-package-for-cmind-python/customize.py +++ b/script/install-pip-package-for-cmind-python/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess import sys diff --git a/script/install-pip-package-for-cmind-python/_cm.yaml b/script/install-pip-package-for-cmind-python/meta.yaml similarity index 100% rename from script/install-pip-package-for-cmind-python/_cm.yaml rename to script/install-pip-package-for-cmind-python/meta.yaml diff --git a/script/install-python-src/customize.py b/script/install-python-src/customize.py index 25edf22f4..fe0901aa3 100644 --- a/script/install-python-src/customize.py +++ b/script/install-python-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-python-src/_cm.yaml b/script/install-python-src/meta.yaml similarity index 100% rename from script/install-python-src/_cm.yaml rename to script/install-python-src/meta.yaml diff --git a/script/install-python-venv/customize.py b/script/install-python-venv/customize.py index a9a411524..b73e5ac7d 100644 --- a/script/install-python-venv/customize.py +++ b/script/install-python-venv/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-python-venv/_cm.yaml b/script/install-python-venv/meta.yaml similarity index 100% rename from script/install-python-venv/_cm.yaml rename to script/install-python-venv/meta.yaml diff --git a/script/install-pytorch-from-src/customize.py b/script/install-pytorch-from-src/customize.py index d44872d7a..3f8735654 100644 --- a/script/install-pytorch-from-src/customize.py +++ b/script/install-pytorch-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-pytorch-from-src/_cm.yaml b/script/install-pytorch-from-src/meta.yaml similarity index 100% rename from script/install-pytorch-from-src/_cm.yaml rename to script/install-pytorch-from-src/meta.yaml diff --git a/script/install-pytorch-kineto-from-src/customize.py b/script/install-pytorch-kineto-from-src/customize.py index 032a4f3bf..f4a90798c 100644 --- a/script/install-pytorch-kineto-from-src/customize.py +++ b/script/install-pytorch-kineto-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-pytorch-kineto-from-src/_cm.yaml b/script/install-pytorch-kineto-from-src/meta.yaml similarity index 100% rename from script/install-pytorch-kineto-from-src/_cm.yaml rename to script/install-pytorch-kineto-from-src/meta.yaml diff --git a/script/install-qaic-compute-sdk-from-src/customize.py b/script/install-qaic-compute-sdk-from-src/customize.py index fec123a6b..ec0a42185 100644 --- a/script/install-qaic-compute-sdk-from-src/customize.py +++ b/script/install-qaic-compute-sdk-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-qaic-compute-sdk-from-src/_cm.yaml b/script/install-qaic-compute-sdk-from-src/meta.yaml similarity index 100% rename from script/install-qaic-compute-sdk-from-src/_cm.yaml rename to script/install-qaic-compute-sdk-from-src/meta.yaml diff --git a/script/install-rapidjson-from-src/customize.py b/script/install-rapidjson-from-src/customize.py index 6d5e7f9db..300164858 100644 --- a/script/install-rapidjson-from-src/customize.py +++ b/script/install-rapidjson-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-rapidjson-from-src/_cm.yaml b/script/install-rapidjson-from-src/meta.yaml similarity index 100% rename from script/install-rapidjson-from-src/_cm.yaml rename to script/install-rapidjson-from-src/meta.yaml diff --git a/script/install-rocm/customize.py b/script/install-rocm/customize.py index 2762f8138..9891f8e62 100644 --- a/script/install-rocm/customize.py +++ b/script/install-rocm/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-rocm/_cm.yaml b/script/install-rocm/meta.yaml similarity index 100% rename from script/install-rocm/_cm.yaml rename to script/install-rocm/meta.yaml diff --git a/script/install-tensorflow-for-c/customize.py b/script/install-tensorflow-for-c/customize.py index d950482c4..c354d0b99 100644 --- a/script/install-tensorflow-for-c/customize.py +++ b/script/install-tensorflow-for-c/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-tensorflow-for-c/_cm.yaml b/script/install-tensorflow-for-c/meta.yaml similarity index 100% rename from script/install-tensorflow-for-c/_cm.yaml rename to script/install-tensorflow-for-c/meta.yaml diff --git a/script/install-tensorflow-from-src/customize.py b/script/install-tensorflow-from-src/customize.py index f591d5522..e99d0b5a2 100644 --- a/script/install-tensorflow-from-src/customize.py +++ b/script/install-tensorflow-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-tensorflow-from-src/_cm.yaml b/script/install-tensorflow-from-src/meta.yaml similarity index 100% rename from script/install-tensorflow-from-src/_cm.yaml rename to script/install-tensorflow-from-src/meta.yaml diff --git a/script/install-terraform-from-src/customize.py b/script/install-terraform-from-src/customize.py index fb46c1192..475c0037c 100644 --- a/script/install-terraform-from-src/customize.py +++ b/script/install-terraform-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-terraform-from-src/_cm.yaml b/script/install-terraform-from-src/meta.yaml similarity index 100% rename from script/install-terraform-from-src/_cm.yaml rename to script/install-terraform-from-src/meta.yaml diff --git a/script/install-tflite-from-src/customize.py b/script/install-tflite-from-src/customize.py index b23045938..bb4324c62 100644 --- a/script/install-tflite-from-src/customize.py +++ b/script/install-tflite-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-tflite-from-src/_cm.yaml b/script/install-tflite-from-src/meta.yaml similarity index 100% rename from script/install-tflite-from-src/_cm.yaml rename to script/install-tflite-from-src/meta.yaml diff --git a/script/install-torchvision-from-src/customize.py b/script/install-torchvision-from-src/customize.py index 6d5e7f9db..300164858 100644 --- a/script/install-torchvision-from-src/customize.py +++ b/script/install-torchvision-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-torchvision-from-src/_cm.yaml b/script/install-torchvision-from-src/meta.yaml similarity index 100% rename from script/install-torchvision-from-src/_cm.yaml rename to script/install-torchvision-from-src/meta.yaml diff --git a/script/install-tpp-pytorch-extension/customize.py b/script/install-tpp-pytorch-extension/customize.py index 6ee676b68..dfc6e52df 100644 --- a/script/install-tpp-pytorch-extension/customize.py +++ b/script/install-tpp-pytorch-extension/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-tpp-pytorch-extension/_cm.yaml b/script/install-tpp-pytorch-extension/meta.yaml similarity index 100% rename from script/install-tpp-pytorch-extension/_cm.yaml rename to script/install-tpp-pytorch-extension/meta.yaml diff --git a/script/install-transformers-from-src/customize.py b/script/install-transformers-from-src/customize.py index c287139fe..d83e374e3 100644 --- a/script/install-transformers-from-src/customize.py +++ b/script/install-transformers-from-src/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/install-transformers-from-src/_cm.yaml b/script/install-transformers-from-src/meta.yaml similarity index 100% rename from script/install-transformers-from-src/_cm.yaml rename to script/install-transformers-from-src/meta.yaml diff --git a/script/plug-prebuilt-cudnn-to-cuda/customize.py b/script/plug-prebuilt-cudnn-to-cuda/customize.py index 2beb23e1f..4f495e035 100644 --- a/script/plug-prebuilt-cudnn-to-cuda/customize.py +++ b/script/plug-prebuilt-cudnn-to-cuda/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/plug-prebuilt-cudnn-to-cuda/_cm.yaml b/script/plug-prebuilt-cudnn-to-cuda/meta.yaml similarity index 100% rename from script/plug-prebuilt-cudnn-to-cuda/_cm.yaml rename to script/plug-prebuilt-cudnn-to-cuda/meta.yaml diff --git a/script/plug-prebuilt-cusparselt-to-cuda/customize.py b/script/plug-prebuilt-cusparselt-to-cuda/customize.py index 926267705..20980c022 100644 --- a/script/plug-prebuilt-cusparselt-to-cuda/customize.py +++ b/script/plug-prebuilt-cusparselt-to-cuda/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/plug-prebuilt-cusparselt-to-cuda/_cm.yaml b/script/plug-prebuilt-cusparselt-to-cuda/meta.yaml similarity index 100% rename from script/plug-prebuilt-cusparselt-to-cuda/_cm.yaml rename to script/plug-prebuilt-cusparselt-to-cuda/meta.yaml diff --git a/script/prepare-training-data-bert/customize.py b/script/prepare-training-data-bert/customize.py index e2c3907e2..1b0de8e90 100644 --- a/script/prepare-training-data-bert/customize.py +++ b/script/prepare-training-data-bert/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/prepare-training-data-bert/_cm.yaml b/script/prepare-training-data-bert/meta.yaml similarity index 100% rename from script/prepare-training-data-bert/_cm.yaml rename to script/prepare-training-data-bert/meta.yaml diff --git a/script/prepare-training-data-resnet/customize.py b/script/prepare-training-data-resnet/customize.py index ee4c879cc..36fdba4e9 100644 --- a/script/prepare-training-data-resnet/customize.py +++ b/script/prepare-training-data-resnet/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/prepare-training-data-resnet/_cm.yaml b/script/prepare-training-data-resnet/meta.yaml similarity index 100% rename from script/prepare-training-data-resnet/_cm.yaml rename to script/prepare-training-data-resnet/meta.yaml diff --git a/script/preprocess-mlperf-inference-submission/customize.py b/script/preprocess-mlperf-inference-submission/customize.py index f4ea74c8d..40a00bf39 100644 --- a/script/preprocess-mlperf-inference-submission/customize.py +++ b/script/preprocess-mlperf-inference-submission/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os from os.path import exists import shutil diff --git a/script/preprocess-mlperf-inference-submission/_cm.yaml b/script/preprocess-mlperf-inference-submission/meta.yaml similarity index 100% rename from script/preprocess-mlperf-inference-submission/_cm.yaml rename to script/preprocess-mlperf-inference-submission/meta.yaml diff --git a/script/print-any-text/customize.py b/script/print-any-text/customize.py index 6437e1c47..ea05b88fc 100644 --- a/script/print-any-text/customize.py +++ b/script/print-any-text/customize.py @@ -1,6 +1,6 @@ # Developer(s): Grigori Fursin -from cmind import utils +from mlc import utils import os diff --git a/script/print-any-text/_cm.yaml b/script/print-any-text/meta.yaml similarity index 100% rename from script/print-any-text/_cm.yaml rename to script/print-any-text/meta.yaml diff --git a/script/print-croissant-desc/_cm.yaml b/script/print-croissant-desc/meta.yaml similarity index 100% rename from script/print-croissant-desc/_cm.yaml rename to script/print-croissant-desc/meta.yaml diff --git a/script/print-hello-world-java/_cm.yaml b/script/print-hello-world-java/meta.yaml similarity index 100% rename from script/print-hello-world-java/_cm.yaml rename to script/print-hello-world-java/meta.yaml diff --git a/script/print-hello-world-javac/_cm.yaml b/script/print-hello-world-javac/meta.yaml similarity index 100% rename from script/print-hello-world-javac/_cm.yaml rename to script/print-hello-world-javac/meta.yaml diff --git a/script/print-hello-world-py/_cm.yaml b/script/print-hello-world-py/meta.yaml similarity index 100% rename from script/print-hello-world-py/_cm.yaml rename to script/print-hello-world-py/meta.yaml diff --git a/script/print-hello-world/_cm.yaml b/script/print-hello-world/meta.yaml similarity index 100% rename from script/print-hello-world/_cm.yaml rename to script/print-hello-world/meta.yaml diff --git a/script/print-python-version/_cm.yaml b/script/print-python-version/meta.yaml similarity index 100% rename from script/print-python-version/_cm.yaml rename to script/print-python-version/meta.yaml diff --git a/script/process-mlperf-accuracy/customize.py b/script/process-mlperf-accuracy/customize.py index 738b21697..9e3a99885 100644 --- a/script/process-mlperf-accuracy/customize.py +++ b/script/process-mlperf-accuracy/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os diff --git a/script/process-mlperf-accuracy/_cm.yaml b/script/process-mlperf-accuracy/meta.yaml similarity index 100% rename from script/process-mlperf-accuracy/_cm.yaml rename to script/process-mlperf-accuracy/meta.yaml diff --git a/script/prune-bert-models/customize.py b/script/prune-bert-models/customize.py index ae3a704e9..eac06855d 100644 --- a/script/prune-bert-models/customize.py +++ b/script/prune-bert-models/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/prune-bert-models/_cm.yaml b/script/prune-bert-models/meta.yaml similarity index 100% rename from script/prune-bert-models/_cm.yaml rename to script/prune-bert-models/meta.yaml diff --git a/script/prune-docker/_cm.yaml b/script/prune-docker/meta.yaml similarity index 100% rename from script/prune-docker/_cm.yaml rename to script/prune-docker/meta.yaml diff --git a/script/publish-results-to-dashboard/_cm.yaml b/script/publish-results-to-dashboard/meta.yaml similarity index 100% rename from script/publish-results-to-dashboard/_cm.yaml rename to script/publish-results-to-dashboard/meta.yaml diff --git a/script/pull-git-repo/customize.py b/script/pull-git-repo/customize.py index 3dfd21e26..2135a1941 100644 --- a/script/pull-git-repo/customize.py +++ b/script/pull-git-repo/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/pull-git-repo/_cm.yaml b/script/pull-git-repo/meta.yaml similarity index 100% rename from script/pull-git-repo/_cm.yaml rename to script/pull-git-repo/meta.yaml diff --git a/script/push-csv-to-spreadsheet/customize.py b/script/push-csv-to-spreadsheet/customize.py index 213925e2f..e3a082660 100644 --- a/script/push-csv-to-spreadsheet/customize.py +++ b/script/push-csv-to-spreadsheet/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os diff --git a/script/push-csv-to-spreadsheet/_cm.yaml b/script/push-csv-to-spreadsheet/meta.yaml similarity index 100% rename from script/push-csv-to-spreadsheet/_cm.yaml rename to script/push-csv-to-spreadsheet/meta.yaml diff --git a/script/push-mlperf-inference-results-to-github/customize.py b/script/push-mlperf-inference-results-to-github/customize.py index 9b2e34e0e..10b73ec23 100644 --- a/script/push-mlperf-inference-results-to-github/customize.py +++ b/script/push-mlperf-inference-results-to-github/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os from giturlparse import parse @@ -36,7 +35,7 @@ def preprocess(i): p = parse(repo) if env.get('CM_GITHUB_PAT', '') != '': token = env['CM_GITHUB_PAT'] - env['CM_GIT_PUSH_CMD'] = f"""git push https://x-access-token:{env['CM_GITHUB_PAT']}@{p.host}/{p.owner}/{p.repo}""" + env['CM_GIT_PUSH_CMD'] = f"""git push https://x-access-token:{token}@{p.host}/{p.owner}/{p.repo}""" else: env['CM_GIT_PUSH_CMD'] = "git push" diff --git a/script/push-mlperf-inference-results-to-github/_cm.yaml b/script/push-mlperf-inference-results-to-github/meta.yaml similarity index 100% rename from script/push-mlperf-inference-results-to-github/_cm.yaml rename to script/push-mlperf-inference-results-to-github/meta.yaml diff --git a/script/push-mlperf-inference-results-to-github/run.sh b/script/push-mlperf-inference-results-to-github/run.sh index 8b6ac5648..795838f68 100644 --- a/script/push-mlperf-inference-results-to-github/run.sh +++ b/script/push-mlperf-inference-results-to-github/run.sh @@ -9,6 +9,7 @@ fi cd "${CM_GIT_REPO_CHECKOUT_PATH}" git pull git add * + if [[ -n ${CM_MLPERF_INFERENCE_SUBMISSION_DIR} ]]; then rsync -avz "${CM_MLPERF_INFERENCE_SUBMISSION_DIR}/" "${CM_GIT_REPO_CHECKOUT_PATH}/" git add * diff --git a/script/remote-run-commands/customize.py b/script/remote-run-commands/customize.py index bd5a0f9db..28f8379a9 100644 --- a/script/remote-run-commands/customize.py +++ b/script/remote-run-commands/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/remote-run-commands/_cm.yaml b/script/remote-run-commands/meta.yaml similarity index 100% rename from script/remote-run-commands/_cm.yaml rename to script/remote-run-commands/meta.yaml diff --git a/script/reproduce-mlperf-octoml-tinyml-results/customize.py b/script/reproduce-mlperf-octoml-tinyml-results/customize.py index 7e9eac690..8f579e8f3 100644 --- a/script/reproduce-mlperf-octoml-tinyml-results/customize.py +++ b/script/reproduce-mlperf-octoml-tinyml-results/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/reproduce-mlperf-octoml-tinyml-results/_cm.yaml b/script/reproduce-mlperf-octoml-tinyml-results/meta.yaml similarity index 100% rename from script/reproduce-mlperf-octoml-tinyml-results/_cm.yaml rename to script/reproduce-mlperf-octoml-tinyml-results/meta.yaml diff --git a/script/reproduce-mlperf-training-nvidia/customize.py b/script/reproduce-mlperf-training-nvidia/customize.py index cdc98cc7c..cd78bd8b4 100644 --- a/script/reproduce-mlperf-training-nvidia/customize.py +++ b/script/reproduce-mlperf-training-nvidia/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil diff --git a/script/reproduce-mlperf-training-nvidia/_cm.yaml b/script/reproduce-mlperf-training-nvidia/meta.yaml similarity index 100% rename from script/reproduce-mlperf-training-nvidia/_cm.yaml rename to script/reproduce-mlperf-training-nvidia/meta.yaml diff --git a/script/run-all-mlperf-models/customize.py b/script/run-all-mlperf-models/customize.py index 7887602c0..07460c6be 100644 --- a/script/run-all-mlperf-models/customize.py +++ b/script/run-all-mlperf-models/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/run-all-mlperf-models/_cm.yaml b/script/run-all-mlperf-models/meta.yaml similarity index 100% rename from script/run-all-mlperf-models/_cm.yaml rename to script/run-all-mlperf-models/meta.yaml diff --git a/script/run-docker-container/customize.py b/script/run-docker-container/customize.py index d9518f516..f35f22f57 100644 --- a/script/run-docker-container/customize.py +++ b/script/run-docker-container/customize.py @@ -1,5 +1,5 @@ -from cmind import utils -import cmind as cm +from mlc import utils +import mlc import os import subprocess from os.path import exists @@ -19,14 +19,14 @@ def preprocess(i): if 'CM_DOCKER_RUN_SCRIPT_TAGS' not in env: env['CM_DOCKER_RUN_SCRIPT_TAGS'] = "run,docker,container" - CM_RUN_CMD = "cm version" + CM_RUN_CMD = "mlc version" else: - CM_RUN_CMD = "cm run script --tags=" + \ + CM_RUN_CMD = "mlc run script --tags=" + \ env['CM_DOCKER_RUN_SCRIPT_TAGS'] + ' --quiet' - r = cm.access({'action': 'search', + r = mlc.access({'action': 'search', 'automation': 'script', - 'tags': env['CM_DOCKER_RUN_SCRIPT_TAGS']}) + 'tags': env['CM_DOCKER_RUN_SCRIPT_TAGS']}) if len(r['list']) < 1: raise Exception( 'CM script with tags ' + @@ -386,7 +386,7 @@ def update_docker_info(env): if env.get('CM_DOCKER_IMAGE_NAME', '') != '': docker_image_name = env['CM_DOCKER_IMAGE_NAME'] else: - docker_image_name = 'cm-script-' + \ + docker_image_name = 'mlc-script-' + \ env['CM_DOCKER_RUN_SCRIPT_TAGS'].replace( ',', '-').replace('_', '-').replace('+', 'plus') env['CM_DOCKER_IMAGE_NAME'] = docker_image_name diff --git a/script/run-docker-container/_cm.yaml b/script/run-docker-container/meta.yaml similarity index 100% rename from script/run-docker-container/_cm.yaml rename to script/run-docker-container/meta.yaml diff --git a/script/run-mlperf-automotive-app/customize.py b/script/run-mlperf-automotive-app/customize.py index 14cb9c237..4133b60ed 100644 --- a/script/run-mlperf-automotive-app/customize.py +++ b/script/run-mlperf-automotive-app/customize.py @@ -1,9 +1,9 @@ -from cmind import utils +from mlc import utils import os import json import shutil import subprocess -import cmind as cm +import mlc import copy from tabulate import tabulate @@ -249,7 +249,7 @@ def preprocess(i): if action == "docker": for k in docker_extra_input: ii[k] = docker_extra_input[k] - r = cm.access(ii) + r = mlc.access(ii) if r['return'] > 0: return r if action == "docker": @@ -278,15 +278,15 @@ def preprocess(i): if action == "docker": for k in docker_extra_input: ii[k] = docker_extra_input[k] - r = cm.access(ii) + r = mlc.access(ii) if r['return'] > 0: return r if state.get('docker', {}): del (state['docker']) - if state.get("cm-mlperf-inference-results"): - # print(state["cm-mlperf-inference-results"]) - for sut in state["cm-mlperf-inference-results"]: # only one sut will be there + if state.get("mlc-mlperf-inference-results"): + # print(state["mlc-mlperf-inference-results"]) + for sut in state["mlc-mlperf-inference-results"]: # only one sut will be there # Better to do this in a stand alone CM script with proper deps but # currently we manage this by modifying the sys path of the python # executing CM @@ -294,7 +294,7 @@ def preprocess(i): print(sut) result_table, headers = mlperf_utils.get_result_table( - state["cm-mlperf-inference-results"][sut]) + state["mlc-mlperf-inference-results"][sut]) print(tabulate(result_table, headers=headers, tablefmt="pretty")) print( diff --git a/script/run-mlperf-automotive-app/_cm.yaml b/script/run-mlperf-automotive-app/meta.yaml similarity index 99% rename from script/run-mlperf-automotive-app/_cm.yaml rename to script/run-mlperf-automotive-app/meta.yaml index 942f499e8..83bf6a1cb 100644 --- a/script/run-mlperf-automotive-app/_cm.yaml +++ b/script/run-mlperf-automotive-app/meta.yaml @@ -89,7 +89,7 @@ input_mapping: new_state_keys: - app_mlperf_inference_* -- cm-mlperf-inference-results* +- mlc-mlperf-inference-results* deps: - tags: detect,os diff --git a/script/run-mlperf-inference-app/customize.py b/script/run-mlperf-inference-app/customize.py index fc857c468..82d493993 100644 --- a/script/run-mlperf-inference-app/customize.py +++ b/script/run-mlperf-inference-app/customize.py @@ -1,9 +1,9 @@ -from cmind import utils +from mlc import utils import os import json import shutil import subprocess -import cmind as cm +import mlc import copy import mlperf_utils @@ -275,7 +275,7 @@ def preprocess(i): for k in docker_extra_input: ii[k] = docker_extra_input[k] - r = cm.access(ii) + r = mlc.access(ii) if r['return'] > 0: return r @@ -308,7 +308,7 @@ def preprocess(i): if action == "docker": for k in docker_extra_input: ii[k] = docker_extra_input[k] - r = cm.access(ii) + r = mlc.access(ii) if r['return'] > 0: return r if state.get('docker', {}): @@ -320,9 +320,9 @@ def preprocess(i): CMD = f"docker kill {container_id}" docker_out = subprocess.check_output(CMD, shell=True).decode("utf-8") - if state.get("cm-mlperf-inference-results"): - # print(state["cm-mlperf-inference-results"]) - for sut in state["cm-mlperf-inference-results"]: # only one sut will be there + if state.get("mlc-mlperf-inference-results"): + # print(state["mlc-mlperf-inference-results"]) + for sut in state["mlc-mlperf-inference-results"]: # only one sut will be there # Better to do this in a stand alone CM script with proper deps but # currently we manage this by modifying the sys path of the python # executing CM @@ -330,7 +330,7 @@ def preprocess(i): print(sut) result_table, headers = mlperf_utils.get_result_table( - state["cm-mlperf-inference-results"][sut]) + state["mlc-mlperf-inference-results"][sut]) print(tabulate(result_table, headers=headers, tablefmt="pretty")) print( diff --git a/script/run-mlperf-inference-app/_cm.yaml b/script/run-mlperf-inference-app/meta.yaml similarity index 99% rename from script/run-mlperf-inference-app/_cm.yaml rename to script/run-mlperf-inference-app/meta.yaml index 29effb5c2..812e9eeba 100644 --- a/script/run-mlperf-inference-app/_cm.yaml +++ b/script/run-mlperf-inference-app/meta.yaml @@ -122,7 +122,7 @@ input_mapping: new_state_keys: - app_mlperf_inference_* -- cm-mlperf-inference-results* +- mlc-mlperf-inference-results* deps: - tags: detect,os @@ -592,10 +592,8 @@ input_description: desc: Whether to run compliance tests (applicable only for closed division) dashboard_wb_project: desc: W&B dashboard project - default: cm-mlperf-dse-testing dashboard_wb_user: desc: W&B dashboard user - default: cmind hw_name: desc: MLPerf hardware name (for example "gcp.c3_standard_8", "nvidia_orin", "lenovo_p14s_gen_4_windows_11", "macbook_pro_m1_2", "thundercomm_rb6" ...) multistream_target_latency: diff --git a/script/run-mlperf-inference-app/modular-cm-containers/README.md b/script/run-mlperf-inference-app/modular-cm-containers/README.md deleted file mode 100644 index fdbe0e28a..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/README.md +++ /dev/null @@ -1,30 +0,0 @@ -***Outdated*** - -# About - -Prototyping modular and customizable CM containers for MLPerf. - -# Build - -```bash -./build.sh -``` - -# Run - -```bash -./run.sh - -cm run script --tags=run,mlperf,inference,generate-run-cmds,_submission,_dashboard \ - --adr.python.version_min=3.8 \ - --submitter="modular-cm-mlperf-container" \ - --lang=python \ - --hw_name=default \ - --model=resnet50 \ - --backend=onnxruntime \ - --device=cpu \ - --scenario=Offline \ - --test_query_count=500 \ - --quiet \ - --clean -``` diff --git a/script/run-mlperf-inference-app/modular-cm-containers/_common.bat b/script/run-mlperf-inference-app/modular-cm-containers/_common.bat deleted file mode 100644 index 7f9d3aab3..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/_common.bat +++ /dev/null @@ -1,7 +0,0 @@ -rem set CM_CACHE=--no-cache - -set CM_DOCKER_ORG=modularcm -set CM_DOCKER_NAME=mlperf-inference -set CM_OS_NAME=ubuntu -set CM_HW_TARGET=cpu -set CM_OS_VERSION=22.04 diff --git a/script/run-mlperf-inference-app/modular-cm-containers/_common.sh b/script/run-mlperf-inference-app/modular-cm-containers/_common.sh deleted file mode 100644 index 4d2f18aac..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/_common.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash - -#export CM_CACHE="--no-cache" - -export CM_DOCKER_ORG=modularcm -export CM_DOCKER_NAME="mlperf-inference" -export CM_OS_NAME="ubuntu" -export CM_HW_TARGET="cpu" -export CM_OS_VERSION="22.04" - diff --git a/script/run-mlperf-inference-app/modular-cm-containers/build.bat b/script/run-mlperf-inference-app/modular-cm-containers/build.bat deleted file mode 100644 index d7c097811..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/build.bat +++ /dev/null @@ -1,25 +0,0 @@ -call _common.bat - -docker build -f %CM_DOCKER_NAME%--%CM_OS_NAME%-%CM_HW_TARGET%.Dockerfile ^ - -t %CM_DOCKER_ORG%/%CM_DOCKER_NAME%:%CM_OS_NAME%-%CM_OS_VERSION% ^ - --build-arg cm_os_name=%CM_OS_NAME% ^ - --build-arg cm_hw_target=%CM_HW_TARGET% ^ - --build-arg cm_os_version=%CM_OS_VERSION% ^ - --build-arg cm_version="" ^ - --build-arg cm_automation_repo="mlcommons@ck" ^ - --build-arg cm_automation_checkout="" ^ - --build-arg cm_python_version="3.10.8" ^ - --build-arg cm_mlperf_inference_loadgen_version="" ^ - --build-arg cm_mlperf_inference_src_tags="" ^ - --build-arg cm_mlperf_inference_src_version="" ^ - --build-arg CM_MLPERF_CHOICE_SCRIPT="" ^ - --build-arg CM_MLPERF_CHOICE_SUBMITTER="Container" ^ - --build-arg CM_MLPERF_CHOICE_IMPLEMENTATION="python" ^ - --build-arg CM_MLPERF_CHOICE_HW_NAME="default" ^ - --build-arg CM_MLPERF_CHOICE_MODEL="resnet50" ^ - --build-arg CM_MLPERF_CHOICE_BACKEND="onnxruntime" ^ - --build-arg CM_MLPERF_CHOICE_DEVICE=%CM_HW_TARGET% ^ - --build-arg CM_MLPERF_CHOICE_SCENARIO="Offline" ^ - --build-arg CM_MLPERF_CHOICE_MODE="accuracy" ^ - --build-arg CM_MLPERF_CHOICE_QUERY_COUNT="5" ^ - %CM_CACHE% . diff --git a/script/run-mlperf-inference-app/modular-cm-containers/build.sh b/script/run-mlperf-inference-app/modular-cm-containers/build.sh deleted file mode 100644 index 082f00d4b..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -. ./_common.sh - -time docker build -f ${CM_DOCKER_NAME}--${CM_OS_NAME}-${CM_HW_TARGET}.Dockerfile \ - -t ${CM_DOCKER_ORG}/${CM_DOCKER_NAME}:${CM_OS_NAME}-${CM_OS_VERSION} \ - --build-arg cm_os_name=${CM_OS_NAME} \ - --build-arg cm_hw_target=${CM_HW_TARGET} \ - --build-arg cm_os_version=${CM_OS_VERSION} \ - --build-arg cm_version="" \ - --build-arg cm_automation_repo="mlcommons@ck" \ - --build-arg cm_automation_checkout="" \ - --build-arg cm_python_version="3.10.8" \ - --build-arg cm_mlperf_inference_loadgen_version="" \ - --build-arg cm_mlperf_inference_src_tags="" \ - --build-arg cm_mlperf_inference_src_version="" \ - --build-arg CM_MLPERF_CHOICE_SCRIPT=",_short,_submission,_dashboard" \ - --build-arg CM_MLPERF_CHOICE_SUBMITTER="Container" \ - --build-arg CM_MLPERF_CHOICE_IMPLEMENTATION="python" \ - --build-arg CM_MLPERF_CHOICE_HW_NAME="default" \ - --build-arg CM_MLPERF_CHOICE_MODEL="resnet50" \ - --build-arg CM_MLPERF_CHOICE_BACKEND="onnxruntime" \ - --build-arg CM_MLPERF_CHOICE_DEVICE=${CM_HW_TARGET} \ - --build-arg CM_MLPERF_CHOICE_SCENARIO="Offline" \ - --build-arg CM_MLPERF_CHOICE_MODE="accuracy" \ - --build-arg CM_MLPERF_CHOICE_QUERY_COUNT="500" \ - ${CM_CACHE} . diff --git a/script/run-mlperf-inference-app/modular-cm-containers/mlperf-inference--ubuntu-cpu.Dockerfile b/script/run-mlperf-inference-app/modular-cm-containers/mlperf-inference--ubuntu-cpu.Dockerfile deleted file mode 100644 index 25f9d7777..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/mlperf-inference--ubuntu-cpu.Dockerfile +++ /dev/null @@ -1,118 +0,0 @@ -# Modular MLPerf container with the MLCommons CM automation meta-framework - -# Preparing OS -ARG cm_os_name="ubuntu" -ARG cm_os_version="22.04" - -FROM ${cm_os_name}:${cm_os_version} - -# Maintained by the MLCommons taskforce on automation and reproducibility -LABEL github="https://github.com/mlcommons/ck" -LABEL maintainer="https://cKnowledge.org/mlcommons-taskforce" - -# Customization -ARG CM_GH_TOKEN - -# Prepare shell and entry point -SHELL ["/bin/bash", "-c"] -ENTRYPOINT ["/bin/bash", "-c"] - -# Install system dependencies -# Notes: https://runnable.com/blog/9-common-dockerfile-mistakes -RUN apt-get update -y -RUN apt-get install -y lsb-release -RUN apt-get install -y python3 python3-pip git wget sudo - -# Extra python deps -RUN python3 -m pip install requests - -# CM version -ARG cm_version="" -ENV CM_VERSION="${cm_version}" -RUN if [ "${CM_VERSION}" != "" ] ; then \ - python3 -m pip install cmind==${CM_VERSION} ; \ - else \ - python3 -m pip install cmind ; \ - fi - -# Setup docker environment -ENTRYPOINT ["/bin/bash", "-c"] -ENV TZ=US/Pacific -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone - -# Setup docker user -# See example in https://github.com/mlcommons/GaNDLF/blob/master/Dockerfile-CPU -RUN groupadd --gid 10001 cm -RUN useradd --uid 10000 -g cm --create-home --shell /bin/bash cmuser -RUN echo "cmuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - -USER cmuser:cm -WORKDIR /home/cmuser - -# Check CM installation -RUN lsb_release -a > sys-version-os.log -RUN uname -a > sys-version-kernel.log -RUN python3 --version > sys-version-python3.log -RUN cm version > sys-version-cm.log - -################################################################################ -# Get CM automation repository -ARG cm_automation_repo="mlcommons@ck" -ARG cm_automation_repo_checkout="" -ENV CM_AUTOMATION_REPO=${cm_automation_repo} -ENV CM_AUTOMATION_REPO_CHECKOUT=${cm_automation_repo_checkout} -RUN echo ${CM_AUTOMATION_REPO} -RUN cm pull repo ${CM_AUTOMATION_REPO} --checkout=${CM_AUTOMATION_REPO_CHECKOUT} - -################################################################################ -# Install CM system dependencies -RUN cm run script "get sys-utils-cm" --quiet - -# Detect/install python -ARG cm_python_version="" -RUN cm run script "get python3" --version=${cm_python_version} - -################################################################################ -# Build MLPerf loadgen (official with correct seed for submission) -ARG cm_mlperf_inference_loadgen_version="" -RUN cm run script "get mlperf loadgen" --adr.compiler.tags=gcc --version=${cm_mlperf_inference_loadgen_version} --adr.inference-src-loadgen.version=${cm_mlperf_inference_loadgen_version} -v - -# Install MLPerf inference source (can be private development branch) -ARG cm_mlperf_inference_src_tags="" -ARG cm_mlperf_inference_src_version="" -RUN cm run script "get mlperf inference src ${cm_mlperf_inference_src_tags}" --version=${cm_mlperf_inference_src_version} -v - -################################################################################ -# Run CM automation workflow for MLPerf -# https://github.com/mlcommons/cm4mlops/tree/main/script/run-mlperf-inference-app - -ARG CM_MLPERF_CHOICE_SCRIPT= -ARG CM_MLPERF_CHOICE_SUBMITTER="Container" -ARG CM_MLPERF_CHOICE_IMPLEMENTATION="python" -ARG CM_MLPERF_CHOICE_HW_NAME="default" -ARG CM_MLPERF_CHOICE_MODEL="resnet50" -ARG CM_MLPERF_CHOICE_BACKEND="onnxruntime" -ARG CM_MLPERF_CHOICE_DEVICE="cpu" -ARG CM_MLPERF_CHOICE_SCENARIO="Offline" -ARG CM_MLPERF_CHOICE_MODE="performance" -ARG CM_MLPERF_CHOICE_QUERY_COUNT="10" - -RUN cm run script --tags=run,mlperf,inference,generate-run-cmds,${CM_MLPERF_CHOICE_SCRIPT} \ - --adr.compiler.tags=gcc \ - --adr.python.version_min=3.8 \ - --adr.compiler.tags=gcc \ - --submitter="${CM_MLPERF_CHOICE_SUBMITTER}" \ - --lang=${CM_MLPERF_CHOICE_IMPLEMENTATION} \ - --hw_name=${CM_MLPERF_CHOICE_HW_NAME} \ - --model=${CM_MLPERF_CHOICE_MODEL} \ - --backend=${CM_MLPERF_CHOICE_BACKEND} \ - --device=${CM_MLPERF_CHOICE_DEVICE} \ - --scenario=${CM_MLPERF_CHOICE_SCENARIO} \ - --mode=${CM_MLPERF_CHOICE_MODE} \ - --test_query_count=${CM_MLPERF_CHOICE_QUERY_COUNT} \ - --quiet \ - --clean - -################################################################################ -# CMD entry point -CMD /bin/bash diff --git a/script/run-mlperf-inference-app/modular-cm-containers/run.bat b/script/run-mlperf-inference-app/modular-cm-containers/run.bat deleted file mode 100644 index 53b13dcb9..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -call _common.bat - -docker run -it %CM_DOCKER_ORG%/%CM_DOCKER_NAME%:%CM_OS_NAME%-%CM_OS_VERSION% diff --git a/script/run-mlperf-inference-app/modular-cm-containers/run.sh b/script/run-mlperf-inference-app/modular-cm-containers/run.sh deleted file mode 100644 index 3473716c7..000000000 --- a/script/run-mlperf-inference-app/modular-cm-containers/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -. ./_common.sh - -docker run -it ${CM_DOCKER_ORG}/${CM_DOCKER_NAME}:${CM_OS_NAME}-${CM_OS_VERSION} diff --git a/script/run-mlperf-inference-app/run_mobilenet.py b/script/run-mlperf-inference-app/run_mobilenet.py index 63ad8986e..bfe0657fe 100644 --- a/script/run-mlperf-inference-app/run_mobilenet.py +++ b/script/run-mlperf-inference-app/run_mobilenet.py @@ -1,4 +1,4 @@ -import cmind +import mlc import os import sys @@ -73,7 +73,7 @@ continue if model == "efficientnet" and precision == "uint8": precision = "int8" - cm_input = { + mlc_input = { 'action': 'run', 'automation': 'script', 'tags': f'generate-run-cmds,mlperf,inference,{var}', @@ -96,8 +96,8 @@ } } } - print(cm_input) - r = cmind.access(cm_input) + print(mlc_input) + r = mlc.access(cm_input) if r['return'] > 0: print(r) # exit(1) diff --git a/script/run-mlperf-inference-mobilenet-models/customize.py b/script/run-mlperf-inference-mobilenet-models/customize.py index b6aabca6b..4101f3d52 100644 --- a/script/run-mlperf-inference-mobilenet-models/customize.py +++ b/script/run-mlperf-inference-mobilenet-models/customize.py @@ -1,6 +1,6 @@ -from cmind import utils +from mlc import utils import os -import cmind +import mlc import sys @@ -132,7 +132,7 @@ def preprocess(i): if model == "efficientnet" and precision == "uint8": precision = "int8" - cm_input = { + mlc_input = { 'action': 'run', 'automation': 'script', 'tags': f'generate-run-cmds,mlperf,inference,{var}', @@ -157,37 +157,37 @@ def preprocess(i): } if add_deps_recursive: # script automation will merge adr and add_deps_recursive - cm_input['add_deps_recursive'] = add_deps_recursive + mlc_input['add_deps_recursive'] = add_deps_recursive if adr: utils.merge_dicts( - {'dict1': cm_input['adr'], 'dict2': adr, 'append_lists': True, 'append_unique': True}) + {'dict1': mlc_input['adr'], 'dict2': adr, 'append_lists': True, 'append_unique': True}) if env.get('CM_MLPERF_INFERENCE_RESULTS_DIR', '') != '': - cm_input['results_dir'] = env['CM_MLPERF_INFERENCE_RESULTS_DIR'] + mlc_input['results_dir'] = env['CM_MLPERF_INFERENCE_RESULTS_DIR'] if env.get('CM_MLPERF_INFERENCE_SUBMISSION_DIR', '') != '': - cm_input['submission_dir'] = env['CM_MLPERF_INFERENCE_SUBMISSION_DIR'] + mlc_input['submission_dir'] = env['CM_MLPERF_INFERENCE_SUBMISSION_DIR'] if env.get('CM_MLPERF_FIND_PERFORMANCE_MODE', '') == "yes" and env.get( 'CM_MLPERF_NO_RERUN', '') != 'yes': - cm_input['rerun'] = True + mlc_input['rerun'] = True if env.get('CM_MLPERF_POWER', '') == "yes": - cm_input['power'] = 'yes' + mlc_input['power'] = 'yes' if env.get('CM_MLPERF_ACCURACY_MODE', '') == "yes": - cm_input['mode'] = 'accuracy' - print(cm_input) - r = cmind.access(cm_input) + mlc_input['mode'] = 'accuracy' + print(mlc_input) + r = cmind.access(mlc_input) if r['return'] > 0: return r if env.get('CM_MLPERF_PERFORMANCE_MODE', '') == "yes": - cm_input['mode'] = 'performance' + mlc_input['mode'] = 'performance' - print(cm_input) - r = cmind.access(cm_input) + print(mlc_input) + r = mlc.access(mlc_input) if r['return'] > 0: return r @@ -202,7 +202,7 @@ def preprocess(i): 'v': verbose, 'f': 'True' } - r = cmind.access(clean_input) + r = mlc.access(clean_input) # if r['return'] > 0: # return r return {'return': 0} diff --git a/script/run-mlperf-inference-mobilenet-models/_cm.yaml b/script/run-mlperf-inference-mobilenet-models/meta.yaml similarity index 100% rename from script/run-mlperf-inference-mobilenet-models/_cm.yaml rename to script/run-mlperf-inference-mobilenet-models/meta.yaml diff --git a/script/run-mlperf-inference-submission-checker/customize.py b/script/run-mlperf-inference-submission-checker/customize.py index dc6cf4bba..ddb6f7c60 100644 --- a/script/run-mlperf-inference-submission-checker/customize.py +++ b/script/run-mlperf-inference-submission-checker/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os import subprocess diff --git a/script/run-mlperf-inference-submission-checker/_cm.yaml b/script/run-mlperf-inference-submission-checker/meta.yaml similarity index 100% rename from script/run-mlperf-inference-submission-checker/_cm.yaml rename to script/run-mlperf-inference-submission-checker/meta.yaml diff --git a/script/run-mlperf-power-client/customize.py b/script/run-mlperf-power-client/customize.py index 49e55c38b..b93d9e121 100644 --- a/script/run-mlperf-power-client/customize.py +++ b/script/run-mlperf-power-client/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os import configparser diff --git a/script/run-mlperf-power-client/_cm.yaml b/script/run-mlperf-power-client/meta.yaml similarity index 100% rename from script/run-mlperf-power-client/_cm.yaml rename to script/run-mlperf-power-client/meta.yaml diff --git a/script/run-mlperf-power-server/customize.py b/script/run-mlperf-power-server/customize.py index bcdbe542e..0593bc170 100644 --- a/script/run-mlperf-power-server/customize.py +++ b/script/run-mlperf-power-server/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os import configparser diff --git a/script/run-mlperf-power-server/_cm.yaml b/script/run-mlperf-power-server/meta.yaml similarity index 100% rename from script/run-mlperf-power-server/_cm.yaml rename to script/run-mlperf-power-server/meta.yaml diff --git a/script/run-mlperf-training-submission-checker/customize.py b/script/run-mlperf-training-submission-checker/customize.py index 606047b51..3dba45eb6 100644 --- a/script/run-mlperf-training-submission-checker/customize.py +++ b/script/run-mlperf-training-submission-checker/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os import subprocess diff --git a/script/run-mlperf-training-submission-checker/_cm.yaml b/script/run-mlperf-training-submission-checker/meta.yaml similarity index 100% rename from script/run-mlperf-training-submission-checker/_cm.yaml rename to script/run-mlperf-training-submission-checker/meta.yaml diff --git a/script/run-python/_cm.yaml b/script/run-python/meta.yaml similarity index 100% rename from script/run-python/_cm.yaml rename to script/run-python/meta.yaml diff --git a/script/run-terraform/customize.py b/script/run-terraform/customize.py index b1939f15c..5d9aa83a5 100644 --- a/script/run-terraform/customize.py +++ b/script/run-terraform/customize.py @@ -1,5 +1,5 @@ -from cmind import utils -import cmind as cm +from mlc import utils +import mlc import os import shutil import json @@ -62,10 +62,8 @@ def postprocess(i): "sudo apt-get update", "sudo apt-get -y upgrade", "sudo apt-get install -y python3-pip", - "python3 -m pip install cmind", - "source ~/.profile", - "cm pull repo ctuning@mlcommons-ck", - "cm run script --tags=get,sys-utils-cm" + "python3 -m pip install mlc", + "source ~/.profile" ] } if env.get('CM_TERRAFORM_RUN_COMMANDS'): @@ -74,7 +72,7 @@ def postprocess(i): cmd = cmd.replace(":", "=") cmd = cmd.replace(";;", ",") run_input['run_cmds'].append(cmd) - r = cm.access(run_input) + r = mlc.access(run_input) if r['return'] > 0: return r # print(r) diff --git a/script/run-terraform/_cm.yaml b/script/run-terraform/meta.yaml similarity index 100% rename from script/run-terraform/_cm.yaml rename to script/run-terraform/meta.yaml diff --git a/script/run-vllm-server/customize.py b/script/run-vllm-server/customize.py index d9b7a26b0..f8abd76c0 100644 --- a/script/run-vllm-server/customize.py +++ b/script/run-vllm-server/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import subprocess diff --git a/script/run-vllm-server/_cm.yaml b/script/run-vllm-server/meta.yaml similarity index 100% rename from script/run-vllm-server/_cm.yaml rename to script/run-vllm-server/meta.yaml diff --git a/script/runtime-system-infos/customize.py b/script/runtime-system-infos/customize.py index 3428ccf3f..c271bbda2 100644 --- a/script/runtime-system-infos/customize.py +++ b/script/runtime-system-infos/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os import shutil # used to measure the system infos(have not tested for obtaining gpu info) diff --git a/script/runtime-system-infos/_cm.yaml b/script/runtime-system-infos/meta.yaml similarity index 100% rename from script/runtime-system-infos/_cm.yaml rename to script/runtime-system-infos/meta.yaml diff --git a/script/save-mlperf-inference-implementation-state/customize.py b/script/save-mlperf-inference-implementation-state/customize.py index 07e716955..a7d920cd8 100644 --- a/script/save-mlperf-inference-implementation-state/customize.py +++ b/script/save-mlperf-inference-implementation-state/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os @@ -20,7 +20,7 @@ def preprocess(i): return {'return': 0} if env.get('CM_MLPERF_README', "") == "yes": - import cmind as cm + import mlc inp = i['input'] script_tags = state['mlperf-inference-implementation'].get( @@ -29,18 +29,18 @@ def preprocess(i): 'script_adr', {}) if script_tags != '': - cm_input = {'action': 'run', - 'automation': 'script', - 'tags': script_tags, - 'adr': script_adr, - 'env': env, - 'print_deps': True, - 'quiet': True, - 'silent': True, - 'fake_run': True - } - - r = cm.access(cm_input) + mlc_input = {'action': 'run', + 'automation': 'script', + 'tags': script_tags, + 'adr': script_adr, + 'env': env, + 'print_deps': True, + 'quiet': True, + 'silent': True, + 'fake_run': True + } + + r = mlc.access(cm_input) if r['return'] > 0: return r diff --git a/script/save-mlperf-inference-implementation-state/_cm.yaml b/script/save-mlperf-inference-implementation-state/meta.yaml similarity index 100% rename from script/save-mlperf-inference-implementation-state/_cm.yaml rename to script/save-mlperf-inference-implementation-state/meta.yaml diff --git a/script/set-device-settings-qaic/customize.py b/script/set-device-settings-qaic/customize.py index 3f3e179f7..1e87f2dad 100644 --- a/script/set-device-settings-qaic/customize.py +++ b/script/set-device-settings-qaic/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/set-device-settings-qaic/_cm.yaml b/script/set-device-settings-qaic/meta.yaml similarity index 100% rename from script/set-device-settings-qaic/_cm.yaml rename to script/set-device-settings-qaic/meta.yaml diff --git a/script/set-echo-off-win/customize.py b/script/set-echo-off-win/customize.py index 287737629..ee9f4ef57 100644 --- a/script/set-echo-off-win/customize.py +++ b/script/set-echo-off-win/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/set-echo-off-win/_cm.yaml b/script/set-echo-off-win/meta.yaml similarity index 100% rename from script/set-echo-off-win/_cm.yaml rename to script/set-echo-off-win/meta.yaml diff --git a/script/set-performance-mode/customize.py b/script/set-performance-mode/customize.py index 288ebc9c0..61c4f844c 100644 --- a/script/set-performance-mode/customize.py +++ b/script/set-performance-mode/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/set-performance-mode/_cm.yaml b/script/set-performance-mode/meta.yaml similarity index 100% rename from script/set-performance-mode/_cm.yaml rename to script/set-performance-mode/meta.yaml diff --git a/script/set-sqlite-dir/_cm.yaml b/script/set-sqlite-dir/meta.yaml similarity index 100% rename from script/set-sqlite-dir/_cm.yaml rename to script/set-sqlite-dir/meta.yaml diff --git a/script/set-user-limits/customize.py b/script/set-user-limits/customize.py index ff5767250..22a38fa91 100644 --- a/script/set-user-limits/customize.py +++ b/script/set-user-limits/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/set-user-limits/_cm.yaml b/script/set-user-limits/meta.yaml similarity index 100% rename from script/set-user-limits/_cm.yaml rename to script/set-user-limits/meta.yaml diff --git a/script/set-venv/customize.py b/script/set-venv/customize.py index 757287bde..4bb0912d4 100644 --- a/script/set-venv/customize.py +++ b/script/set-venv/customize.py @@ -1,4 +1,4 @@ -from cmind import utils +from mlc import utils import os diff --git a/script/set-venv/_cm.yaml b/script/set-venv/meta.yaml similarity index 100% rename from script/set-venv/_cm.yaml rename to script/set-venv/meta.yaml diff --git a/script/submit-mlperf-results/customize.py b/script/submit-mlperf-results/customize.py index d39b233f3..918b16c4b 100644 --- a/script/submit-mlperf-results/customize.py +++ b/script/submit-mlperf-results/customize.py @@ -1,6 +1,5 @@ import requests -from cmind import utils -import cmind as cm +from mlc import utils import os import json diff --git a/script/submit-mlperf-results/_cm.yaml b/script/submit-mlperf-results/meta.yaml similarity index 100% rename from script/submit-mlperf-results/_cm.yaml rename to script/submit-mlperf-results/meta.yaml diff --git a/script/tar-my-folder/customize.py b/script/tar-my-folder/customize.py index c1d8498b8..37dfd2271 100644 --- a/script/tar-my-folder/customize.py +++ b/script/tar-my-folder/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os import subprocess from os.path import exists diff --git a/script/tar-my-folder/_cm.yaml b/script/tar-my-folder/meta.yaml similarity index 100% rename from script/tar-my-folder/_cm.yaml rename to script/tar-my-folder/meta.yaml diff --git a/script/test-cm-core/COPYRIGHT.md b/script/test-cm-core/COPYRIGHT.md deleted file mode 100644 index a059b0c49..000000000 --- a/script/test-cm-core/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2024-2025 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/test-cm-core/README-extra.md b/script/test-cm-core/README-extra.md deleted file mode 100644 index 582991f6d..000000000 --- a/script/test-cm-core/README-extra.md +++ /dev/null @@ -1 +0,0 @@ -# CM script diff --git a/script/test-cm-core/README.md b/script/test-cm-core/README.md deleted file mode 100644 index e2626fc25..000000000 --- a/script/test-cm-core/README.md +++ /dev/null @@ -1 +0,0 @@ -Please see [https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-cm-core](https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-cm-core) for the documentation of this CM script. diff --git a/script/test-cm-core/_cm.yaml b/script/test-cm-core/_cm.yaml deleted file mode 100644 index 420d119f8..000000000 --- a/script/test-cm-core/_cm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -alias: test-cm-core -uid: 2c2fb9d20dc64cf3 - -automation_alias: script -automation_uid: 5b4e0237da074764 - -category: Tests - -tags: -- test -- cm -- core - -cache: false diff --git a/script/test-cm-core/customize.py b/script/test-cm-core/customize.py deleted file mode 100644 index c3289f345..000000000 --- a/script/test-cm-core/customize.py +++ /dev/null @@ -1,17 +0,0 @@ -from cmind import utils -import os - - -def preprocess(i): - - os_info = i['os_info'] - - env = i['env'] - - meta = i['meta'] - - automation = i['automation'] - - quiet = (env.get('CM_QUIET', False) == 'yes') - - return {'return': 0} diff --git a/script/test-cm-core/run.bat b/script/test-cm-core/run.bat deleted file mode 100644 index 271224ef9..000000000 --- a/script/test-cm-core/run.bat +++ /dev/null @@ -1,3 +0,0 @@ -rem native script - -echo "TBD" diff --git a/script/test-cm-core/run.sh b/script/test-cm-core/run.sh deleted file mode 100644 index 997c0c33e..000000000 --- a/script/test-cm-core/run.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -#CM Script location: ${CM_TMP_CURRENT_SCRIPT_PATH} - -#To export any variable -#echo "VARIABLE_NAME=VARIABLE_VALUE" >>tmp-run-env.out - -#${CM_PYTHON_BIN_WITH_PATH} contains the path to python binary if "get,python" is added as a dependency - -echo "TBD" - -#Add your run commands here... -# run "$CM_RUN_CMD" diff --git a/script/test-cm-core/src/script/check.py b/script/test-cm-core/src/script/check.py deleted file mode 100644 index 4883116c0..000000000 --- a/script/test-cm-core/src/script/check.py +++ /dev/null @@ -1,16 +0,0 @@ -def check_return(r): - if 'return' not in r: - raise Exception( - 'CM access function should always return key \'return\'!') - if 'error' in r: - raise Exception(r['error']) - - -def check_list(r, string, found=True): - check_return(r) - if 'list' not in r: - raise Exception('CM search should return a list!') - if len(r['list']) < 1 and found: - raise Exception('CM search returned an empty list for ' + string) - if len(r['list']) > 0 and not found: - raise Exception('CM search returned at lease one entry for ' + string) diff --git a/script/test-cm-core/src/script/process_dockerfile.py b/script/test-cm-core/src/script/process_dockerfile.py deleted file mode 100644 index 1d23ec601..000000000 --- a/script/test-cm-core/src/script/process_dockerfile.py +++ /dev/null @@ -1,33 +0,0 @@ -import sys -import os -import cmind as cm -import check as checks -import json -import yaml - -files = sys.argv[1:] - -for file in files: - if not os.path.isfile(file): - continue - if not file.endswith("_cm.json") and not file.endswith("_cm.yaml"): - continue - if not file.startswith(os.path.join("script")): - continue - - script_path = os.path.dirname(file) - - f = open(file) - - if file.endswith(".json"): - data = json.load(f) - elif file.endswith(".yaml"): - data = yaml.safe_load(f) - - uid = data['uid'] - - r = cm.access({'action': 'dockerfile', - 'automation': 'script', - 'artifact': uid, - 'quiet': 'yes'}) - checks.check_return(r) diff --git a/script/test-cm-core/src/script/process_readme.py b/script/test-cm-core/src/script/process_readme.py deleted file mode 100644 index 03daec793..000000000 --- a/script/test-cm-core/src/script/process_readme.py +++ /dev/null @@ -1,27 +0,0 @@ -import sys -import os -import cmind as cm -import check as checks -import json -import yaml - -files = sys.argv[1:] - -for file in files: - if not os.path.isfile(file): - continue - if not file.endswith("_cm.json") and not file.endswith("_cm.yaml"): - continue - if not file.startswith(os.path.join("script")): - continue - script_path = os.path.dirname(file) - f = open(file) - if file.endswith(".json"): - data = json.load(f) - elif file.endswith(".yaml"): - data = yaml.safe_load(f) - uid = data['uid'] - - r = cm.access({'action': 'doc', 'automation': 'script', - 'artifact': uid, 'quiet': 'yes'}) - checks.check_return(r) diff --git a/script/test-cm-core/src/script/test_deps.py b/script/test-cm-core/src/script/test_deps.py deleted file mode 100644 index 37d75fd4c..000000000 --- a/script/test-cm-core/src/script/test_deps.py +++ /dev/null @@ -1,25 +0,0 @@ -# This test covers version, variation, compilation from src, add_deps, -# add_deps_recursive, deps, post_deps - -import cmind as cm -import check as checks - -# MLPerf v3.0 inference is now very outdated and we are testing inference -# in separate tests - -# r = cm.access({'action':'run', 'automation':'script', 'tags': 'generate-run-cmds,mlperf', 'adr': -# {'loadgen': {'version': 'r3.0'}, 'compiler': {'tags': "gcc"}}, 'env': {'CM_MODEL': 'resnet50', -# 'CM_DEVICE': 'cpu', 'CM_BACKEND': 'onnxruntime'}, 'quiet': 'yes'}) -# checks.check_return(r) -# -# r = cm.access({'action':'search', 'automation': 'cache', 'tags': 'loadgen,version-r3.0,deps-python-non-virtual'}) -# checks.check_list(r, "loadgen,version-r3.0,deps-python-non-virtual") -# -# r = cm.access({'action':'search', 'automation': 'cache', 'tags': 'inference,src,version-r3.0'}) -# checks.check_list(r, "inference,src,version-r3.0") -# -# r = cm.access({'action':'run', 'automation':'script', 'tags': 'app,mlperf,inference,generic,_python,_resnet50,_onnxruntime,_cpu,_r3.0_default', 'adr': {'mlperf-implementation': { 'version': 'master'}}, 'quiet': 'yes'}) -# checks.check_return(r) -# -# r = cm.access({'action':'run', 'automation':'script', 'tags': 'app,mlperf,inference,generic,_python,_resnet50,_tf,_cpu,_r3.0_default', 'adr': {'mlperf-implementation': { 'version': 'master'}}, 'quiet': 'yes'}) -# checks.check_return(r) diff --git a/script/test-cm-core/src/script/test_docker.py b/script/test-cm-core/src/script/test_docker.py deleted file mode 100644 index 1b63631c6..000000000 --- a/script/test-cm-core/src/script/test_docker.py +++ /dev/null @@ -1,39 +0,0 @@ -# This test covers version, variation, compilation from src, -# add_deps_recursive, post_deps - -import cmind as cm -import check as checks - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'run,docker,container', - 'add_deps_recursive': { - 'compiler': {'tags': "gcc"} - }, - 'docker_cm_repo': 'mlcommons@mlperf-automations', - 'image_name': 'cm-script-app-image-classification-onnx-py', - 'env': { - 'CM_DOCKER_RUN_SCRIPT_TAGS': 'app,image-classification,onnx,python', - 'CM_DOCKER_IMAGE_BASE': 'ubuntu:22.04', - 'CM_DOCKER_IMAGE_REPO': 'cknowledge' - }, - 'quiet': 'yes' - }) -checks.check_return(r) - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'run,docker,container', - 'add_deps_recursive': { - 'compiler': {'tags': "gcc"} - }, - 'docker_cm_repo': 'mlcommons@mlperf-automations', - 'image_name': 'cm-script-app-image-classification-onnx-py', - 'env': { - 'CM_DOCKER_RUN_SCRIPT_TAGS': 'app,image-classification,onnx,python', - 'CM_DOCKER_IMAGE_BASE': 'ubuntu:24.04', - 'CM_DOCKER_IMAGE_REPO': 'local' - }, - 'quiet': 'yes' - }) -checks.check_return(r) diff --git a/script/test-cm-core/src/script/test_features.py b/script/test-cm-core/src/script/test_features.py deleted file mode 100644 index fa8ccb706..000000000 --- a/script/test-cm-core/src/script/test_features.py +++ /dev/null @@ -1,55 +0,0 @@ -# This test covers -# 1. python-virtual-env and update_deps inside customize.py -# 2. cache search using "-" prefix - -import cmind as cm -import check as checks - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'install,python-venv', - 'name': 'test', - 'quiet': 'yes'}) -checks.check_return(r) - -r = cm.access({'action': 'search', 'automation': 'cache', - 'tags': 'get,python,virtual,name-test'}) -checks.check_list(r, "get,python-venv") - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'get,dataset,preprocessed,imagenet,_NHWC', - 'quiet': 'yes'}) -checks.check_return(r) - -r = cm.access({'action': 'search', 'automation': 'cache', - 'tags': 'get,dataset,preprocessed,imagenet,-_NCHW'}) -checks.check_list(r, "_NHWC") - -r = cm.access({'action': 'search', 'automation': 'cache', - 'tags': 'get,dataset,preprocessed,imagenet,-_NHWC'}) -checks.check_list(r, "_NHWC", False) - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'get,generic-python-lib,_package.scipy', - 'version': '1.9.3', - 'quiet': 'yes'}) - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'get,generic-python-lib,_package.scipy', - 'version': '1.9.2', - 'quiet': 'yes'}) - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'get,generic-python-lib,_package.scipy', - 'version': '1.9.3', - 'only_execute_from_cache': True, - 'quiet': 'yes'}) - -# r should return error -if 'error' not in r: - print(r) - raise Exception('Invalidated cache entry for scipy==1.9.3 found in cache') diff --git a/script/test-cm-core/src/script/test_install.py b/script/test-cm-core/src/script/test_install.py deleted file mode 100644 index d4fb93ec7..000000000 --- a/script/test-cm-core/src/script/test_install.py +++ /dev/null @@ -1,15 +0,0 @@ -# This test covers script installation, version, shared library install - -import cmind as cm -import check as checks - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'python,src,install,_shared', - 'version': '3.9.10', - 'quiet': 'true'}) -checks.check_return(r) - -r = cm.access({'action': 'search', 'automation': 'cache', - 'tags': 'python,src,install,_shared,version-3.9.10'}) -checks.check_list(r, "python,src,install,_shared,version-3.9.10") diff --git a/script/test-cm-core/src/test_cm.py b/script/test-cm-core/src/test_cm.py deleted file mode 100644 index 821e1571d..000000000 --- a/script/test-cm-core/src/test_cm.py +++ /dev/null @@ -1,17 +0,0 @@ -try: - import cmind as cm - - r = cm.access(['test', 'script']) - if 'return' not in r: - raise Exception( - 'CM access function should always return key \'return\'!') - exit(0) - -except ImportError as e: - from sys import stderr - from subprocess import call - print( - 'WARNING: CM module for python is not installed & jupyter notebooks will not be supported', - file=stderr) - retcode = call(['cm', 'test', 'script']) - exit(retcode) diff --git a/script/test-cm-core/src/test_search_speed.py b/script/test-cm-core/src/test_search_speed.py deleted file mode 100644 index 577c4f0b8..000000000 --- a/script/test-cm-core/src/test_search_speed.py +++ /dev/null @@ -1,26 +0,0 @@ -import cmind as cm -import time - -times = [] - -steps = 10 - -print('Running search with tags {} times ...'.format(steps)) - -for step in range(steps): - - start = time.time() - r = cm.access({'action': 'search', - 'automation': 'script', - 'tags': 'detect,os'}) - timer = time.time() - start - - if r['return'] > 0: - cm.error(r) - - times.append(timer) - -step = 0 -for t in times: - step += 1 - print("{}) {:0.3f} sec.".format(step, t)) diff --git a/script/test-cm-core/src/tutorials/test_tutorial_retinanet.py b/script/test-cm-core/src/tutorials/test_tutorial_retinanet.py deleted file mode 100644 index bc8d22f78..000000000 --- a/script/test-cm-core/src/tutorials/test_tutorial_retinanet.py +++ /dev/null @@ -1,37 +0,0 @@ -# This test covers version, variation, compilation from src, add_deps, -# add_deps_recursive, deps, post_deps - -import cmind as cm -from pathlib import Path -import sys -import os - -sys.path.insert( - 1, - os.path.join( - Path(__file__).parent.parent.resolve(), - "script")) -import check as checks # noqa - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'app,mlperf,inference,generic,_cpp,_retinanet,_onnxruntime,_cpu', 'adr': - {'python': {'version_min': '3.8'}, 'compiler': {'tags': "gcc"}, 'openimages-preprocessed': {'tags': '_50'}}, 'scenario': 'Offline', - 'mode': 'accuracy', 'test_query_count': '10', 'rerun': 'true', 'quiet': 'yes'}) -checks.check_return(r) - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'app,mlperf,inference,generic,_cpp,_retinanet,_onnxruntime,_cpu', 'adr': - {'python': {'version_min': '3.8'}, 'compiler': {'tags': "gcc"}, 'openimages-preprocessed': {'tags': '_50'}}, 'scenario': 'Offline', - 'mode': 'performance', 'test_query_count': '10', 'rerun': 'true', 'quiet': 'yes'}) -checks.check_return(r) - -r = cm.access({'action': 'run', - 'automation': 'script', - 'tags': 'install,python-venv', - 'version': '3.10.8', - 'name': 'mlperf'}) -checks.check_return(r) - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds,_submission,_short', 'adr': - {'python': {'name': 'mlperf', 'version_min': '3.8'}, 'compiler': {'tags': "gcc"}, 'openimages-preprocessed': {'tags': '_50'}}, 'submitter': 'Community', - 'implementation': 'cpp', 'hw_name': 'default', 'model': 'retinanet', 'backend': 'onnxruntime', 'device': 'cpu', 'scenario': 'Offline', - 'test_query_count': '10', 'clean': 'true', 'quiet': 'yes'}) -checks.check_return(r) diff --git a/script/test-cm-core/src/tutorials/test_tutorial_tvm.py b/script/test-cm-core/src/tutorials/test_tutorial_tvm.py deleted file mode 100644 index 4b621ebe8..000000000 --- a/script/test-cm-core/src/tutorials/test_tutorial_tvm.py +++ /dev/null @@ -1,28 +0,0 @@ -# This test covers version, variation, compilation from src, add_deps, -# add_deps_recursive, deps, post_deps - -import cmind as cm - -from pathlib import Path -import sys -import os - -sys.path.insert( - 1, - os.path.join( - Path(__file__).parent.parent.resolve(), - "script")) -import check as checks # noqa - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds', 'adr': - {'python': {'name': 'mlperf', 'version_min': '3.8'}}, 'submitter': 'Community', - 'implementation': 'python', 'hw_name': 'default', 'model': 'resnet50', 'backend': 'tvm-onnx', 'device': 'cpu', 'scenario': 'Offline', - 'mode': 'accuracy', 'test_query_count': '5', 'clean': 'true', 'quiet': 'yes'}) -checks.check_return(r) - - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds,_submission,_dashboard', 'adr': - {'python': {'name': 'mlperf', 'version_min': '3.8'}}, 'submitter': 'Community', - 'implementation': 'python', 'hw_name': 'default', 'model': 'resnet50', 'backend': 'tvm-onnx', 'device': 'cpu', 'scenario': 'Offline', - 'test_query_count': '500', 'clean': 'true', 'quiet': 'yes'}) -checks.check_return(r) diff --git a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py b/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py deleted file mode 100644 index 4e17d572d..000000000 --- a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_ge.py +++ /dev/null @@ -1,26 +0,0 @@ -import cmind as cm - -from pathlib import Path -import sys -import os - -sys.path.insert( - 1, - os.path.join( - Path(__file__).parent.parent.resolve(), - "script")) -import check as checks # noqa - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds', 'adr': - {'python': {'name': 'mlperf', 'version_min': '3.8'}, 'tvm': { - 'tags': '_pip-install'}, 'tvm-model': {'tags': '_graph_executor'}}, - 'submitter': 'Community', 'implementation': 'python', 'hw_name': 'default', 'model': 'resnet50', 'backend': 'tvm-onnx', - 'device': 'cpu', 'scenario': 'Offline', 'mode': 'accuracy', 'test_query_count': '5', 'clean': 'true', 'quiet': 'yes'}) -checks.check_return(r) - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds,_submission,_short', 'adr': - {'python': {'name': 'mlperf', 'version_min': '3.8'}, 'tvm': { - 'tags': '_pip-install'}, 'tvm-model': {'tags': '_graph_executor'}}, - 'submitter': 'Community', 'implementation': 'python', 'hw_name': 'default', 'model': 'resnet50', 'backend': 'tvm-onnx', - 'device': 'cpu', 'scenario': 'Offline', 'test_query_count': '500', 'clean': 'true', 'quiet': 'yes'}) -checks.check_return(r) diff --git a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py b/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py deleted file mode 100644 index 28bc0132b..000000000 --- a/script/test-cm-core/src/tutorials/test_tutorial_tvm_pip_vm.py +++ /dev/null @@ -1,27 +0,0 @@ -# This test covers version, variation, compilation from src, add_deps, -# add_deps_recursive, deps, post_deps - -import cmind as cm - -from pathlib import Path -import sys -import os - -sys.path.insert( - 1, - os.path.join( - Path(__file__).parent.parent.resolve(), - "script")) -import check as checks # noqa - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds', 'adr': - {'python': {'name': 'mlperf', 'version_min': '3.8'}, 'tvm': {'tags': '_pip-install'}}, 'submitter': 'Community', - 'implementation': 'python', 'hw_name': 'default', 'model': 'resnet50', 'backend': 'tvm-onnx', 'device': 'cpu', 'scenario': 'Offline', - 'mode': 'accuracy', 'test_query_count': '5', 'clean': 'true', 'quiet': 'yes'}) -checks.check_return(r) - -r = cm.access({'action': 'run', 'automation': 'script', 'tags': 'run,mlperf,inference,generate-run-cmds,_submission,_short', 'adr': - {'python': {'name': 'mlperf', 'version_min': '3.8'}, 'tvm': {'tags': '_pip-install'}}, 'submitter': 'Community', - 'implementation': 'python', 'hw_name': 'default', 'model': 'resnet50', 'backend': 'tvm-onnx', 'device': 'cpu', 'scenario': 'Offline', - 'test_query_count': '500', 'clean': 'true', 'quiet': 'yes'}) -checks.check_return(r) diff --git a/script/test-cm-script-pipeline/COPYRIGHT.md b/script/test-cm-script-pipeline/COPYRIGHT.md deleted file mode 100644 index a059b0c49..000000000 --- a/script/test-cm-script-pipeline/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2024-2025 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/test-cm-script-pipeline/README-extra.md b/script/test-cm-script-pipeline/README-extra.md deleted file mode 100644 index 480bea4f4..000000000 --- a/script/test-cm-script-pipeline/README-extra.md +++ /dev/null @@ -1,8 +0,0 @@ -# CM script - -This script prints internal pipeline run: - -```bash -cmr "test cm-script pipeline" -``` - diff --git a/script/test-cm-script-pipeline/README.md b/script/test-cm-script-pipeline/README.md deleted file mode 100644 index 1c6e7b38a..000000000 --- a/script/test-cm-script-pipeline/README.md +++ /dev/null @@ -1 +0,0 @@ -Please see [https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-cm-script-pipeline](https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-cm-script-pipeline) for the documentation of this CM script. diff --git a/script/test-cm-script-pipeline/_cm.yaml b/script/test-cm-script-pipeline/_cm.yaml deleted file mode 100644 index 9a2327ae6..000000000 --- a/script/test-cm-script-pipeline/_cm.yaml +++ /dev/null @@ -1,37 +0,0 @@ -alias: test-cm-script-pipeline -uid: ebe50aa281be4458 - -automation_alias: script -automation_uid: 5b4e0237da074764 - -category: Tests - -developers: "Grigori Fursin" - -tags: -- test -- cm-script -- pipeline - -cache: false - -deps: -- tags: print,any-text - env: - CM_PRINT_ANY_TEXT: "_cm.yaml: deps" - -prehook_deps: -- tags: print,any-text - env: - CM_PRINT_ANY_TEXT: "_cm.yaml: prehook_deps" - -posthook_deps: -- tags: print,any-text - env: - CM_PRINT_ANY_TEXT: "_cm.yaml: posthook_deps" - -post_deps: -- tags: print,any-text - env: - CM_PRINT_ANY_TEXT: "_cm.yaml: post_deps" - CM_PRINT_ANY_CM_ENV_KEYS: 'CM_TMP_CURRENT_SCRIPT_PATH,CM_TMP_CURRENT_PATH,CM_QUIET' diff --git a/script/test-cm-script-pipeline/customize.py b/script/test-cm-script-pipeline/customize.py deleted file mode 100644 index d05326d93..000000000 --- a/script/test-cm-script-pipeline/customize.py +++ /dev/null @@ -1,40 +0,0 @@ -# Developers: Grigori Fursin - -from cmind import utils -import os - - -def preprocess(i): - - print('') - print('customize.py: preprocess') - print('') - - return {'return': 0} - - -def postprocess(i): - - automation = i['automation'] - run_script_input = i['run_script_input'] - env = i['env'] - - print('') - print('customize.py: postprocess') - print('') - - r = automation.run_native_script( - {'run_script_input': run_script_input, 'env': env, 'script_name': 'run2'}) - if r['return'] > 0: - return r - - return {'return': 0} - - -def detect_version(i): - - print('') - print('customize.py: detect_version') - print('') - - return {'return': 0} diff --git a/script/test-cm-script-pipeline/run.bat b/script/test-cm-script-pipeline/run.bat deleted file mode 100644 index 3103960b7..000000000 --- a/script/test-cm-script-pipeline/run.bat +++ /dev/null @@ -1,5 +0,0 @@ -rem native script - -echo. -echo run.bat -echo. diff --git a/script/test-cm-script-pipeline/run.sh b/script/test-cm-script-pipeline/run.sh deleted file mode 100644 index 51936abac..000000000 --- a/script/test-cm-script-pipeline/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "" -echo "run.sh" -echo "" diff --git a/script/test-cm-script-pipeline/run2.bat b/script/test-cm-script-pipeline/run2.bat deleted file mode 100644 index 120bd24a8..000000000 --- a/script/test-cm-script-pipeline/run2.bat +++ /dev/null @@ -1,5 +0,0 @@ -rem native script - -echo. -echo run2.bat -echo. diff --git a/script/test-cm-script-pipeline/run2.sh b/script/test-cm-script-pipeline/run2.sh deleted file mode 100644 index 21664817b..000000000 --- a/script/test-cm-script-pipeline/run2.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo "" -echo "run2.sh" -echo "" diff --git a/script/test-cm-scripts/COPYRIGHT.md b/script/test-cm-scripts/COPYRIGHT.md deleted file mode 100644 index a059b0c49..000000000 --- a/script/test-cm-scripts/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2024-2025 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/test-cm-scripts/_cm.yaml b/script/test-cm-scripts/_cm.yaml deleted file mode 100644 index b8b7a9c79..000000000 --- a/script/test-cm-scripts/_cm.yaml +++ /dev/null @@ -1,31 +0,0 @@ -alias: test-cm-scripts -automation_alias: script -automation_uid: 5b4e0237da074764 -cache: false -tags: -- test -- test-scripts -- cm-test -env: - CM_VAR1: orig -const: - CM_CVAR1: orig -new_env_keys: - - CM_VAR* - - CM_CVAR* - -uid: 6fbe3884575c4e51 -variations: - v1: - env: - CM_VAR1: v1 - v2: - env: - CM_VAR1: v2 - CM_VAR2: v2 - const: - CM_VAR2: constv2 - v1,v2: - env: - CM_VAR1: combv1v2 - CM_VAR2: combv1v2 diff --git a/script/test-cm-scripts/customize.py b/script/test-cm-scripts/customize.py deleted file mode 100644 index 273999d46..000000000 --- a/script/test-cm-scripts/customize.py +++ /dev/null @@ -1,24 +0,0 @@ -from cmind import utils -import os - - -def preprocess(i): - - os_info = i['os_info'] - - env = i['env'] - - meta = i['meta'] - - automation = i['automation'] - - quiet = (env.get('CM_QUIET', False) == 'yes') - - return {'return': 0} - - -def postprocess(i): - - env = i['env'] - - return {'return': 0} diff --git a/script/test-cm-scripts/run.bat b/script/test-cm-scripts/run.bat deleted file mode 100644 index 648302ca7..000000000 --- a/script/test-cm-scripts/run.bat +++ /dev/null @@ -1 +0,0 @@ -rem native script diff --git a/script/test-cm-scripts/run.sh b/script/test-cm-scripts/run.sh deleted file mode 100644 index 4c23c380e..000000000 --- a/script/test-cm-scripts/run.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -#CM Script location: ${CM_TMP_CURRENT_SCRIPT_PATH} - -#To export any variable -#echo "VARIABLE_NAME=VARIABLE_VALUE" >>tmp-run-env.out - -#${CM_PYTHON_BIN_WITH_PATH} contains the path to python binary if "get,python" is added as a dependency - -echo "Running: " -echo "${CM_RUN_CMD}" -echo "" - -if [[ ${CM_FAKE_RUN} != "yes" ]]; then - eval "${CM_RUN_CMD}" - test $? -eq 0 || exit 1 -fi diff --git a/script/test-debug/.vscode/launch.json b/script/test-debug/.vscode/launch.json deleted file mode 100644 index 49c4e19f0..000000000 --- a/script/test-debug/.vscode/launch.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: Remote Attach", - "type": "debugpy", - "request": "attach", - "connect": { - "host": "localhost", - "port": 5678 - }, - "pathMappings": [ - { - "localRoot": "${workspaceFolder}", - "remoteRoot": "${workspaceFolder}" - } - ] - } -} \ No newline at end of file diff --git a/script/test-debug/COPYRIGHT.md b/script/test-debug/COPYRIGHT.md deleted file mode 100644 index a059b0c49..000000000 --- a/script/test-debug/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2024-2025 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/test-debug/README-extra.md b/script/test-debug/README-extra.md deleted file mode 100644 index 06a41746c..000000000 --- a/script/test-debug/README-extra.md +++ /dev/null @@ -1,20 +0,0 @@ -Demo of debugging CM scripts and wrapped apps with Visual Studio Code. - - -Debug customize.py using remote debugging and follow instructions on command line: - -```bash -cmr "test cm-debug" --debug_uid=8d96cd9fa4734204 -``` - -Debug Python application or tool wrapped by the CM script (see [python/main.py](python/main.py)): - -```bash -cmr "test cm-debug" --debug_uid=45a7c3a500d24a63 -``` - - - -Debug CM internals using standard Python debugging: -* Open _demo.py and start debugging using "Python File" default configuration. - diff --git a/script/test-debug/README.md b/script/test-debug/README.md deleted file mode 100644 index 7854c9e1d..000000000 --- a/script/test-debug/README.md +++ /dev/null @@ -1 +0,0 @@ -Please see [https://docs.mlcommons.org/cm4mlops/scripts/CM-interface-prototyping/test-debug](https://docs.mlcommons.org/cm4mlops/scripts/CM-interface-prototyping/test-debug) for the documentation of this CM script. diff --git a/script/test-debug/_cm.yaml b/script/test-debug/_cm.yaml deleted file mode 100644 index 8a4ab37aa..000000000 --- a/script/test-debug/_cm.yaml +++ /dev/null @@ -1,29 +0,0 @@ -alias: test-debug -uid: 5ccd3d701a9144f9 - -automation_alias: script -automation_uid: 5b4e0237da074764 - -category: CM interface prototyping - -deps: - # Detect host OS features - - tags: detect,os - - # Detect host CPU features - - tags: detect,cpu - - # Get Python - - tags: get,python3 - names: - - python - - python3 - - # May need to use CM in automation recipes - - tags: get,generic-python-lib,_package.cmind - names: - - python-cmind - -tags: -- test -- cm-debug diff --git a/script/test-debug/_demo.py b/script/test-debug/_demo.py deleted file mode 100644 index 878249a74..000000000 --- a/script/test-debug/_demo.py +++ /dev/null @@ -1,9 +0,0 @@ -# Developer: Grigori Fursin - -import cmind -import sys - -print(sys.executable) - -r = cmind.access('run script "test cm-debug"') -print(r) diff --git a/script/test-debug/customize.py b/script/test-debug/customize.py deleted file mode 100644 index 4c1388a1a..000000000 --- a/script/test-debug/customize.py +++ /dev/null @@ -1,40 +0,0 @@ -# Developer(s): Grigori Fursin - -import os - - -def preprocess(i): - - os_info = i['os_info'] - env = i['env'] - meta = i['meta'] - - print("********************************************************") - print('- Importing CM library ...') - import cmind - print(' SUCCESS!') - - cmind.utils.debug_here( - __file__, - port=5678, - text='Debugging customize.py!', - env=env, - env_debug_uid='8d96cd9fa4734204').breakpoint() - - print('') - print('- List CM repos ...') - print('') - r = cmind.access({'action': 'show', 'automation': 'repo', 'out': 'con'}) - print('') - print(' SUCCESS!') - print("********************************************************") - - return {'return': 0} - - -def postprocess(i): - - env = i['env'] - state = i['state'] - - return {'return': 0} diff --git a/script/test-debug/python/.vscode/launch.json b/script/test-debug/python/.vscode/launch.json deleted file mode 100644 index c2dc39156..000000000 --- a/script/test-debug/python/.vscode/launch.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: Remote Attach", - "type": "debugpy", - "request": "attach", - "connect": { - "host": "localhost", - "port": 5678 - }, - "pathMappings": [ - { - "localRoot": "${workspaceFolder}", - "remoteRoot": "${workspaceFolder}" - } - ] - } - ] -} \ No newline at end of file diff --git a/script/test-debug/python/main.py b/script/test-debug/python/main.py deleted file mode 100644 index a00bf6b34..000000000 --- a/script/test-debug/python/main.py +++ /dev/null @@ -1,26 +0,0 @@ -""" -Testing CM debugging - -# Developer(s): Grigori Fursin -""" - -import cmind.utils -import os -import json - -print("Hello World 1") - -env = os.environ - -print('') -print(json.dumps(dict(env), indent=2)) - -# Import cmind to test break points -if os.environ.get('CM_TMP_DEBUG_UID', '') == '45a7c3a500d24a63': - cmind.utils.debug_here( - __file__, - port=5678, - text='Debugging main.py!').breakpoint() - -print('') -print("Hello World 2") diff --git a/script/test-debug/run.bat b/script/test-debug/run.bat deleted file mode 100644 index d45522c1d..000000000 --- a/script/test-debug/run.bat +++ /dev/null @@ -1,6 +0,0 @@ -echo ======================================================== - -%CM_PYTHON_BIN_WITH_PATH% %CM_TMP_CURRENT_SCRIPT_PATH%\python\main.py -IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% - -echo ======================================================== diff --git a/script/test-debug/run.sh b/script/test-debug/run.sh deleted file mode 100644 index ee43341da..000000000 --- a/script/test-debug/run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -echo "========================================================" - -${CM_PYTHON_BIN_WITH_PATH} ${CM_TMP_CURRENT_SCRIPT_PATH}/python/main.py -test $? -eq 0 || exit 1 - -echo ======================================================== diff --git a/script/test-download-and-extract-artifacts/COPYRIGHT.md b/script/test-download-and-extract-artifacts/COPYRIGHT.md deleted file mode 100644 index 2d6a2775e..000000000 --- a/script/test-download-and-extract-artifacts/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2023-2025 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/test-download-and-extract-artifacts/README-extra.md b/script/test-download-and-extract-artifacts/README-extra.md deleted file mode 100644 index 582991f6d..000000000 --- a/script/test-download-and-extract-artifacts/README-extra.md +++ /dev/null @@ -1 +0,0 @@ -# CM script diff --git a/script/test-download-and-extract-artifacts/README.md b/script/test-download-and-extract-artifacts/README.md deleted file mode 100644 index 3a88769c5..000000000 --- a/script/test-download-and-extract-artifacts/README.md +++ /dev/null @@ -1 +0,0 @@ -Please see [https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-download-and-extract-artifacts](https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-download-and-extract-artifacts) for the documentation of this CM script. diff --git a/script/test-download-and-extract-artifacts/_cm.yaml b/script/test-download-and-extract-artifacts/_cm.yaml deleted file mode 100644 index c1961ba30..000000000 --- a/script/test-download-and-extract-artifacts/_cm.yaml +++ /dev/null @@ -1,31 +0,0 @@ -alias: test-download-and-extract-artifacts -uid: 51dde7580b404b27 - -automation_alias: script -automation_uid: 5b4e0237da074764 - -cache: false - -category: Tests - -deps: -- tags: download,file,_url.https://zenodo.org/record/4735647/files/resnet50_v1.onnx - env: - CM_DOWNLOAD_FINAL_ENV_NAME: CM_REPRODUCE_PAPER_XYZ - CM_DOWNLOAD_CHECKSUM: - force_cache: true - extra_cache_tags: reproduce,paper,artifact,zenodo,xyz -- tags: download-and-extract,_extract,_url.https://zenodo.org/record/5597155/files/3dunet_kits19_128x128x128.tf.zip?download=1 - env: - CM_DOWNLOAD_FINAL_ENV_NAME: CM_REPRODUCE_PAPER_XYZ2 - CM_EXTRACT_FINAL_ENV_NAME: CM_REPRODUCE_PAPER_XYZ2_EXTRACTED -# CM_DOWNLOAD_CHECKSUM: - force_cache: true - extra_cache_tags: reproduce,paper,artifact,zenodo,xyz2 - -new_env_keys: - - CM_REPRODUCE_PAPER_XYZ* - -tags: -- test -- download-and-extract-artifacts diff --git a/script/test-download-and-extract-artifacts/customize.py b/script/test-download-and-extract-artifacts/customize.py deleted file mode 100644 index 273999d46..000000000 --- a/script/test-download-and-extract-artifacts/customize.py +++ /dev/null @@ -1,24 +0,0 @@ -from cmind import utils -import os - - -def preprocess(i): - - os_info = i['os_info'] - - env = i['env'] - - meta = i['meta'] - - automation = i['automation'] - - quiet = (env.get('CM_QUIET', False) == 'yes') - - return {'return': 0} - - -def postprocess(i): - - env = i['env'] - - return {'return': 0} diff --git a/script/test-download-and-extract-artifacts/run.bat b/script/test-download-and-extract-artifacts/run.bat deleted file mode 100644 index 648302ca7..000000000 --- a/script/test-download-and-extract-artifacts/run.bat +++ /dev/null @@ -1 +0,0 @@ -rem native script diff --git a/script/test-download-and-extract-artifacts/run.sh b/script/test-download-and-extract-artifacts/run.sh deleted file mode 100644 index 3a584c10c..000000000 --- a/script/test-download-and-extract-artifacts/run.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -#CM Script location: ${CM_TMP_CURRENT_SCRIPT_PATH} - -#To export any variable -#echo "VARIABLE_NAME=VARIABLE_VALUE" >>tmp-run-env.out - -#${CM_PYTHON_BIN_WITH_PATH} contains the path to python binary if "get,python" is added as a dependency - - - -function exit_if_error() { - test $? -eq 0 || exit $? -} - -function run() { - echo "Running: " - echo "$1" - echo "" - if [[ ${CM_FAKE_RUN} != 'yes' ]]; then - eval "$1" - exit_if_error - fi -} - -#Add your run commands here... -# run "$CM_RUN_CMD" diff --git a/script/test-dummy/COPYRIGHT.md b/script/test-dummy/COPYRIGHT.md deleted file mode 100644 index a059b0c49..000000000 --- a/script/test-dummy/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2024-2025 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/test-dummy/README-extra.md b/script/test-dummy/README-extra.md deleted file mode 100644 index 582991f6d..000000000 --- a/script/test-dummy/README-extra.md +++ /dev/null @@ -1 +0,0 @@ -# CM script diff --git a/script/test-dummy/_cm.yaml b/script/test-dummy/_cm.yaml deleted file mode 100644 index 09ba01f92..000000000 --- a/script/test-dummy/_cm.yaml +++ /dev/null @@ -1,11 +0,0 @@ -alias: test-dummy -uid: 3ef5d69f929349bc - -automation_alias: script -automation_uid: 5b4e0237da074764 - -cache: false - -tags: -- test -- dummy diff --git a/script/test-dummy/customize.py b/script/test-dummy/customize.py deleted file mode 100644 index 273999d46..000000000 --- a/script/test-dummy/customize.py +++ /dev/null @@ -1,24 +0,0 @@ -from cmind import utils -import os - - -def preprocess(i): - - os_info = i['os_info'] - - env = i['env'] - - meta = i['meta'] - - automation = i['automation'] - - quiet = (env.get('CM_QUIET', False) == 'yes') - - return {'return': 0} - - -def postprocess(i): - - env = i['env'] - - return {'return': 0} diff --git a/script/test-dummy/run.bat b/script/test-dummy/run.bat deleted file mode 100644 index 648302ca7..000000000 --- a/script/test-dummy/run.bat +++ /dev/null @@ -1 +0,0 @@ -rem native script diff --git a/script/test-dummy/run.sh b/script/test-dummy/run.sh deleted file mode 100644 index 05a7907cf..000000000 --- a/script/test-dummy/run.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash - diff --git a/script/test-mlperf-inference-retinanet/COPYRIGHT.md b/script/test-mlperf-inference-retinanet/COPYRIGHT.md deleted file mode 100644 index a059b0c49..000000000 --- a/script/test-mlperf-inference-retinanet/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2024-2025 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/test-mlperf-inference-retinanet/README.md b/script/test-mlperf-inference-retinanet/README.md deleted file mode 100644 index 79f9d851b..000000000 --- a/script/test-mlperf-inference-retinanet/README.md +++ /dev/null @@ -1 +0,0 @@ -Please see [https://docs.mlcommons.org/cm4mlops/scripts/CM-interface-prototyping/test-mlperf-inference-retinanet](https://docs.mlcommons.org/cm4mlops/scripts/CM-interface-prototyping/test-mlperf-inference-retinanet) for the documentation of this CM script. diff --git a/script/test-mlperf-inference-retinanet/_cm.yaml b/script/test-mlperf-inference-retinanet/_cm.yaml deleted file mode 100644 index fd6a8607c..000000000 --- a/script/test-mlperf-inference-retinanet/_cm.yaml +++ /dev/null @@ -1,28 +0,0 @@ -alias: test-mlperf-inference-retinanet -automation_alias: script -automation_uid: 5b4e0237da074764 -category: CM interface prototyping -deps: -- tags: get,sys-utils-cm -- names: - - python - - python3 - tags: get,python3 -- tags: get,generic-python-lib,_requests -- names: - - loadgen - - mlperf-inference-loadgen - tags: get,loadgen -- force_env_keys: - - CM_GIT_* - names: - - inference-src - tags: mlperf,inference,source -- tags: get,dataset,open-images,original -- tags: get,raw,ml-model,retinanet -tags: -- test -- mlperf-inference-win -- retinanet -- windows -uid: 1cedbc3b642a403a diff --git a/script/test-mlperf-inference-retinanet/customize.py b/script/test-mlperf-inference-retinanet/customize.py deleted file mode 100644 index 1baf6756a..000000000 --- a/script/test-mlperf-inference-retinanet/customize.py +++ /dev/null @@ -1,19 +0,0 @@ -from cmind import utils -import os - - -def preprocess(i): - - os_info = i['os_info'] - env = i['env'] - meta = i['meta'] - - return {'return': 0} - - -def postprocess(i): - - env = i['env'] - state = i['state'] - - return {'return': 0} diff --git a/script/test-mlperf-inference-retinanet/run.bat b/script/test-mlperf-inference-retinanet/run.bat deleted file mode 100644 index 38970bc0e..000000000 --- a/script/test-mlperf-inference-retinanet/run.bat +++ /dev/null @@ -1,8 +0,0 @@ -echo. - -set CUR_DIR=%cd% -set SCRIPT_DIR=%CM_TMP_CURRENT_SCRIPT_PATH% - -cd %CM_MLPERF_INFERENCE_CLASSIFICATION_AND_DETECTION_PATH% - -%CM_PYTHON_BIN_WITH_PATH% python/main.py --profile retinanet-onnxruntime --scenario Offline --model %CM_ML_MODEL_FILE_WITH_PATH% --dataset-path %CM_DATASET_PATH_ROOT%\validation\data --accuracy diff --git a/script/test-mlperf-inference-retinanet/run.sh b/script/test-mlperf-inference-retinanet/run.sh deleted file mode 100644 index b43737407..000000000 --- a/script/test-mlperf-inference-retinanet/run.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -echo "" - -cd ${CM_MLPERF_INFERENCE_CLASSIFICATION_AND_DETECTION_PATH} - -ln -s ${CM_DATASET_PATH_ROOT}/annotations ${CM_DATASET_PATH_ROOT}/validation/data/annotations - -${CM_PYTHON_BIN_WITH_PATH} python/main.py --profile retinanet-onnxruntime --scenario Offline --model ${CM_ML_MODEL_FILE_WITH_PATH} --dataset-path ${CM_DATASET_PATH_ROOT}/validation/data --accuracy diff --git a/script/test-set-sys-user-cm/COPYRIGHT.md b/script/test-set-sys-user-cm/COPYRIGHT.md deleted file mode 100644 index 9e44ad290..000000000 --- a/script/test-set-sys-user-cm/COPYRIGHT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Notice - -© 2022-2025 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/test-set-sys-user-cm/README.md b/script/test-set-sys-user-cm/README.md deleted file mode 100644 index 3fd22bc6c..000000000 --- a/script/test-set-sys-user-cm/README.md +++ /dev/null @@ -1 +0,0 @@ -Please see [https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-set-sys-user-cm](https://docs.mlcommons.org/cm4mlops/scripts/Tests/test-set-sys-user-cm) for the documentation of this CM script. diff --git a/script/test-set-sys-user-cm/_cm.yaml b/script/test-set-sys-user-cm/_cm.yaml deleted file mode 100644 index 742309e1b..000000000 --- a/script/test-set-sys-user-cm/_cm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -alias: test-set-sys-user-cm -automation_alias: script -automation_uid: 5b4e0237da074764 -cache: true -category: Tests -default_env: - CM_SUDO: sudo -tags: -- demo -- set -- sys-user -- cm -- sys-user-cm -uid: 25fdfcf0fe434af2 diff --git a/script/test-set-sys-user-cm/run.sh b/script/test-set-sys-user-cm/run.sh deleted file mode 100644 index c0d513db7..000000000 --- a/script/test-set-sys-user-cm/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -${CM_SUDO} groupadd -g 1111 ckuser -${CM_SUDO} useradd -u 2222 -g ckuser --create-home --shell /bin/bash ckuser -${CM_SUDO} echo "ckuser:ckuser" | chpasswd -${CM_SUDO} adduser ckuser sudo -${CM_SUDO} echo "ckuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers diff --git a/script/truncate-mlperf-inference-accuracy-log/customize.py b/script/truncate-mlperf-inference-accuracy-log/customize.py index fba057e49..264fb72c9 100644 --- a/script/truncate-mlperf-inference-accuracy-log/customize.py +++ b/script/truncate-mlperf-inference-accuracy-log/customize.py @@ -1,5 +1,4 @@ -from cmind import utils -import cmind as cm +from mlc import utils import os import subprocess from os.path import exists diff --git a/script/truncate-mlperf-inference-accuracy-log/_cm.yaml b/script/truncate-mlperf-inference-accuracy-log/meta.yaml similarity index 100% rename from script/truncate-mlperf-inference-accuracy-log/_cm.yaml rename to script/truncate-mlperf-inference-accuracy-log/meta.yaml diff --git a/script/upgrade-python-pip/_cm.yaml b/script/upgrade-python-pip/meta.yaml similarity index 100% rename from script/upgrade-python-pip/_cm.yaml rename to script/upgrade-python-pip/meta.yaml diff --git a/script/wrapper-reproduce-octoml-tinyml-submission/customize.py b/script/wrapper-reproduce-octoml-tinyml-submission/customize.py index 1e5beb50f..e1dfaf976 100644 --- a/script/wrapper-reproduce-octoml-tinyml-submission/customize.py +++ b/script/wrapper-reproduce-octoml-tinyml-submission/customize.py @@ -1,6 +1,6 @@ -from cmind import utils +from mlc import utils import os -import cmind as cm +import mlc def preprocess(i): @@ -26,13 +26,13 @@ def preprocess(i): variation_tags_string = "_" + board + ",_" + microtvm_variant + ",_" + model tags = script_tags + "," + variation_tags_string if 'CM_RECREATE_BINARY' in env: - r = cm.access( + r = mlc.access( {'action': 'rm', 'automation': 'cache', 'tags': tags, 'force': 'true'}) if r['return'] > 0: return r - r = cm.access({'action': 'run', 'automation': 'script', 'tags': tags, 'quiet': 'true', 'env': env, + r = mlc.access({'action': 'run', 'automation': 'script', 'tags': tags, 'quiet': 'true', 'env': env, 'input': inp, 'state': state, 'add_deps': inp.get('add_deps', {}), 'add_deps_recursive': - inp.get('add_deps_recursive', {})}) + inp.get('add_deps_recursive', {})}) if r['return'] > 0: return r diff --git a/script/wrapper-reproduce-octoml-tinyml-submission/_cm.yaml b/script/wrapper-reproduce-octoml-tinyml-submission/meta.yaml similarity index 100% rename from script/wrapper-reproduce-octoml-tinyml-submission/_cm.yaml rename to script/wrapper-reproduce-octoml-tinyml-submission/meta.yaml diff --git a/setup.py b/setup.py index 07b1a9cab..16ff5cc7a 100644 --- a/setup.py +++ b/setup.py @@ -1,172 +1,89 @@ -# Build a whl file for mlperf-automations - -from setuptools import setup -from setuptools._distutils.dist import Distribution +from setuptools import setup, find_packages from setuptools.command.install import install import subprocess import sys -import importlib.util -import platform import os -import shutil -# Try to use importlib.metadata for Python 3.8+ try: - if sys.version_info >= (3, 8): - from importlib.metadata import version, PackageNotFoundError - else: - # Fallback to pkg_resources for Python < 3.8 - import pkg_resources - PackageNotFoundError = pkg_resources.DistributionNotFound + import tomllib # For Python 3.11+ except ImportError: - # If importlib.metadata is unavailable, fall back to pkg_resources - import pkg_resources - PackageNotFoundError = pkg_resources.DistributionNotFound + import toml # For older Python versions (requires `pip install toml`) + + +def get_project_meta(file_path="pyproject.toml"): + """ + Extracts project metadata from the given pyproject.toml file. + + Args: + file_path (str): Path to the pyproject.toml file. + + Returns: + dict: Dictionary containing the project metadata. + """ + try: + with open(file_path, "rb") as f: + if 'tomllib' in globals(): + project_data = tomllib.load(f) # Use tomllib for Python 3.11+ + else: + project_data = toml.load(f) # Use toml for older versions + + # Extract metadata under [project] + project_meta = project_data.get("project", {}) + return project_meta + + except FileNotFoundError: + print(f"Error: {file_path} not found.") + except Exception as e: + print(f"Error reading {file_path}: {e}") + return {} + + +def check_prerequisites(): + """Check if Git and python-venv are installed on the system.""" + try: + # Check for Git + subprocess.run(["git", "--version"], check=True, + stdout=subprocess.DEVNULL) + except FileNotFoundError: + sys.exit( + "Error: Git is not installed on the system. Please install Git and try again.") + + try: + # Check for python-venv + subprocess.run([sys.executable, "-m", "venv", "--help"], + check=True, stdout=subprocess.DEVNULL) + except subprocess.CalledProcessError: + sys.exit( + "Error: python-venv module is not available. Please install it and try again.") class CustomInstallCommand(install): - def run(self): - self.get_sys_platform() - self.install_system_packages() + """Custom install command to run a custom command after installation.""" - # Call the standard run method + def run(self): + # Run the standard install process install.run(self) - # Call the custom function - return self.custom_function() - - def is_package_installed(self, package_name): + # Run custom post-install command try: - if sys.version_info >= (3, 8): - spec = importlib.util.find_spec(package_name) - module = importlib.util.module_from_spec(spec) - sys.modules[package_name] = module - spec.loader.exec_module(module) - else: - pkg_resources.get_distribution( - package_name) # Fallback for < 3.8 - return True - except PackageNotFoundError: - return False - - def install_system_packages(self): - # List of packages to install via system package manager - packages = [] - - git_status = self.command_exists('git') - if not git_status: - packages.append("git") - wget_status = self.command_exists('wget') - if not wget_status: - packages.append("wget") - curl_status = self.command_exists('curl') - if not curl_status: - packages.append("curl") - - name = 'venv' - - if name in sys.modules: - pass # nothing needed - elif self.is_package_installed(name): - pass - else: - packages.append("python3-venv") - - if packages: - if self.system == 'Linux' or self.system == 'Darwin': - manager, details = self.get_package_manager_details() - if manager: - if manager == "apt-get": - # Check if 'sudo' is available - if shutil.which('sudo'): - subprocess.check_call( - ['sudo', 'apt-get', 'update']) - subprocess.check_call( - ['sudo', 'apt-get', 'install', '-y'] + packages) - else: - print("sudo not found, trying without sudo.") - try: - subprocess.check_call(['apt-get', 'update']) - subprocess.check_call( - ['apt-get', 'install', '-y'] + packages) - except subprocess.CalledProcessError: - print( - f"Installation of {packages} without sudo failed. Please install these packages manually to continue!") - elif self.system == 'Windows': - print( - f"Please install the following packages manually: {packages}") - - def detect_package_manager(self): - package_managers = { - 'apt-get': '/usr/bin/apt-get', - 'yum': '/usr/bin/yum', - 'dnf': '/usr/bin/dnf', - 'pacman': '/usr/bin/pacman', - 'zypper': '/usr/bin/zypper', - 'brew': '/usr/local/bin/brew' - } - - for name, path in package_managers.items(): - if os.path.exists(path): - return name - - return None - - def get_package_manager_details(self): - manager = self.detect_package_manager() - if manager: - try: - version_output = subprocess.check_output( - [manager, '--version'], stderr=subprocess.STDOUT).decode('utf-8') - return manager, version_output.split('\n')[0] - except subprocess.CalledProcessError: - return manager, 'Version information not available' - else: - return None, 'No supported package manager found' - - # Checks if command exists(for installing required packages). - # If the command exists, which returns 0, making the function return True. - # If the command does not exist, which returns a non-zero value, making the function return False. - # NOTE: The standard output and standard error streams are redirected to - # PIPES so that it could be captured in future if needed. - def command_exists(self, command): - if self.system == "Linux" or self.system == 'Darwin': - return subprocess.call( - ['which', command], stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0 - elif self.system == "Windows": - return subprocess.call( - [command, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) == 0 - - def custom_function(self): - commit_hash = get_commit_hash() - import cmind - clean_mlops_repo = os.environ.get('CM_MLOPS_CLEAN_REPO', 'false') - if str(clean_mlops_repo).lower() not in ["no", "0", "false", "off"]: - r = cmind.access({'action': 'rm', - 'automation': 'repo', - 'artifact': 'mlcommons@cm4mlops', - 'force': True, - 'all': True}) - - branch = os.environ.get('CM_MLOPS_REPO_BRANCH', 'dev') - pull_default_mlops_repo = os.environ.get( - 'CM_PULL_DEFAULT_MLOPS_REPO', 'true') + print("Running custom post-install command...") + commit_hash = get_commit_hash() + import mlc + branch = os.environ.get('MLC_REPO_BRANCH', 'mlc') - if str(pull_default_mlops_repo).lower() not in [ - "no", "0", "false", "off"]: - r = cmind.access({'action': 'pull', + res = mlc.access({'action': 'pull', 'automation': 'repo', - 'artifact': 'mlcommons@mlperf-automations', - 'checkout': commit_hash, - 'branch': branch}) - print(r) - if r['return'] > 0: - return r['return'] - - def get_sys_platform(self): - self.system = platform.system() + 'url': 'mlcommons@mlperf-automations', + 'branch': branch, + 'checkout': commit_hash + }) + print(res) + if res['return'] > 0: + return res['return'] -# Read long description and version + # subprocess.run(["echo", "Custom command executed!"], check=True) + except Exception as e: + sys.exit(f"Error running post-install command: {e}") def read_file(file_name, default=""): @@ -184,25 +101,25 @@ def get_commit_hash(): return "unknown" -long_description = read_file("README.md", "No description available.") -version_ = read_file("VERSION", "0.3.1") +# Check prerequisites before setup +check_prerequisites() + + +# Get project metadata from pyproject.toml +project_meta = get_project_meta() setup( - name='cm4mlops', - version=version_, - long_description=long_description, - long_description_content_type='text/markdown', - url="https://github.com/mlcommons/mlperf-automations", - packages=[], - install_requires=[ - "setuptools>=60", - "wheel", - "cmind @ git+https://github.com/gateoverflow/cm.git@mlperf-inference#egg=cmind&subdirectory=cm", - "giturlparse", - "requests", - "tabulate", - "pyyaml" - ], + + name=project_meta.get("name", "mlperf"), + version=project_meta.get("version", "0.0.1"), + description=project_meta.get("description", "MLPerf Automations."), + author=", ".join(a.get("name", "") + for a in project_meta.get("authors", [])), + author_email=", ".join(a.get("email", "") + for a in project_meta.get("authors", [])), + packages=find_packages(), + install_requires=project_meta.get("dependencies", []), + python_requires=project_meta.get("python-requires", ">=3.8"), cmdclass={ 'install': CustomInstallCommand, },