From ef53cd38750e76ef73b3e9237de471815ce0e6f7 Mon Sep 17 00:00:00 2001 From: Grigori Fursin Date: Sun, 13 Oct 2024 16:07:19 +0200 Subject: [PATCH 1/2] disable actions that are not used at this moment; add a few more tests --- ...links.yml => _check-all-broken-links.yml_} | 0 ...roken-links.md => _check-broken-links.md_} | 0 .../{publish.yaml => _publish.yaml_} | 0 .../test-cm-image-classification-onnx.yml | 36 +++++++++++++++++++ ... => test-cm-mlperf-inference-resnet50.yml} | 2 +- .../test-cmx-image-classification-onnx.yml | 36 +++++++++++++++++++ 6 files changed, 73 insertions(+), 1 deletion(-) rename .github/workflows/{check-all-broken-links.yml => _check-all-broken-links.yml_} (100%) rename .github/workflows/{check-broken-links.md => _check-broken-links.md_} (100%) rename .github/workflows/{publish.yaml => _publish.yaml_} (100%) create mode 100644 .github/workflows/test-cm-image-classification-onnx.yml rename .github/workflows/{test-mlperf-inference-resnet50.yml => test-cm-mlperf-inference-resnet50.yml} (97%) create mode 100644 .github/workflows/test-cmx-image-classification-onnx.yml diff --git a/.github/workflows/check-all-broken-links.yml b/.github/workflows/_check-all-broken-links.yml_ similarity index 100% rename from .github/workflows/check-all-broken-links.yml rename to .github/workflows/_check-all-broken-links.yml_ diff --git a/.github/workflows/check-broken-links.md b/.github/workflows/_check-broken-links.md_ similarity index 100% rename from .github/workflows/check-broken-links.md rename to .github/workflows/_check-broken-links.md_ diff --git a/.github/workflows/publish.yaml b/.github/workflows/_publish.yaml_ similarity index 100% rename from .github/workflows/publish.yaml rename to .github/workflows/_publish.yaml_ diff --git a/.github/workflows/test-cm-image-classification-onnx.yml b/.github/workflows/test-cm-image-classification-onnx.yml new file mode 100644 index 0000000000..88dcd62f64 --- /dev/null +++ b/.github/workflows/test-cm-image-classification-onnx.yml @@ -0,0 +1,36 @@ +# 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: image classification with ONNX' + +on: + pull_request: + branches: [ "main", "dev" ] + paths: + - '.github/workflows/test-image-classification-onnx.yml' + - '**' + - '!**.md' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: [ "3.10", "3.12"] + + 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 + run: | + python3 -m pip install cmind + cm pull repo --url=https://github.com/mlcommons/cm4mlops + cm run script --quiet --tags=get,sys-utils-cm + - name: Test image classification with ONNX + run: | + cmr "python app image-classification onnx" --quiet diff --git a/.github/workflows/test-mlperf-inference-resnet50.yml b/.github/workflows/test-cm-mlperf-inference-resnet50.yml similarity index 97% rename from .github/workflows/test-mlperf-inference-resnet50.yml rename to .github/workflows/test-cm-mlperf-inference-resnet50.yml index 2747874eb9..03577a7f3d 100644 --- a/.github/workflows/test-mlperf-inference-resnet50.yml +++ b/.github/workflows/test-cm-mlperf-inference-resnet50.yml @@ -1,6 +1,6 @@ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: MLPerf inference resnet50 +name: 'CM: MLPerf inference resnet50' on: pull_request: diff --git a/.github/workflows/test-cmx-image-classification-onnx.yml b/.github/workflows/test-cmx-image-classification-onnx.yml new file mode 100644 index 0000000000..f4b67b477a --- /dev/null +++ b/.github/workflows/test-cmx-image-classification-onnx.yml @@ -0,0 +1,36 @@ +# 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: 'CMX: image classification with ONNX' + +on: + pull_request: + branches: [ "main", "dev" ] + paths: + - '.github/workflows/test-image-classification-onnx.yml' + - '**' + - '!**.md' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: [ "3.10", "3.12"] + + 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 + run: | + python3 -m pip install cmind + cmx pull repo --url=https://github.com/mlcommons/cm4mlops + cmx test core + - name: Test image classification with ONNX + run: | + cmx run script "python app image-classification onnx" --quiet From 554a70bcccdb8aa2096444933cdfb8c5e1946271 Mon Sep 17 00:00:00 2001 From: Grigori Fursin Date: Sun, 13 Oct 2024 16:10:54 +0200 Subject: [PATCH 2/2] - added `-f` to the CMX core to be backwards compatible with CM commands like `cm rm cache -f` --- cm/CHANGES.md | 4 ++++ cm/cmind/__init__.py | 2 +- cm/cmind/core.py | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cm/CHANGES.md b/cm/CHANGES.md index 46b9fa2d55..4c3a057759 100644 --- a/cm/CHANGES.md +++ b/cm/CHANGES.md @@ -1,3 +1,7 @@ +## V3.2.0.1 + - added `-f` to the CMX core to be backwards compatible + with CM commands like `cm rm cache -f` + ## V3.2.0 - added `utils.test_input` to test if input has keys and report them as error diff --git a/cm/cmind/__init__.py b/cm/cmind/__init__.py index cccfdd931a..21bce4842e 100644 --- a/cm/cmind/__init__.py +++ b/cm/cmind/__init__.py @@ -2,7 +2,7 @@ # # Written by Grigori Fursin -__version__ = "3.2.0" +__version__ = "3.2.0.1" from cmind.core import access from cmind.core import x diff --git a/cm/cmind/core.py b/cm/cmind/core.py index b448077b71..ae979cc0b6 100644 --- a/cm/cmind/core.py +++ b/cm/cmind/core.py @@ -725,10 +725,14 @@ def x(self, i, out = None): control_flags[flag] = control[flag] # Check if unknown flags + # f should be deprecated in the future - used for backwards + # compatibility with older commands like cm/cmx rm cache -f + unknown_control_flags = [flag for flag in control_flags if flag not in [ 'h', 'help', 'version', 'out', 'j', 'json', 'save_to_json_file', 'save_to_yaml_file', 'common', - 'ignore_inheritance', 'log', 'logfile', 'raise', 'repro']] + 'ignore_inheritance', 'log', 'logfile', 'raise', 'repro', + 'f']] if len(unknown_control_flags)>0: unknown_control_flags_str = ','.join(unknown_control_flags) @@ -738,6 +742,9 @@ def x(self, i, out = None): # Force print help control['h'] = True + if control.pop('f', ''): + i['f'] = True + # Check repro use_log = str(control_flags.pop('log', '')).strip().lower() log_file = control_flags.pop('logfile', '')