diff --git a/.flake8 b/.flake8 index 2daa5c2..e61a856 100644 --- a/.flake8 +++ b/.flake8 @@ -4,7 +4,7 @@ max-line-length = 120 # codes of errors to ignore -ignore = E128, E306, E402, E722, E731, W504 +ignore = E128, E306, E402, E702, E722, E731, W504 # enforce double quotes inline-quotes = double diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 3e95ead..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Lint and test - -on: - workflow_dispatch: - push: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout ⬇️ - uses: actions/checkout@v3 - with: - persist-credentials: false - - - name: Setup python 🐍 - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - - name: Install dependencies ☕️ - run: | - pip install -U pip setuptools - pip install -r requirements_dev.txt - - - name: Lint 🔍 - run: flake8 mlprof diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml new file mode 100644 index 0000000..8e69308 --- /dev/null +++ b/.github/workflows/lint_and_test.yml @@ -0,0 +1,48 @@ +name: Lint and test + +on: + workflow_dispatch: + push: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout ⬇️ + uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Setup python 🐍 + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install dependencies ☕️ + run: | + pip install -U pip setuptools wheel + pip install -r sandboxes/dev.txt + + - name: Lint 🔍 + run: flake8 mlprof + + typecheck: + runs-on: ubuntu-latest + steps: + - name: Checkout ⬇️ + uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Setup python 🐍 + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install dependencies ☕️ + run: | + pip install -U pip setuptools wheel + pip install -r sandboxes/dev.txt + + - name: Typecheck 🥊 + run: mypy mlprof diff --git a/.gitignore b/.gitignore index b33cdc8..8aa5a91 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ *.hdf5 *.out *.parquet +*.vscode .coverage coverage*.xml __pycache__ @@ -26,3 +27,4 @@ software data .data .law +.python-version diff --git a/examples/cnn/create.py b/examples/cnn/create.py new file mode 100644 index 0000000..ce349a7 --- /dev/null +++ b/examples/cnn/create.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" +Test script to create a simple CNN model. +Best to be executed in a CMSSW environment with TensorFlow and cmsml installed or a dedicated virtual environment. + +Signature: f32(1024 * n_channels) -> f32(8) + +1024 could correspond to a pixelated 32x32 "image" of an eta-phi plane. +""" + +import os +import subprocess + +import cmsml # type: ignore[import-untyped] + + +def create_model( + model_dir: str, + postfix: str = r"i{n_in}c{n_channels}v{n_convs}l{n_layers}u{n_units}", + n_in: int = 32, + n_channels: int = 1, + n_filters: int = 32, + n_convs: int = 3, + n_out: int = 8, + n_layers: int = 10, + n_units: int = 128, +) -> None: + # get tensorflow + tf, _, tf_version = cmsml.tensorflow.import_tf() + print("creating simple model") + print(f"location : {model_dir}") + print(f"TF version: {'.'.join(map(str, tf_version))}") + + # set random seeds to get deterministic results for testing + tf.keras.utils.set_random_seed(1) + + # define input layer + x = tf.keras.Input(shape=(n_channels * n_in**2,), dtype=tf.float32, name="input") + + # reshape + a = tf.keras.layers.Reshape((n_in, n_in, n_channels))(x) + + # convolutions and pooling + for _ in range(n_convs): + a = tf.keras.layers.Conv2D(n_filters, (3, 3), activation="elu")(a) + a = tf.keras.layers.MaxPooling2D((2, 2))(a) + + # flatten + a = tf.keras.layers.Flatten()(a) + + # model layers + for _ in range(n_layers): + a = tf.keras.layers.Dense(n_units, activation="elu")(a) + + # output layer + y = tf.keras.layers.Dense(n_out, activation="softmax", name="output", dtype=tf.float32)(a) + + # define the model + model = tf.keras.Model(inputs=[x], outputs=[y]) + + # test evaluation + print(model([tf.constant([list(range(n_channels * n_in**2))], dtype=tf.float32)])) + + # save it as a frozen graph + _postfix = postfix.format( + n_in=n_in, + n_out=n_out, + n_channels=n_channels, + n_filters=n_filters, + n_convs=n_convs, + n_layers=n_layers, + n_units=n_units, + ) + cmsml.tensorflow.save_graph( + os.path.join(model_dir, f"frozen_graph_{_postfix}.pb"), + model, + variables_to_constants=True, + ) + + # create a SavedModel + saved_model_dir = os.path.join(model_dir, f"saved_model_{_postfix}") + tf.saved_model.save(model, saved_model_dir) + + # convert to onnx + cmd = [ + "python", + "-m", "tf2onnx.convert", + "--saved-model", saved_model_dir, + "--output", os.path.join(model_dir, f"onnx_graph_{_postfix}.onnx"), + ] + subprocess.run(cmd, check=True) + + +def main(): + this_dir = os.path.dirname(os.path.abspath(__file__)) + + create_model(this_dir, n_in=32, n_channels=1, n_convs=1, n_layers=10) + create_model(this_dir, n_in=32, n_channels=1, n_convs=3, n_layers=10) + create_model(this_dir, n_in=64, n_channels=3, n_convs=4, n_layers=10) + create_model(this_dir, n_in=32, n_channels=1, n_convs=3, n_layers=20) + create_model(this_dir, n_in=64, n_channels=3, n_convs=4, n_layers=20) + + +if __name__ == "__main__": + main() diff --git a/examples/cnn/create_small_cnn.py b/examples/cnn/create_small_cnn.py deleted file mode 100644 index 4d2ba74..0000000 --- a/examples/cnn/create_small_cnn.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" -Test script to create a simple DNN model. -Best to be executed in a CMSSW environment with TensorFlow and cmsml installed. -Will install tf2onnx for the user if not present in environment. - -Signature: f32(64) -> f32(8) -""" - -import os -import subprocess -import importlib.util - -import cmsml - - -def create_model( - model_dir: str, - postfix: str = r"l{n_layers}k{kernel_size}f{n_filters}", - n_in_1: int = 28, - n_in_2: int = 28, - n_out: int = 8, - n_layers: int = 1, - kernel_size: int = 3, - n_filters: int = 4, - batch_norm: bool = True, - pooling: bool = True, -) -> None: - # get tensorflow - tf, _, tf_version = cmsml.tensorflow.import_tf() - print("creating simple cnn model") - print(f"location : {model_dir}") - print(f"TF version: {'.'.join(map(str, tf_version))}") - - # set random seeds to get deterministic results for testing - tf.keras.utils.set_random_seed(1) - - # define input layer - x = tf.keras.Input(shape=(n_in_1, n_in_2, 1), dtype=tf.float32, name="input") - - # model layers - a = tf.keras.layers.BatchNormalization(axis=1, renorm=True)(x) if batch_norm else x - for _ in range(n_layers): - a = tf.keras.layers.Conv2D(n_filters, kernel_size, padding="same", activation="elu")(a) - if pooling: - a = tf.keras.layers.MaxPooling2D(pool_size=(2, 2), strides=(1, 1), padding="same")(a) - if batch_norm: - a = tf.keras.layers.BatchNormalization(axis=1, renorm=True)(a) - - # output layer - b = tf.keras.layers.Flatten()(a) - y = tf.keras.layers.Dense(n_out, activation="softmax", name="output", dtype=tf.float32)(b) - - # define the model - model = tf.keras.Model(inputs=[x], outputs=[y]) - - # test evaluation - print(model([tf.constant([[[[i] for i in range(n_in_2)] for _ in range(n_in_1)]], dtype=tf.float32)])) - - # save it as a frozen graph - _postfix = postfix.format(n_in_1=n_in_1, n_in_2=n_in_2, n_out=n_out, n_layers=n_layers, kernel_size=kernel_size, - n_filters=n_filters, batch_norm=batch_norm) - cmsml.tensorflow.save_graph( - os.path.join(model_dir, f"frozen_graph_{_postfix}.pb"), - model, - variables_to_constants=True, - ) - - # create a SavedModel - tf.saved_model.save( - model, - os.path.join(model_dir, f"saved_model_{_postfix}"), - ) - - # convert SavedModel to onnx - # install tf2onnx if necessary - if importlib.util.find_spec("tf2onnx") is None: - subprocess.run("pip3 install --user tf2onnx", shell=True) - - # convert - subprocess.run( - f""" - python3 -m tf2onnx.convert \ - --saved-model saved_model_{_postfix} \ - --output onnx_graph_{_postfix}.onnx \ - """, - shell=True, - ) - - -def main(): - this_dir = os.path.dirname(os.path.abspath(__file__)) - create_model(this_dir, n_layers=1, kernel_size=1) - create_model(this_dir, n_layers=1, kernel_size=3) - create_model(this_dir, n_layers=5, kernel_size=1) - create_model(this_dir, n_layers=5, kernel_size=3) - - -if __name__ == "__main__": - main() diff --git a/examples/cnn/frozen_graph_i32c1v1l10u128.pb b/examples/cnn/frozen_graph_i32c1v1l10u128.pb new file mode 100644 index 0000000..5afee49 --- /dev/null +++ b/examples/cnn/frozen_graph_i32c1v1l10u128.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad07992a86ff18194c7e8bc4c9df5fc24d6564577c46d74d496b5a938825b288 +size 4299188 diff --git a/examples/cnn/frozen_graph_i32c1v3l10u128.pb b/examples/cnn/frozen_graph_i32c1v3l10u128.pb new file mode 100644 index 0000000..08abd44 --- /dev/null +++ b/examples/cnn/frozen_graph_i32c1v3l10u128.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e8982f397b461d323710c366f1c38cc3c0815bd68f4054bb384906c8d33d45b +size 754711 diff --git a/examples/cnn/frozen_graph_i32c1v3l20u128.pb b/examples/cnn/frozen_graph_i32c1v3l20u128.pb new file mode 100644 index 0000000..b67f825 --- /dev/null +++ b/examples/cnn/frozen_graph_i32c1v3l20u128.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b67d1111e1e007fa4391afa1c76080f6ac76d8cd87b31999f09b202551bf66b +size 1425418 diff --git a/examples/cnn/frozen_graph_i64c3v4l10u128.pb b/examples/cnn/frozen_graph_i64c3v4l10u128.pb new file mode 100644 index 0000000..d796beb --- /dev/null +++ b/examples/cnn/frozen_graph_i64c3v4l10u128.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:521d7efa0612412f6252be6dac3266fa7cd9223018224c7fab9ec792cae2385d +size 796045 diff --git a/examples/cnn/frozen_graph_i64c3v4l20u128.pb b/examples/cnn/frozen_graph_i64c3v4l20u128.pb new file mode 100644 index 0000000..5ca38c4 --- /dev/null +++ b/examples/cnn/frozen_graph_i64c3v4l20u128.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00084e07e81218868a63699ee51e33869ff801d5a2892f8da6e8fe4da4aa774d +size 1466027 diff --git a/examples/cnn/frozen_graph_l1k1f4.pb b/examples/cnn/frozen_graph_l1k1f4.pb deleted file mode 100644 index 8b83a9b..0000000 --- a/examples/cnn/frozen_graph_l1k1f4.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:85980d06e420b64de01394d2515db7ad04b393a1e37f40f6a5761eefa3370e0d -size 110728 diff --git a/examples/cnn/frozen_graph_l1k3f4.pb b/examples/cnn/frozen_graph_l1k3f4.pb deleted file mode 100644 index cdffd91..0000000 --- a/examples/cnn/frozen_graph_l1k3f4.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0915753fd5933c78de55a858fceaab19db44e55a2441a8751939586f0dd2c260 -size 111301 diff --git a/examples/cnn/frozen_graph_l5k1f4.pb b/examples/cnn/frozen_graph_l5k1f4.pb deleted file mode 100644 index e2806be..0000000 --- a/examples/cnn/frozen_graph_l5k1f4.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f299e7bb2d51f518384e15bba99a982f1afa43a02db14e0d0ba22231ad43de93 -size 132804 diff --git a/examples/cnn/frozen_graph_l5k3f4.pb b/examples/cnn/frozen_graph_l5k3f4.pb deleted file mode 100644 index bbbfc70..0000000 --- a/examples/cnn/frozen_graph_l5k3f4.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4a7d29e1350bd358b0267cf1f22f58c0e5741c18939864e73d684e75fe9294e6 -size 135355 diff --git a/examples/cnn/model_onnx_l1k1f4.yaml b/examples/cnn/model_onnx_i32c1v1l10u128.yaml similarity index 54% rename from examples/cnn/model_onnx_l1k1f4.yaml rename to examples/cnn/model_onnx_i32c1v1l10u128.yaml index a651235..784505a 100644 --- a/examples/cnn/model_onnx_l1k1f4.yaml +++ b/examples/cnn/model_onnx_i32c1v1l10u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_onnx - label: ONNX 1x4x1 + label: ONNX 32x1$\circledast$1$\rightarrow$10x128 version: "1.0.0" inference_engine: onnx - file: ./onnx_graph_l1k1f4.onnx + file: ./onnx_graph_i32c1v1l10u128.onnx inputs: - name: input - shape: [28, 28, 1] + shape: [1024] outputs: - name: output diff --git a/examples/cnn/model_onnx_l1k3f4.yaml b/examples/cnn/model_onnx_i32c1v3l10u128.yaml similarity index 54% rename from examples/cnn/model_onnx_l1k3f4.yaml rename to examples/cnn/model_onnx_i32c1v3l10u128.yaml index a0216aa..f12270c 100644 --- a/examples/cnn/model_onnx_l1k3f4.yaml +++ b/examples/cnn/model_onnx_i32c1v3l10u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_onnx - label: ONNX 1x4x3 + label: ONNX 32x1$\circledast$3$\rightarrow$10x128 version: "1.0.0" inference_engine: onnx - file: ./onnx_graph_l1k3f4.onnx + file: ./onnx_graph_i32c1v3l10u128.onnx inputs: - name: input - shape: [28,28,1] + shape: [1024] outputs: - name: output diff --git a/examples/cnn/model_onnx_l5k1f4.yaml b/examples/cnn/model_onnx_i32c1v3l20u128.yaml similarity index 54% rename from examples/cnn/model_onnx_l5k1f4.yaml rename to examples/cnn/model_onnx_i32c1v3l20u128.yaml index 2f399fe..38e8c0b 100644 --- a/examples/cnn/model_onnx_l5k1f4.yaml +++ b/examples/cnn/model_onnx_i32c1v3l20u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_onnx - label: ONNX 5x4x1 + label: ONNX 32x1$\circledast$3$\rightarrow$20x128 version: "1.0.0" inference_engine: onnx - file: ./onnx_graph_l5k1f4.onnx + file: ./onnx_graph_i32c1v3l20u128.onnx inputs: - name: input - shape: [28,28,1] + shape: [1024] outputs: - name: output diff --git a/examples/cnn/model_onnx_l5k3f4.yaml b/examples/cnn/model_onnx_i64c3v4l10u128.yaml similarity index 53% rename from examples/cnn/model_onnx_l5k3f4.yaml rename to examples/cnn/model_onnx_i64c3v4l10u128.yaml index 9a90363..31cb429 100644 --- a/examples/cnn/model_onnx_l5k3f4.yaml +++ b/examples/cnn/model_onnx_i64c3v4l10u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_onnx - label: ONNX 5x4x3 + label: ONNX 64x3$\circledast$4$\rightarrow$10x128 version: "1.0.0" inference_engine: onnx - file: ./onnx_graph_l5k3f4.onnx + file: ./onnx_graph_i64c3v4l10u128.onnx inputs: - name: input - shape: [28,28,1] + shape: [12288] outputs: - name: output diff --git a/examples/cnn/model_onnx_i64c3v4l20u128.yaml b/examples/cnn/model_onnx_i64c3v4l20u128.yaml new file mode 100644 index 0000000..aabfa34 --- /dev/null +++ b/examples/cnn/model_onnx_i64c3v4l20u128.yaml @@ -0,0 +1,11 @@ +model: + name: simple_cnn_onnx + label: ONNX 64x3$\circledast$4$\rightarrow$20x128 + version: "1.0.0" + inference_engine: onnx + file: ./onnx_graph_i64c3v4l20u128.onnx + inputs: + - name: input + shape: [12288] + outputs: + - name: output diff --git a/examples/cnn/model_tf_l1k1f4.yaml b/examples/cnn/model_tf_i32c1v1l10u128.yaml similarity index 54% rename from examples/cnn/model_tf_l1k1f4.yaml rename to examples/cnn/model_tf_i32c1v1l10u128.yaml index 363fddc..26371ea 100644 --- a/examples/cnn/model_tf_l1k1f4.yaml +++ b/examples/cnn/model_tf_i32c1v1l10u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_tf - label: TF 1x4x1 + label: TF 32x1$\circledast$1$\rightarrow$10x128 version: "1.0.0" inference_engine: tf - file: ./frozen_graph_l1k1f4.pb + file: ./frozen_graph_i32c1v1l10u128.pb inputs: - name: input - shape: [28,28,1] + shape: [1024] outputs: - name: Identity diff --git a/examples/cnn/model_tf_l1k3f4.yaml b/examples/cnn/model_tf_i32c1v3l10u128.yaml similarity index 54% rename from examples/cnn/model_tf_l1k3f4.yaml rename to examples/cnn/model_tf_i32c1v3l10u128.yaml index 4145224..cd56110 100644 --- a/examples/cnn/model_tf_l1k3f4.yaml +++ b/examples/cnn/model_tf_i32c1v3l10u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_tf - label: TF 1x4x3 + label: TF 32x1$\circledast$3$\rightarrow$10x128 version: "1.0.0" inference_engine: tf - file: ./frozen_graph_l1k3f4.pb + file: ./frozen_graph_i32c1v3l10u128.pb inputs: - name: input - shape: [28,28,1] + shape: [1024] outputs: - name: Identity diff --git a/examples/cnn/model_tf_l5k1f4.yaml b/examples/cnn/model_tf_i32c1v3l20u128.yaml similarity index 54% rename from examples/cnn/model_tf_l5k1f4.yaml rename to examples/cnn/model_tf_i32c1v3l20u128.yaml index 1515f9a..25c33f6 100644 --- a/examples/cnn/model_tf_l5k1f4.yaml +++ b/examples/cnn/model_tf_i32c1v3l20u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_tf - label: TF 5x4x1 + label: TF 32x1$\circledast$3$\rightarrow$20x128 version: "1.0.0" inference_engine: tf - file: ./frozen_graph_l5k1f4.pb + file: ./frozen_graph_i32c1v3l20u128.pb inputs: - name: input - shape: [28,28,1] + shape: [1024] outputs: - name: Identity diff --git a/examples/cnn/model_tf_l5k3f4.yaml b/examples/cnn/model_tf_i64c3v4l10u128.yaml similarity index 53% rename from examples/cnn/model_tf_l5k3f4.yaml rename to examples/cnn/model_tf_i64c3v4l10u128.yaml index 7434932..45c1aaa 100644 --- a/examples/cnn/model_tf_l5k3f4.yaml +++ b/examples/cnn/model_tf_i64c3v4l10u128.yaml @@ -1,11 +1,11 @@ model: name: simple_cnn_tf - label: TF 5x4x3 + label: TF 64x3$\circledast$4$\rightarrow$10x128 version: "1.0.0" inference_engine: tf - file: ./frozen_graph_l5k3f4.pb + file: ./frozen_graph_i64c3v4l10u128.pb inputs: - name: input - shape: [28,28,1] + shape: [12288] outputs: - name: Identity diff --git a/examples/cnn/model_tf_i64c3v4l20u128.yaml b/examples/cnn/model_tf_i64c3v4l20u128.yaml new file mode 100644 index 0000000..12aae26 --- /dev/null +++ b/examples/cnn/model_tf_i64c3v4l20u128.yaml @@ -0,0 +1,11 @@ +model: + name: simple_cnn_tf + label: TF 64x3$\circledast$4$\rightarrow$20x128 + version: "1.0.0" + inference_engine: tf + file: ./frozen_graph_i64c3v4l20u128.pb + inputs: + - name: input + shape: [12288] + outputs: + - name: Identity diff --git a/examples/cnn/model_tfaot_l1k1f4.yaml b/examples/cnn/model_tfaot_i32c1v1l10u128.yaml similarity index 64% rename from examples/cnn/model_tfaot_l1k1f4.yaml rename to examples/cnn/model_tfaot_i32c1v1l10u128.yaml index d6ca89e..371484b 100644 --- a/examples/cnn/model_tfaot_l1k1f4.yaml +++ b/examples/cnn/model_tfaot_i32c1v1l10u128.yaml @@ -1,9 +1,9 @@ model: name: simple_cnn_tfaot - label: AOT 1x4x1 + label: TFAOT 32x1$\circledast$1$\rightarrow$10x128 version: "1.0.0" inference_engine: tfaot - saved_model: ./saved_model_l1k1f4 + saved_model: ./saved_model_i32c1v1l10u128 serving_key: serving_default compilation: diff --git a/examples/cnn/model_tfaot_l1k3f4.yaml b/examples/cnn/model_tfaot_i32c1v3l10u128.yaml similarity index 64% rename from examples/cnn/model_tfaot_l1k3f4.yaml rename to examples/cnn/model_tfaot_i32c1v3l10u128.yaml index 8ae4723..b2821f2 100644 --- a/examples/cnn/model_tfaot_l1k3f4.yaml +++ b/examples/cnn/model_tfaot_i32c1v3l10u128.yaml @@ -1,9 +1,9 @@ model: name: simple_cnn_tfaot - label: AOT 1x4x3 + label: TFAOT 32x1$\circledast$3$\rightarrow$10x128 version: "1.0.0" inference_engine: tfaot - saved_model: ./saved_model_l1k3f4 + saved_model: ./saved_model_i32c1v3l10u128 serving_key: serving_default compilation: diff --git a/examples/cnn/model_tfaot_i32c1v3l10u128_opt.yaml b/examples/cnn/model_tfaot_i32c1v3l10u128_opt.yaml new file mode 100644 index 0000000..aa8b23e --- /dev/null +++ b/examples/cnn/model_tfaot_i32c1v3l10u128_opt.yaml @@ -0,0 +1,14 @@ +model: + name: simple_cnn_tfaot + label: TFAOT 32x1$\circledast$3$\rightarrow$10x128 + version: "1.0.0" + inference_engine: tfaot + saved_model: ./saved_model_i32c1v3l10u128 + serving_key: serving_default + +compilation: + batch_sizes: [1] + tf_xla_flags: [] + xla_flags: + - --xla_cpu_use_xla_runtime=true + - --xla_cpu_enable_fast_math=true diff --git a/examples/cnn/model_tfaot_l5k1f4.yaml b/examples/cnn/model_tfaot_i32c1v3l20u128.yaml similarity index 64% rename from examples/cnn/model_tfaot_l5k1f4.yaml rename to examples/cnn/model_tfaot_i32c1v3l20u128.yaml index a235cb4..26a6ceb 100644 --- a/examples/cnn/model_tfaot_l5k1f4.yaml +++ b/examples/cnn/model_tfaot_i32c1v3l20u128.yaml @@ -1,9 +1,9 @@ model: name: simple_cnn_tfaot - label: AOT 5x4x1 + label: TFAOT 32x1$\circledast$3$\rightarrow$20x128 version: "1.0.0" inference_engine: tfaot - saved_model: ./saved_model_l5k1f4 + saved_model: ./saved_model_i32c1v3l20u128 serving_key: serving_default compilation: diff --git a/examples/cnn/model_tfaot_l5k3f4.yaml b/examples/cnn/model_tfaot_i64c3v4l10u128.yaml similarity index 64% rename from examples/cnn/model_tfaot_l5k3f4.yaml rename to examples/cnn/model_tfaot_i64c3v4l10u128.yaml index fb66953..a2b1ed0 100644 --- a/examples/cnn/model_tfaot_l5k3f4.yaml +++ b/examples/cnn/model_tfaot_i64c3v4l10u128.yaml @@ -1,9 +1,9 @@ model: name: simple_cnn_tfaot - label: AOT 5x4x3 + label: TFAOT 64x3$\circledast$4$\rightarrow$10x128 version: "1.0.0" inference_engine: tfaot - saved_model: ./saved_model_l5k3f4 + saved_model: ./saved_model_i64c3v4l10u128 serving_key: serving_default compilation: diff --git a/examples/cnn/model_tfaot_i64c3v4l20u128.yaml b/examples/cnn/model_tfaot_i64c3v4l20u128.yaml new file mode 100644 index 0000000..8bd538a --- /dev/null +++ b/examples/cnn/model_tfaot_i64c3v4l20u128.yaml @@ -0,0 +1,12 @@ +model: + name: simple_cnn_tfaot + label: TFAOT 64x3$\circledast$4$\rightarrow$20x128 + version: "1.0.0" + inference_engine: tfaot + saved_model: ./saved_model_i64c3v4l20u128 + serving_key: serving_default + +compilation: + batch_sizes: [1] + tf_xla_flags: [] + xla_flags: [] diff --git a/examples/cnn/model_tfaot_l5k3f4_bu.yaml b/examples/cnn/model_tfaot_l5k3f4_bu.yaml deleted file mode 100644 index 08c562c..0000000 --- a/examples/cnn/model_tfaot_l5k3f4_bu.yaml +++ /dev/null @@ -1,12 +0,0 @@ -model: - name: simple_cnn_tfaot - label: AOT 5x4x3 BS - version: "1.0.0" - inference_engine: tfaot - saved_model: ./saved_model_l5k3f4 - serving_key: serving_default - -compilation: - batch_sizes: [1, 2, 4, 8, 16, 32, 64, 128, 256] - tf_xla_flags: [] - xla_flags: [] diff --git a/examples/cnn/onnx_graph_i32c1v1l10u128.onnx b/examples/cnn/onnx_graph_i32c1v1l10u128.onnx new file mode 100644 index 0000000..25298d0 Binary files /dev/null and b/examples/cnn/onnx_graph_i32c1v1l10u128.onnx differ diff --git a/examples/cnn/onnx_graph_i32c1v3l10u128.onnx b/examples/cnn/onnx_graph_i32c1v3l10u128.onnx new file mode 100644 index 0000000..34bd3b7 Binary files /dev/null and b/examples/cnn/onnx_graph_i32c1v3l10u128.onnx differ diff --git a/examples/cnn/onnx_graph_i32c1v3l20u128.onnx b/examples/cnn/onnx_graph_i32c1v3l20u128.onnx new file mode 100644 index 0000000..a157cc4 Binary files /dev/null and b/examples/cnn/onnx_graph_i32c1v3l20u128.onnx differ diff --git a/examples/cnn/onnx_graph_i64c3v4l10u128.onnx b/examples/cnn/onnx_graph_i64c3v4l10u128.onnx new file mode 100644 index 0000000..1ad7b15 Binary files /dev/null and b/examples/cnn/onnx_graph_i64c3v4l10u128.onnx differ diff --git a/examples/cnn/onnx_graph_i64c3v4l20u128.onnx b/examples/cnn/onnx_graph_i64c3v4l20u128.onnx new file mode 100644 index 0000000..1dc6ce9 Binary files /dev/null and b/examples/cnn/onnx_graph_i64c3v4l20u128.onnx differ diff --git a/examples/cnn/onnx_graph_l1k1f4.onnx b/examples/cnn/onnx_graph_l1k1f4.onnx deleted file mode 100644 index de86973..0000000 Binary files a/examples/cnn/onnx_graph_l1k1f4.onnx and /dev/null differ diff --git a/examples/cnn/onnx_graph_l1k3f4.onnx b/examples/cnn/onnx_graph_l1k3f4.onnx deleted file mode 100644 index ebd34ea..0000000 Binary files a/examples/cnn/onnx_graph_l1k3f4.onnx and /dev/null differ diff --git a/examples/cnn/onnx_graph_l5k1f4.onnx b/examples/cnn/onnx_graph_l5k1f4.onnx deleted file mode 100644 index e7075ec..0000000 Binary files a/examples/cnn/onnx_graph_l5k1f4.onnx and /dev/null differ diff --git a/examples/cnn/onnx_graph_l5k3f4.onnx b/examples/cnn/onnx_graph_l5k3f4.onnx deleted file mode 100644 index 01dcab8..0000000 Binary files a/examples/cnn/onnx_graph_l5k3f4.onnx and /dev/null differ diff --git a/examples/cnn/saved_model_i32c1v1l10u128/fingerprint.pb b/examples/cnn/saved_model_i32c1v1l10u128/fingerprint.pb new file mode 100644 index 0000000..3508755 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v1l10u128/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dc9ae88fc24d097b491923924131a8db052b256caaa269ef05650cbb3fe8f2b +size 56 diff --git a/examples/cnn/saved_model_i32c1v1l10u128/saved_model.pb b/examples/cnn/saved_model_i32c1v1l10u128/saved_model.pb new file mode 100644 index 0000000..c8db410 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v1l10u128/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f93379ae377b8775e084b0f24fbfd6384cf81e188d76583cd115f08fc23cacc +size 195715 diff --git a/examples/cnn/saved_model_i32c1v1l10u128/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_i32c1v1l10u128/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..bfa03cd --- /dev/null +++ b/examples/cnn/saved_model_i32c1v1l10u128/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92e7deb73a5c8558fe739bf49df5d6f47380c638b92a297b0618fd14421905c6 +size 4298983 diff --git a/examples/cnn/saved_model_i32c1v1l10u128/variables/variables.index b/examples/cnn/saved_model_i32c1v1l10u128/variables/variables.index new file mode 100644 index 0000000..0399345 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v1l10u128/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4c4d86074acf8cc456fb7ba4f268add7905380a938643aabbd5f7b116667878 +size 1649 diff --git a/examples/cnn/saved_model_i32c1v3l10u128/fingerprint.pb b/examples/cnn/saved_model_i32c1v3l10u128/fingerprint.pb new file mode 100644 index 0000000..5b4f1f4 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l10u128/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:865f8d09e15c6c3f45dcba6f5143f9c4f61dcd6bafed10360aec1d29b091b68e +size 57 diff --git a/examples/cnn/saved_model_i32c1v3l10u128/saved_model.pb b/examples/cnn/saved_model_i32c1v3l10u128/saved_model.pb new file mode 100644 index 0000000..ef7190f --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l10u128/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8466c604f470385a1de70b118fbf66fc0dd9289b4a24fafce2a0f10205cecbcf +size 235822 diff --git a/examples/cnn/saved_model_i32c1v3l10u128/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_i32c1v3l10u128/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..8be85bb --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l10u128/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0da1bb3ffc309b4c104c38951bbf90bc8031535cb00568fd006feafbecc2e6d8 +size 754985 diff --git a/examples/cnn/saved_model_i32c1v3l10u128/variables/variables.index b/examples/cnn/saved_model_i32c1v3l10u128/variables/variables.index new file mode 100644 index 0000000..bd18e87 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l10u128/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c590f20373d950ebabdc38e25f6871975a2fd2fc032480da329575fc7cdd0c6e +size 1876 diff --git a/examples/cnn/saved_model_i32c1v3l20u128/fingerprint.pb b/examples/cnn/saved_model_i32c1v3l20u128/fingerprint.pb new file mode 100644 index 0000000..c425654 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l20u128/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00e8c86c0e23baa2de22d1f8d0d932360cda38dcf2130103b0d14693160a28ad +size 57 diff --git a/examples/cnn/saved_model_i32c1v3l20u128/saved_model.pb b/examples/cnn/saved_model_i32c1v3l20u128/saved_model.pb new file mode 100644 index 0000000..ce2d8e9 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l20u128/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf867317fa969227ea29b0b3537d96dde6291c86696b43769630694d5ba60e76 +size 373650 diff --git a/examples/cnn/saved_model_i32c1v3l20u128/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_i32c1v3l20u128/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..bb1babb --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l20u128/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:951b285797d1ff44674fa5bbd3197d5f701ef0b47f5b4b0d95ec1947a58b051c +size 1424070 diff --git a/examples/cnn/saved_model_i32c1v3l20u128/variables/variables.index b/examples/cnn/saved_model_i32c1v3l20u128/variables/variables.index new file mode 100644 index 0000000..faf5479 --- /dev/null +++ b/examples/cnn/saved_model_i32c1v3l20u128/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57e1c70b72e792abfd07b21a3172581eb4378d00007f67605d72ce3a122826c5 +size 3125 diff --git a/examples/cnn/saved_model_i64c3v4l10u128/fingerprint.pb b/examples/cnn/saved_model_i64c3v4l10u128/fingerprint.pb new file mode 100644 index 0000000..5a4dd3e --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l10u128/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:114f4bfa42f4832dca4d9cc36f4bb92cf2972e38a50c3de9581ddc4d3954eb57 +size 58 diff --git a/examples/cnn/saved_model_i64c3v4l10u128/saved_model.pb b/examples/cnn/saved_model_i64c3v4l10u128/saved_model.pb new file mode 100644 index 0000000..6d3ef6e --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l10u128/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85858b9bee5444d22a215752ac50d6a497a3966ed339815f3f009e6f04e10f75 +size 257959 diff --git a/examples/cnn/saved_model_i64c3v4l10u128/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_i64c3v4l10u128/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..d734cb6 --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l10u128/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42a059f7c753367636f164dfad549d27d3f86a78b8b688e7bd052af1c071bcc6 +size 795751 diff --git a/examples/cnn/saved_model_i64c3v4l10u128/variables/variables.index b/examples/cnn/saved_model_i64c3v4l10u128/variables/variables.index new file mode 100644 index 0000000..eba88e0 --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l10u128/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bb0c429fcf1cdd4064da69d221b176a8f11fdf15a19d255d51e6403632675a5 +size 2002 diff --git a/examples/cnn/saved_model_i64c3v4l20u128/fingerprint.pb b/examples/cnn/saved_model_i64c3v4l20u128/fingerprint.pb new file mode 100644 index 0000000..0395395 --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l20u128/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0312bf3693ce6b898539ba1c530f12f6ff9d9f230e5fd4dd74e65f50bda3cf30 +size 58 diff --git a/examples/cnn/saved_model_i64c3v4l20u128/saved_model.pb b/examples/cnn/saved_model_i64c3v4l20u128/saved_model.pb new file mode 100644 index 0000000..8078431 --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l20u128/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:885ddbe3d653a6eeeb0a1468d00de961a0477220de14a99f3aa69e0bff11cff4 +size 395055 diff --git a/examples/cnn/saved_model_i64c3v4l20u128/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_i64c3v4l20u128/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..a11bd2f --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l20u128/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fe7eab902eafc0ed7304990b13eb76b594fa3ddc37019ba8207acb03f2df929 +size 1464818 diff --git a/examples/cnn/saved_model_i64c3v4l20u128/variables/variables.index b/examples/cnn/saved_model_i64c3v4l20u128/variables/variables.index new file mode 100644 index 0000000..30f6b20 --- /dev/null +++ b/examples/cnn/saved_model_i64c3v4l20u128/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66e2787cec5ff58cace2b9694376ed89ef382523f75b6e4e2d7e2e8c4f8a8aff +size 3250 diff --git a/examples/cnn/saved_model_l1k1f4/fingerprint.pb b/examples/cnn/saved_model_l1k1f4/fingerprint.pb deleted file mode 100644 index a74cbab..0000000 --- a/examples/cnn/saved_model_l1k1f4/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:666bbdf35af893140e36b1361ffc4b90fa7c1523ac1355ff352de917cb29d597 -size 57 diff --git a/examples/cnn/saved_model_l1k1f4/saved_model.pb b/examples/cnn/saved_model_l1k1f4/saved_model.pb deleted file mode 100644 index 1d499ad..0000000 --- a/examples/cnn/saved_model_l1k1f4/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19a28ac5cd829f6d8d770718db574e606694bfb420deec6c3cf82a1514b9c95d -size 233081 diff --git a/examples/cnn/saved_model_l1k1f4/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_l1k1f4/variables/variables.data-00000-of-00001 deleted file mode 100644 index a6e24b5..0000000 --- a/examples/cnn/saved_model_l1k1f4/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dc0d289b636ad094561658ccb02164c61103f5a320ff6412ef6f20d92b8b5e52 -size 108954 diff --git a/examples/cnn/saved_model_l1k1f4/variables/variables.index b/examples/cnn/saved_model_l1k1f4/variables/variables.index deleted file mode 100644 index 39a76ac..0000000 --- a/examples/cnn/saved_model_l1k1f4/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:63c06233d5021a5f03e4b72983a48d258850a6bc922394ff361b60e2905ef4b8 -size 1204 diff --git a/examples/cnn/saved_model_l1k3f4/fingerprint.pb b/examples/cnn/saved_model_l1k3f4/fingerprint.pb deleted file mode 100644 index a31f1f0..0000000 --- a/examples/cnn/saved_model_l1k3f4/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0acb2cb68918a9c958c35c0dfc7c72a5bad67ad2c5e410b8bf5c598ebb03efce -size 57 diff --git a/examples/cnn/saved_model_l1k3f4/saved_model.pb b/examples/cnn/saved_model_l1k3f4/saved_model.pb deleted file mode 100644 index 897189d..0000000 --- a/examples/cnn/saved_model_l1k3f4/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8758a72137a5efedf3e07566788fb70c033c2fa2b5943e5e56420071c3492b70 -size 235185 diff --git a/examples/cnn/saved_model_l1k3f4/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_l1k3f4/variables/variables.data-00000-of-00001 deleted file mode 100644 index 2fcba5a..0000000 --- a/examples/cnn/saved_model_l1k3f4/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ed5f75c0d7bf5445c871c787efce0f4a3486b15c993340708525513d38280a87 -size 109100 diff --git a/examples/cnn/saved_model_l1k3f4/variables/variables.index b/examples/cnn/saved_model_l1k3f4/variables/variables.index deleted file mode 100644 index 6353b0f..0000000 --- a/examples/cnn/saved_model_l1k3f4/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19d64cfa5bdedf4d287ce2eed3ab4cdc76a13a63ad2ae2b0457172a198f0b311 -size 1205 diff --git a/examples/cnn/saved_model_l5k1f4/fingerprint.pb b/examples/cnn/saved_model_l5k1f4/fingerprint.pb deleted file mode 100644 index fb826a3..0000000 --- a/examples/cnn/saved_model_l5k1f4/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:18a0710286eb4ea262f3058a176b9c015b3d60edf6b8847e8f1b6e5a1adc9596 -size 58 diff --git a/examples/cnn/saved_model_l5k1f4/saved_model.pb b/examples/cnn/saved_model_l5k1f4/saved_model.pb deleted file mode 100644 index d9fecd3..0000000 --- a/examples/cnn/saved_model_l5k1f4/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80dbc4fc7f315b1697d8ca3f3c0fd4cbea57927b34be36421b6f234b4869542b -size 666897 diff --git a/examples/cnn/saved_model_l5k1f4/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_l5k1f4/variables/variables.data-00000-of-00001 deleted file mode 100644 index f84de83..0000000 --- a/examples/cnn/saved_model_l5k1f4/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70a365ddb1cda338bd151109bd38eeeb0931e3468bd5cccefb10323b37fcee91 -size 125439 diff --git a/examples/cnn/saved_model_l5k1f4/variables/variables.index b/examples/cnn/saved_model_l5k1f4/variables/variables.index deleted file mode 100644 index 25ca936..0000000 --- a/examples/cnn/saved_model_l5k1f4/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cae44d8df4de507ae3bef12b0d939ff7832310a30fc884af90ddf4b09ff042b9 -size 3299 diff --git a/examples/cnn/saved_model_l5k3f4/fingerprint.pb b/examples/cnn/saved_model_l5k3f4/fingerprint.pb deleted file mode 100644 index bb257ab..0000000 --- a/examples/cnn/saved_model_l5k3f4/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:13bbf619170326a143e984f4c85dfcec561f87797db3f71aa73b440bdc4dbcb6 -size 56 diff --git a/examples/cnn/saved_model_l5k3f4/saved_model.pb b/examples/cnn/saved_model_l5k3f4/saved_model.pb deleted file mode 100644 index 08d1f05..0000000 --- a/examples/cnn/saved_model_l5k3f4/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b92dbd4108b78a0ef6e02e4f87ffb6d5c896c4b7e7cfa0a9c554fdef20cf4f1f -size 671456 diff --git a/examples/cnn/saved_model_l5k3f4/variables/variables.data-00000-of-00001 b/examples/cnn/saved_model_l5k3f4/variables/variables.data-00000-of-00001 deleted file mode 100644 index 52ca484..0000000 --- a/examples/cnn/saved_model_l5k3f4/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:38427eeee097d1d6d46ca866e3cdfb7840e5b221dc83a3fc48ece111dc661f7c -size 127662 diff --git a/examples/cnn/saved_model_l5k3f4/variables/variables.index b/examples/cnn/saved_model_l5k3f4/variables/variables.index deleted file mode 100644 index 09f837e..0000000 --- a/examples/cnn/saved_model_l5k3f4/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:86b6bdf7ef6d42e70d04b6fe96687cf5118fb3853cc169535c5cf388ed1e926e -size 3304 diff --git a/examples/simple_dnn/create.py b/examples/dnn/create.py similarity index 64% rename from examples/simple_dnn/create.py rename to examples/dnn/create.py index 573fefc..a2ad27c 100644 --- a/examples/simple_dnn/create.py +++ b/examples/dnn/create.py @@ -2,17 +2,15 @@ """ Test script to create a simple DNN model. -Best to be executed in a CMSSW environment with TensorFlow and cmsml installed. -Will install tf2onnx for the user if not present in environment. +Best to be executed in a CMSSW environment with TensorFlow and cmsml installed or a dedicated virtual environment. Signature: f32(64) -> f32(8) """ import os import subprocess -import importlib.util -import cmsml +import cmsml # type: ignore[import-untyped] def create_model( @@ -22,7 +20,7 @@ def create_model( n_out: int = 8, n_layers: int = 10, n_units: int = 256, - batch_norm: bool = True, + batch_norm: bool = False, ) -> None: # get tensorflow tf, _, tf_version = cmsml.tensorflow.import_tf() @@ -33,15 +31,26 @@ def create_model( # set random seeds to get deterministic results for testing tf.keras.utils.set_random_seed(1) + # random batchnorm initializer to avoid kernel removal due to ones and zeros + uniform_init = tf.keras.initializers.RandomUniform(-1.0, 1.0) + bn_opts = { + "axis": 1, + "renorm": True, + "gamma_initializer": uniform_init, + "beta_initializer": uniform_init, + "moving_mean_initializer": uniform_init, + "moving_variance_initializer": uniform_init, + } + # define input layer x = tf.keras.Input(shape=(n_in,), dtype=tf.float32, name="input") # model layers - a = tf.keras.layers.BatchNormalization(axis=1, renorm=True)(x) if batch_norm else x + a = tf.keras.layers.BatchNormalization(**bn_opts)(x) if batch_norm else x for _ in range(n_layers): a = tf.keras.layers.Dense(n_units, activation="elu")(a) if batch_norm: - a = tf.keras.layers.BatchNormalization(axis=1, renorm=True)(a) + a = tf.keras.layers.BatchNormalization(**bn_opts)(a) # output layer y = tf.keras.layers.Dense(n_out, activation="softmax", name="output", dtype=tf.float32)(a) @@ -61,29 +70,22 @@ def create_model( ) # create a SavedModel - tf.saved_model.save( - model, - os.path.join(model_dir, f"saved_model_{_postfix}"), - ) + saved_model_dir = os.path.join(model_dir, f"saved_model_{_postfix}") + tf.saved_model.save(model, saved_model_dir) - # convert SavedModel to onnx - # install tf2onnx if necessary - if importlib.util.find_spec("tf2onnx") is None: - subprocess.run("pip3 install --user tf2onnx", shell=True) - - # convert - subprocess.run( - f""" - python3 -m tf2onnx.convert \ - --saved-model saved_model_{_postfix} \ - --output onnx_graph_{_postfix}.onnx \ - """, - shell=True, - ) + # convert to onnx + cmd = [ + "python", + "-m", "tf2onnx.convert", + "--saved-model", saved_model_dir, + "--output", os.path.join(model_dir, f"onnx_graph_{_postfix}.onnx"), + ] + subprocess.run(cmd, check=True) def main(): this_dir = os.path.dirname(os.path.abspath(__file__)) + create_model(this_dir, n_layers=10, n_units=128) create_model(this_dir, n_layers=10, n_units=256) create_model(this_dir, n_layers=20, n_units=128) diff --git a/examples/dnn/frozen_graph_l10u128.pb b/examples/dnn/frozen_graph_l10u128.pb new file mode 100644 index 0000000..b450b32 --- /dev/null +++ b/examples/dnn/frozen_graph_l10u128.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4c0ba317d7e0797da8e37eed8e4b4a6705f3cc1ae6192694328613123109b9f +size 641794 diff --git a/examples/dnn/frozen_graph_l10u256.pb b/examples/dnn/frozen_graph_l10u256.pb new file mode 100644 index 0000000..bbe8273 --- /dev/null +++ b/examples/dnn/frozen_graph_l10u256.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebef9ce637237cb2886bbb3f8bdc5248f6e79b3e0c84f3aecbd03ae14e0b34b9 +size 2453804 diff --git a/examples/dnn/frozen_graph_l20u128.pb b/examples/dnn/frozen_graph_l20u128.pb new file mode 100644 index 0000000..2993189 --- /dev/null +++ b/examples/dnn/frozen_graph_l20u128.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7c009ea344226f6f8178745c98b67052c8e480109f59402da73d57dc5bdaedc +size 1312258 diff --git a/examples/dnn/frozen_graph_l20u256.pb b/examples/dnn/frozen_graph_l20u256.pb new file mode 100644 index 0000000..5f3ee5e --- /dev/null +++ b/examples/dnn/frozen_graph_l20u256.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:830cb9e813734159e7eb020f62dfcdfd96b25fbcf585e333bd34d0f823065ebb +size 5094914 diff --git a/examples/dnn/model_onnx_l10u128.yaml b/examples/dnn/model_onnx_l10u128.yaml new file mode 100644 index 0000000..df26b7a --- /dev/null +++ b/examples/dnn/model_onnx_l10u128.yaml @@ -0,0 +1,11 @@ +model: + name: simple_dnn_onnx + label: ONNX 10x128 + version: "1.0.0" + inference_engine: onnx + file: ./onnx_graph_l10u128.onnx + inputs: + - name: input + shape: [64] + outputs: + - name: output diff --git a/examples/dnn/model_onnx_l10u256.yaml b/examples/dnn/model_onnx_l10u256.yaml new file mode 100644 index 0000000..807e571 --- /dev/null +++ b/examples/dnn/model_onnx_l10u256.yaml @@ -0,0 +1,11 @@ +model: + name: simple_dnn_onnx + label: ONNX 10x256 + version: "1.0.0" + inference_engine: onnx + file: ./onnx_graph_l10u256.onnx + inputs: + - name: input + shape: [64] + outputs: + - name: output diff --git a/examples/dnn/model_onnx_l20u128.yaml b/examples/dnn/model_onnx_l20u128.yaml new file mode 100644 index 0000000..5147023 --- /dev/null +++ b/examples/dnn/model_onnx_l20u128.yaml @@ -0,0 +1,11 @@ +model: + name: simple_dnn_onnx + label: ONNX 20x128 + version: "1.0.0" + inference_engine: onnx + file: ./onnx_graph_l20u128.onnx + inputs: + - name: input + shape: [64] + outputs: + - name: output diff --git a/examples/dnn/model_onnx_l20u256.yaml b/examples/dnn/model_onnx_l20u256.yaml new file mode 100644 index 0000000..c3f84a2 --- /dev/null +++ b/examples/dnn/model_onnx_l20u256.yaml @@ -0,0 +1,11 @@ +model: + name: simple_dnn_onnx + label: ONNX 20x256 + version: "1.0.0" + inference_engine: onnx + file: ./onnx_graph_l20u256.onnx + inputs: + - name: input + shape: [64] + outputs: + - name: output diff --git a/examples/simple_dnn/model_tf_l10u128.yaml b/examples/dnn/model_tf_l10u128.yaml similarity index 89% rename from examples/simple_dnn/model_tf_l10u128.yaml rename to examples/dnn/model_tf_l10u128.yaml index bc198a5..840737d 100644 --- a/examples/simple_dnn/model_tf_l10u128.yaml +++ b/examples/dnn/model_tf_l10u128.yaml @@ -1,5 +1,5 @@ model: - name: simple_tf + name: simple_dnn_tf label: TF 10x128 version: "1.0.0" inference_engine: tf diff --git a/examples/simple_dnn/model_tf_l10u256.yaml b/examples/dnn/model_tf_l10u256.yaml similarity index 89% rename from examples/simple_dnn/model_tf_l10u256.yaml rename to examples/dnn/model_tf_l10u256.yaml index ce51be6..0ee962b 100644 --- a/examples/simple_dnn/model_tf_l10u256.yaml +++ b/examples/dnn/model_tf_l10u256.yaml @@ -1,5 +1,5 @@ model: - name: simple_tf + name: simple_dnn_tf label: TF 10x256 version: "1.0.0" inference_engine: tf diff --git a/examples/simple_dnn/model_tf_l20u128.yaml b/examples/dnn/model_tf_l20u128.yaml similarity index 89% rename from examples/simple_dnn/model_tf_l20u128.yaml rename to examples/dnn/model_tf_l20u128.yaml index cc8498b..790e6a1 100644 --- a/examples/simple_dnn/model_tf_l20u128.yaml +++ b/examples/dnn/model_tf_l20u128.yaml @@ -1,5 +1,5 @@ model: - name: simple_tf + name: simple_dnn_tf label: TF 20x128 version: "1.0.0" inference_engine: tf diff --git a/examples/simple_dnn/model_tf_l20u256.yaml b/examples/dnn/model_tf_l20u256.yaml similarity index 89% rename from examples/simple_dnn/model_tf_l20u256.yaml rename to examples/dnn/model_tf_l20u256.yaml index 05bdf73..8a89060 100644 --- a/examples/simple_dnn/model_tf_l20u256.yaml +++ b/examples/dnn/model_tf_l20u256.yaml @@ -1,5 +1,5 @@ model: - name: simple_tf + name: simple_dnn_tf label: TF 20x256 version: "1.0.0" inference_engine: tf diff --git a/examples/simple_dnn/model_tfaot_l10u128.yaml b/examples/dnn/model_tfaot_l10u128.yaml similarity index 89% rename from examples/simple_dnn/model_tfaot_l10u128.yaml rename to examples/dnn/model_tfaot_l10u128.yaml index e1e6dc4..f732bd2 100644 --- a/examples/simple_dnn/model_tfaot_l10u128.yaml +++ b/examples/dnn/model_tfaot_l10u128.yaml @@ -1,5 +1,5 @@ model: - name: simple_tfaot + name: simple_dnn_tfaot label: AOT 10x128 version: "1.0.0" inference_engine: tfaot diff --git a/examples/simple_dnn/model_tfaot_l10u256.yaml b/examples/dnn/model_tfaot_l10u256.yaml similarity index 89% rename from examples/simple_dnn/model_tfaot_l10u256.yaml rename to examples/dnn/model_tfaot_l10u256.yaml index 9886f8b..924bc9d 100644 --- a/examples/simple_dnn/model_tfaot_l10u256.yaml +++ b/examples/dnn/model_tfaot_l10u256.yaml @@ -1,5 +1,5 @@ model: - name: simple_tfaot + name: simple_dnn_tfaot label: AOT 10x256 version: "1.0.0" inference_engine: tfaot diff --git a/examples/simple_dnn/model_tfaot_l10u256_bs.yaml b/examples/dnn/model_tfaot_l10u256_bs.yaml similarity index 90% rename from examples/simple_dnn/model_tfaot_l10u256_bs.yaml rename to examples/dnn/model_tfaot_l10u256_bs.yaml index a0a3dbc..a046314 100644 --- a/examples/simple_dnn/model_tfaot_l10u256_bs.yaml +++ b/examples/dnn/model_tfaot_l10u256_bs.yaml @@ -1,5 +1,5 @@ model: - name: simple_tfaot + name: simple_dnn_tfaot label: AOT 10x256 BS version: "1.0.0" inference_engine: tfaot diff --git a/examples/simple_dnn/model_tfaot_l20u128.yaml b/examples/dnn/model_tfaot_l20u128.yaml similarity index 89% rename from examples/simple_dnn/model_tfaot_l20u128.yaml rename to examples/dnn/model_tfaot_l20u128.yaml index 41eec6e..e414836 100644 --- a/examples/simple_dnn/model_tfaot_l20u128.yaml +++ b/examples/dnn/model_tfaot_l20u128.yaml @@ -1,5 +1,5 @@ model: - name: simple_tfaot + name: simple_dnn_tfaot label: AOT 20x128 version: "1.0.0" inference_engine: tfaot diff --git a/examples/simple_dnn/model_tfaot_l20u256.yaml b/examples/dnn/model_tfaot_l20u256.yaml similarity index 89% rename from examples/simple_dnn/model_tfaot_l20u256.yaml rename to examples/dnn/model_tfaot_l20u256.yaml index f308110..f94367b 100644 --- a/examples/simple_dnn/model_tfaot_l20u256.yaml +++ b/examples/dnn/model_tfaot_l20u256.yaml @@ -1,5 +1,5 @@ model: - name: simple_tfaot + name: simple_dnn_tfaot label: AOT 20x256 version: "1.0.0" inference_engine: tfaot diff --git a/examples/simple_dnn/onnx_graph_l10u128.onnx b/examples/dnn/onnx_graph_l10u128.onnx similarity index 99% rename from examples/simple_dnn/onnx_graph_l10u128.onnx rename to examples/dnn/onnx_graph_l10u128.onnx index c4894a8..2bea339 100644 Binary files a/examples/simple_dnn/onnx_graph_l10u128.onnx and b/examples/dnn/onnx_graph_l10u128.onnx differ diff --git a/examples/simple_dnn/onnx_graph_l10u256.onnx b/examples/dnn/onnx_graph_l10u256.onnx similarity index 99% rename from examples/simple_dnn/onnx_graph_l10u256.onnx rename to examples/dnn/onnx_graph_l10u256.onnx index ba9d765..8e15806 100644 Binary files a/examples/simple_dnn/onnx_graph_l10u256.onnx and b/examples/dnn/onnx_graph_l10u256.onnx differ diff --git a/examples/simple_dnn/onnx_graph_l20u128.onnx b/examples/dnn/onnx_graph_l20u128.onnx similarity index 99% rename from examples/simple_dnn/onnx_graph_l20u128.onnx rename to examples/dnn/onnx_graph_l20u128.onnx index 2ab3d16..1f6d8cb 100644 --- a/examples/simple_dnn/onnx_graph_l20u128.onnx +++ b/examples/dnn/onnx_graph_l20u128.onnx @@ -1,172 +1,106 @@ -tf2onnx 1.16.1 15c810:O - +tf2onnx 1.16.1 15c810:N + input -FStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/mul_1:0 -FStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/sub:0HStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/add_1:0FStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/add_1"Add - -HStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/add_1:0 @StatefulPartitionedCall/model_2/dense_20/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_20/MatMul:0/StatefulPartitionedCall/model_2/dense_20/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_20/MatMul:0.StatefulPartitionedCall/model_2/dense_20/Elu:0,StatefulPartitionedCall/model_2/dense_20/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_20/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_23/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_23/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_23/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_21/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_21/MatMul:0/StatefulPartitionedCall/model_2/dense_21/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_21/MatMul:0.StatefulPartitionedCall/model_2/dense_21/Elu:0,StatefulPartitionedCall/model_2/dense_21/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_21/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_24/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_24/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_24/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_22/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_22/MatMul:0/StatefulPartitionedCall/model_2/dense_22/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_22/MatMul:0.StatefulPartitionedCall/model_2/dense_22/Elu:0,StatefulPartitionedCall/model_2/dense_22/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_22/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_25/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_25/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_25/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_23/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_23/MatMul:0/StatefulPartitionedCall/model_2/dense_23/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_23/MatMul:0.StatefulPartitionedCall/model_2/dense_23/Elu:0,StatefulPartitionedCall/model_2/dense_23/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_23/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_26/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_26/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_26/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_24/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_24/MatMul:0/StatefulPartitionedCall/model_2/dense_24/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_24/MatMul:0.StatefulPartitionedCall/model_2/dense_24/Elu:0,StatefulPartitionedCall/model_2/dense_24/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_24/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_27/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_27/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_27/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_25/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_25/MatMul:0/StatefulPartitionedCall/model_2/dense_25/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_25/MatMul:0.StatefulPartitionedCall/model_2/dense_25/Elu:0,StatefulPartitionedCall/model_2/dense_25/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_25/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_28/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_28/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_28/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_26/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_26/MatMul:0/StatefulPartitionedCall/model_2/dense_26/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_26/MatMul:0.StatefulPartitionedCall/model_2/dense_26/Elu:0,StatefulPartitionedCall/model_2/dense_26/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_26/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_29/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_29/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_29/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_27/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_27/MatMul:0/StatefulPartitionedCall/model_2/dense_27/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_27/MatMul:0.StatefulPartitionedCall/model_2/dense_27/Elu:0,StatefulPartitionedCall/model_2/dense_27/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_27/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_30/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_30/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_30/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_28/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_28/MatMul:0/StatefulPartitionedCall/model_2/dense_28/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_28/MatMul:0.StatefulPartitionedCall/model_2/dense_28/Elu:0,StatefulPartitionedCall/model_2/dense_28/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_28/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_31/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_31/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_31/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_29/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_29/MatMul:0/StatefulPartitionedCall/model_2/dense_29/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_29/MatMul:0.StatefulPartitionedCall/model_2/dense_29/Elu:0,StatefulPartitionedCall/model_2/dense_29/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_29/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_32/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_32/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_32/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_30/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_30/MatMul:0/StatefulPartitionedCall/model_2/dense_30/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_30/MatMul:0.StatefulPartitionedCall/model_2/dense_30/Elu:0,StatefulPartitionedCall/model_2/dense_30/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_30/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_33/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_33/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_33/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_31/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_31/MatMul:0/StatefulPartitionedCall/model_2/dense_31/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_31/MatMul:0.StatefulPartitionedCall/model_2/dense_31/Elu:0,StatefulPartitionedCall/model_2/dense_31/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_31/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_34/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_34/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_34/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_32/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_32/MatMul:0/StatefulPartitionedCall/model_2/dense_32/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_32/MatMul:0.StatefulPartitionedCall/model_2/dense_32/Elu:0,StatefulPartitionedCall/model_2/dense_32/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_32/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_35/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_35/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_35/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_33/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_33/MatMul:0/StatefulPartitionedCall/model_2/dense_33/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_33/MatMul:0.StatefulPartitionedCall/model_2/dense_33/Elu:0,StatefulPartitionedCall/model_2/dense_33/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_33/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_36/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_36/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_36/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_34/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_34/MatMul:0/StatefulPartitionedCall/model_2/dense_34/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_34/MatMul:0.StatefulPartitionedCall/model_2/dense_34/Elu:0,StatefulPartitionedCall/model_2/dense_34/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_34/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_37/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_37/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_37/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_35/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_35/MatMul:0/StatefulPartitionedCall/model_2/dense_35/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_35/MatMul:0.StatefulPartitionedCall/model_2/dense_35/Elu:0,StatefulPartitionedCall/model_2/dense_35/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_35/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_38/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_38/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_38/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_36/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_36/MatMul:0/StatefulPartitionedCall/model_2/dense_36/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_36/MatMul:0.StatefulPartitionedCall/model_2/dense_36/Elu:0,StatefulPartitionedCall/model_2/dense_36/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_36/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_39/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_39/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_39/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_37/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_37/MatMul:0/StatefulPartitionedCall/model_2/dense_37/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_37/MatMul:0.StatefulPartitionedCall/model_2/dense_37/Elu:0,StatefulPartitionedCall/model_2/dense_37/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_37/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_40/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_40/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_40/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_38/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_38/MatMul:0/StatefulPartitionedCall/model_2/dense_38/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_38/MatMul:0.StatefulPartitionedCall/model_2/dense_38/Elu:0,StatefulPartitionedCall/model_2/dense_38/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_38/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_41/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_41/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_41/batchnorm/mul_1:0 @StatefulPartitionedCall/model_2/dense_39/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_2/dense_39/MatMul:0/StatefulPartitionedCall/model_2/dense_39/MatMul"MatMul  1StatefulPartitionedCall/model_2/dense_39/MatMul:0.StatefulPartitionedCall/model_2/dense_39/Elu:0,StatefulPartitionedCall/model_2/dense_39/Elu"Elu - + .StatefulPartitionedCall/model_2/dense_39/Elu:0 -FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0HStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul_1:0FStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul_1:0 >StatefulPartitionedCall/model_2/output/MatMul/ReadVariableOp:0/StatefulPartitionedCall/model_2/output/MatMul:0-StatefulPartitionedCall/model_2/output/MatMul"MatMul r /StatefulPartitionedCall/model_2/output/MatMul:0output.StatefulPartitionedCall/model_2/output/Softmax"Softmaxtf2onnx* B>StatefulPartitionedCall/model_2/output/MatMul/ReadVariableOp:0J Ղ^y7b=y&>]nP>,UV=?½/G=/Po>=?W>e<ڽp<@jK=(%ӽˇVnAr=ii"]$U>0` N ֽ<;>>T܃(ܽ(LG @@ -5380,7 +5314,7 @@ e O=="=pvou>>vxo=E*"= ̌C->ro==F=]%'>X >5=8:~Tp&=򜽎{ ; M=R=/o=-p#dһ[>毽c=I_f-$$0,Ix"Bï"=-0>#>=v>׼׽!g>==D(f")N'bиrm۽.)>=>4zO=@h潀:'H= <C)>C )<=~=;zm=Jܽ|9=M>=1%>">_:Cf>5y~n K>Ty*>ؽAYd<ؽ =p2<-$>Խ_޽һ =Ĵ/=2 1>=|v=9$>ԑ=됽o @PS> ̼? ;h_!w#>Z3®<=Oc=w<=hjQ=< k.= <Ͷ=`<(P]=4>>p"T=He= B=2Q=I0%z=<===Z@<=,=ѽKH>>¨=¿=<(>?> g<eq' ` d>)=@f<潰r/>=l!,>&lc6)8KE=>T'n5=O,>Ο=G>$ zn Υ},ƽ0g$hL< ^u\<8=R=k"4==>$> >RF=^'dC ><=X&=кV*_=(+= V*>U>> ;>&s(н)=(>f=;.Ϋ= BN= =o*>,<=_>IR >0<@/(}= ;J=(ͻ31kc$> >/>-<&=#ڽ'xP1!=ļĽx e> x f=L4.=h9#0 ڼX#[ \ߘ=z=v=n!>!>yU;6 Nr=;PT?=`<./ٮ=-(r =З`_<巽h]<uҽ!Πk`=ճɽ`#>Q>fI<:Oqr>^\=,> <Ʉ2><<2>bw/=rO|x 倆PL=>Ă=G==jȽl^o^dt~&== +qJ*顽r#>ܣSHM= .>X;½=C==c >O꽜!,>tM4g=_mtB= x'w!>H2=}>H^=~&==8>,><=Ӱ;N>0.ܿw=q<83z=pJTʽ%/>=v%==I>P¼<W3>4"=j[+>`xbpE%4Y=9)>a%>>b,'½`&=" K׽ː,>K>0UVʻgI><>$'N=wؽre=>=C > -~W=V=*BFStatefulPartitionedCall/model_2/batch_normalization_42/batchnorm/mul:0JA?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?*@BFStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/sub:0J*@BFStatefulPartitionedCall/model_2/batch_normalization_22/batchnorm/mul:0JA?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?R"converted from saved_model_l20u128Z +~W=V=Rfconverted from /afs/desy.de/user/r/riegerma/repos/uhh-cms/MLProf/examples/dnn/test/saved_model_l20u128Z input  unk__6 diff --git a/examples/simple_dnn/onnx_graph_l20u256.onnx b/examples/dnn/onnx_graph_l20u256.onnx similarity index 99% rename from examples/simple_dnn/onnx_graph_l20u256.onnx rename to examples/dnn/onnx_graph_l20u256.onnx index 07829ca..bee82cf 100644 --- a/examples/simple_dnn/onnx_graph_l20u256.onnx +++ b/examples/dnn/onnx_graph_l20u256.onnx @@ -1,172 +1,106 @@ -tf2onnx 1.16.1 15c810:͵ - +tf2onnx 1.16.1 15c810: + input -FStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/mul_1:0 -FStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/sub:0HStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/add_1:0FStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/add_1"Add - -HStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/add_1:0 @StatefulPartitionedCall/model_3/dense_40/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_40/MatMul:0/StatefulPartitionedCall/model_3/dense_40/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_40/MatMul:0.StatefulPartitionedCall/model_3/dense_40/Elu:0,StatefulPartitionedCall/model_3/dense_40/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_40/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_44/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_44/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_44/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_41/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_41/MatMul:0/StatefulPartitionedCall/model_3/dense_41/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_41/MatMul:0.StatefulPartitionedCall/model_3/dense_41/Elu:0,StatefulPartitionedCall/model_3/dense_41/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_41/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_45/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_45/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_45/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_42/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_42/MatMul:0/StatefulPartitionedCall/model_3/dense_42/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_42/MatMul:0.StatefulPartitionedCall/model_3/dense_42/Elu:0,StatefulPartitionedCall/model_3/dense_42/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_42/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_46/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_46/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_46/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_43/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_43/MatMul:0/StatefulPartitionedCall/model_3/dense_43/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_43/MatMul:0.StatefulPartitionedCall/model_3/dense_43/Elu:0,StatefulPartitionedCall/model_3/dense_43/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_43/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_47/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_47/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_47/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_44/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_44/MatMul:0/StatefulPartitionedCall/model_3/dense_44/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_44/MatMul:0.StatefulPartitionedCall/model_3/dense_44/Elu:0,StatefulPartitionedCall/model_3/dense_44/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_44/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_48/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_48/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_48/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_45/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_45/MatMul:0/StatefulPartitionedCall/model_3/dense_45/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_45/MatMul:0.StatefulPartitionedCall/model_3/dense_45/Elu:0,StatefulPartitionedCall/model_3/dense_45/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_45/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_49/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_49/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_49/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_46/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_46/MatMul:0/StatefulPartitionedCall/model_3/dense_46/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_46/MatMul:0.StatefulPartitionedCall/model_3/dense_46/Elu:0,StatefulPartitionedCall/model_3/dense_46/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_46/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_47/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_47/MatMul:0/StatefulPartitionedCall/model_3/dense_47/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_47/MatMul:0.StatefulPartitionedCall/model_3/dense_47/Elu:0,StatefulPartitionedCall/model_3/dense_47/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_47/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_51/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_51/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_51/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_48/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_48/MatMul:0/StatefulPartitionedCall/model_3/dense_48/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_48/MatMul:0.StatefulPartitionedCall/model_3/dense_48/Elu:0,StatefulPartitionedCall/model_3/dense_48/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_48/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_52/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_52/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_52/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_49/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_49/MatMul:0/StatefulPartitionedCall/model_3/dense_49/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_49/MatMul:0.StatefulPartitionedCall/model_3/dense_49/Elu:0,StatefulPartitionedCall/model_3/dense_49/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_49/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_53/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_53/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_53/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_50/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_50/MatMul:0/StatefulPartitionedCall/model_3/dense_50/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_50/MatMul:0.StatefulPartitionedCall/model_3/dense_50/Elu:0,StatefulPartitionedCall/model_3/dense_50/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_50/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_54/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_54/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_54/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_51/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_51/MatMul:0/StatefulPartitionedCall/model_3/dense_51/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_51/MatMul:0.StatefulPartitionedCall/model_3/dense_51/Elu:0,StatefulPartitionedCall/model_3/dense_51/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_51/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_55/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_55/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_55/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_52/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_52/MatMul:0/StatefulPartitionedCall/model_3/dense_52/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_52/MatMul:0.StatefulPartitionedCall/model_3/dense_52/Elu:0,StatefulPartitionedCall/model_3/dense_52/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_52/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_56/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_56/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_56/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_53/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_53/MatMul:0/StatefulPartitionedCall/model_3/dense_53/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_53/MatMul:0.StatefulPartitionedCall/model_3/dense_53/Elu:0,StatefulPartitionedCall/model_3/dense_53/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_53/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_57/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_57/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_57/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_54/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_54/MatMul:0/StatefulPartitionedCall/model_3/dense_54/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_54/MatMul:0.StatefulPartitionedCall/model_3/dense_54/Elu:0,StatefulPartitionedCall/model_3/dense_54/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_54/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_58/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_58/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_58/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_55/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_55/MatMul:0/StatefulPartitionedCall/model_3/dense_55/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_55/MatMul:0.StatefulPartitionedCall/model_3/dense_55/Elu:0,StatefulPartitionedCall/model_3/dense_55/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_55/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_59/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_59/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_59/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_56/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_56/MatMul:0/StatefulPartitionedCall/model_3/dense_56/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_56/MatMul:0.StatefulPartitionedCall/model_3/dense_56/Elu:0,StatefulPartitionedCall/model_3/dense_56/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_56/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_60/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_60/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_60/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_57/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_57/MatMul:0/StatefulPartitionedCall/model_3/dense_57/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_57/MatMul:0.StatefulPartitionedCall/model_3/dense_57/Elu:0,StatefulPartitionedCall/model_3/dense_57/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_57/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_61/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_61/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_61/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_58/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_58/MatMul:0/StatefulPartitionedCall/model_3/dense_58/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_58/MatMul:0.StatefulPartitionedCall/model_3/dense_58/Elu:0,StatefulPartitionedCall/model_3/dense_58/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_58/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_62/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_62/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_62/batchnorm/mul_1:0 @StatefulPartitionedCall/model_3/dense_59/MatMul/ReadVariableOp:01StatefulPartitionedCall/model_3/dense_59/MatMul:0/StatefulPartitionedCall/model_3/dense_59/MatMul"MatMul  1StatefulPartitionedCall/model_3/dense_59/MatMul:0.StatefulPartitionedCall/model_3/dense_59/Elu:0,StatefulPartitionedCall/model_3/dense_59/Elu"Elu - + .StatefulPartitionedCall/model_3/dense_59/Elu:0 -FStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0HStatefulPartitionedCall/model_3/batch_normalization_63/batchnorm/mul_1:0FStatefulPartitionedCall/model_3/batch_normalization_63/batchnorm/mul_1"Mul - -HStatefulPartitionedCall/model_3/batch_normalization_63/batchnorm/mul_1:0 >StatefulPartitionedCall/model_3/output/MatMul/ReadVariableOp:0/StatefulPartitionedCall/model_3/output/MatMul:0-StatefulPartitionedCall/model_3/output/MatMul"MatMul r /StatefulPartitionedCall/model_3/output/MatMul:0output.StatefulPartitionedCall/model_3/output/Softmax"Softmaxtf2onnx*@B>StatefulPartitionedCall/model_3/output/MatMul/ReadVariableOp:0J@;R?=l3=v>=k: }9)(=զ<D=%B3y+' =)d#>q@3ŻǽN,@,>OArϼ]νĺ4z=>#ӽ=_ၽ

G=U=||=@H[>>*j=;=,8 t>>_x=i(}-P )=?Su=<ж,ED/=`<=P=w=~>@4HO=.TZ=NN= >ڽ,P>>؂x+==rR=|=l==P > E=b>>k6D@=2<=j=a4Td =xbr=4=vV:==8ʝ<k> 2=BS4 @@ -14108,7 +14042,7 @@ C >9<=Gж=|A=/ ~7<=Yѽ²}=\NʟF/>Y 8=zL=>Q=3Q=~/'@\=HE趻<—w(=ҽ$=Xq=y=0=\:\=t9U܃HսLc= ν;m+=xXGڽ҇=n=m=@` -=w8=V=@#=Q lٻ =n<=&ٽ3=L=|6>tֽ򝜽ʢ̽PUoY蜽 =Z]=;5}곽0>w==PhD=ʼ$~ּv=j % >r:xJ|M=}==L6=0=HlļK&==['=S' >\㼀+<̼ h=ħ<8ݽl^ٽ`C*BFStatefulPartitionedCall/model_3/batch_normalization_50/batchnorm/mul:0JA?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?*@BFStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/sub:0J*@BFStatefulPartitionedCall/model_3/batch_normalization_43/batchnorm/mul:0JA?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?R"converted from saved_model_l20u256Z +=w8=V=@#=Q lٻ =n<=&ٽ3=L=|6>tֽ򝜽ʢ̽PUoY蜽 =Z]=;5}곽0>w==PhD=ʼ$~ּv=j % >r:xJ|M=}==L6=0=HlļK&==['=S' >\㼀+<̼ h=ħ<8ݽl^ٽ`CRfconverted from /afs/desy.de/user/r/riegerma/repos/uhh-cms/MLProf/examples/dnn/test/saved_model_l20u256Z input  unk__6 diff --git a/examples/dnn/saved_model_l10u128/fingerprint.pb b/examples/dnn/saved_model_l10u128/fingerprint.pb new file mode 100644 index 0000000..f48d916 --- /dev/null +++ b/examples/dnn/saved_model_l10u128/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f4fb0bfe46569b6ce2e78a060f5a7405941925079b9ff701882892571ae7694 +size 55 diff --git a/examples/dnn/saved_model_l10u128/saved_model.pb b/examples/dnn/saved_model_l10u128/saved_model.pb new file mode 100644 index 0000000..45e8c6c --- /dev/null +++ b/examples/dnn/saved_model_l10u128/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41efd9cea4875d9ecfae7a2d97377762655e252bb87b4cefae2243272042a3c4 +size 161066 diff --git a/examples/dnn/saved_model_l10u128/variables/variables.data-00000-of-00001 b/examples/dnn/saved_model_l10u128/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..e034d55 --- /dev/null +++ b/examples/dnn/saved_model_l10u128/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49e8ee83b8dbce320e63e94a145df50988be01bdc2154616ec5f7f70b4508804 +size 641576 diff --git a/examples/dnn/saved_model_l10u128/variables/variables.index b/examples/dnn/saved_model_l10u128/variables/variables.index new file mode 100644 index 0000000..54c52ba --- /dev/null +++ b/examples/dnn/saved_model_l10u128/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fad2f003d246cd08a828b302cc430eb9ad6e0dce79c22e0a477496a28084e9c +size 1503 diff --git a/examples/dnn/saved_model_l10u256/fingerprint.pb b/examples/dnn/saved_model_l10u256/fingerprint.pb new file mode 100644 index 0000000..581c4fb --- /dev/null +++ b/examples/dnn/saved_model_l10u256/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83e2c0042af09f16f50798010b002edd223eb1a337a9a02079cec9082239e551 +size 56 diff --git a/examples/dnn/saved_model_l10u256/saved_model.pb b/examples/dnn/saved_model_l10u256/saved_model.pb new file mode 100644 index 0000000..a24c59d --- /dev/null +++ b/examples/dnn/saved_model_l10u256/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fa8222a6c982497a7a341e470bcac09717a9790375bb5ab8eb5c22aa5fdb25d +size 162822 diff --git a/examples/dnn/saved_model_l10u256/variables/variables.data-00000-of-00001 b/examples/dnn/saved_model_l10u256/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..f749e83 --- /dev/null +++ b/examples/dnn/saved_model_l10u256/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4abe447e0299058e215d00a16d50c6390406a5decda0da2be7d1f61ff5060106 +size 2453056 diff --git a/examples/dnn/saved_model_l10u256/variables/variables.index b/examples/dnn/saved_model_l10u256/variables/variables.index new file mode 100644 index 0000000..c18aeda --- /dev/null +++ b/examples/dnn/saved_model_l10u256/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b750a8bf25e337b53f792d1b8f958945a3569295060ce1c2df99b598a4bda98 +size 1509 diff --git a/examples/dnn/saved_model_l20u128/fingerprint.pb b/examples/dnn/saved_model_l20u128/fingerprint.pb new file mode 100644 index 0000000..6dcc6d0 --- /dev/null +++ b/examples/dnn/saved_model_l20u128/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06723c8aa33dbcd4da0a9dd986decd90e01dea9171028986e03b63179f36a7d5 +size 56 diff --git a/examples/dnn/saved_model_l20u128/saved_model.pb b/examples/dnn/saved_model_l20u128/saved_model.pb new file mode 100644 index 0000000..3d7af59 --- /dev/null +++ b/examples/dnn/saved_model_l20u128/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:320bf463a53fd66d38c1efe59de2662bc0dd40ed4c14e971365fba24e85796a6 +size 298499 diff --git a/examples/dnn/saved_model_l20u128/variables/variables.data-00000-of-00001 b/examples/dnn/saved_model_l20u128/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..fa5fbd7 --- /dev/null +++ b/examples/dnn/saved_model_l20u128/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c6ebda8c133d1fad6af36a921b3668bf310ef9f5f5c41c585b989ee9c166680 +size 1310627 diff --git a/examples/dnn/saved_model_l20u128/variables/variables.index b/examples/dnn/saved_model_l20u128/variables/variables.index new file mode 100644 index 0000000..d780b9d --- /dev/null +++ b/examples/dnn/saved_model_l20u128/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:603c5944994fca3c504afc71d59ba45aae20e069f16a1fb53518f1ce4f592cff +size 2728 diff --git a/examples/dnn/saved_model_l20u256/fingerprint.pb b/examples/dnn/saved_model_l20u256/fingerprint.pb new file mode 100644 index 0000000..39fc7a6 --- /dev/null +++ b/examples/dnn/saved_model_l20u256/fingerprint.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e311ca20f2d40f218834ec5fcf42996cced83fc6eac26479b21ff0a5abdbae67 +size 55 diff --git a/examples/dnn/saved_model_l20u256/saved_model.pb b/examples/dnn/saved_model_l20u256/saved_model.pb new file mode 100644 index 0000000..0271435 --- /dev/null +++ b/examples/dnn/saved_model_l20u256/saved_model.pb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec2706d4f93a67ab170c650f7c3511e40f860ca290921e7a623e50dd96b76a5f +size 298499 diff --git a/examples/dnn/saved_model_l20u256/variables/variables.data-00000-of-00001 b/examples/dnn/saved_model_l20u256/variables/variables.data-00000-of-00001 new file mode 100644 index 0000000..5fc98bf --- /dev/null +++ b/examples/dnn/saved_model_l20u256/variables/variables.data-00000-of-00001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3da19d12e3e093d70fa42ec4db23f0e11b2926f51a1905ca68efd620231d8c27 +size 5093283 diff --git a/examples/dnn/saved_model_l20u256/variables/variables.index b/examples/dnn/saved_model_l20u256/variables/variables.index new file mode 100644 index 0000000..be83d4b --- /dev/null +++ b/examples/dnn/saved_model_l20u256/variables/variables.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:447517a40d767c2d12f0affa258974968c1e2a215f7521be57d1568b1ae7a523 +size 2754 diff --git a/examples/dnn_2_inputs/dnn_2_inputs.pb b/examples/dnn_2_inputs/dnn_2_inputs.pb deleted file mode 100644 index 48071b9..0000000 --- a/examples/dnn_2_inputs/dnn_2_inputs.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:db40f419bf1e1726abd287eb2a0133dba829e83bbc635534f6e3d260f9c2108b -size 103855 diff --git a/examples/dnn_2_inputs/model_tf.yaml b/examples/dnn_2_inputs/model_tf.yaml deleted file mode 100644 index 0bc617c..0000000 --- a/examples/dnn_2_inputs/model_tf.yaml +++ /dev/null @@ -1,15 +0,0 @@ -model: - name: dnn_2_inputs - - inference_engine: tf - - file: dnn_2_inputs.pb - - inputs: - - name: input_0 - shape: [392] - - name: input_1 - shape: [392] - - outputs: - - name: Identity diff --git a/examples/simple_dnn/frozen_graph_l10u128.pb b/examples/simple_dnn/frozen_graph_l10u128.pb deleted file mode 100644 index d3099a7..0000000 --- a/examples/simple_dnn/frozen_graph_l10u128.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1937f16a9ffeded275e77f1120cd79923b60190e1b23d95d7697de5c6c1c99ff -size 691531 diff --git a/examples/simple_dnn/frozen_graph_l10u256.pb b/examples/simple_dnn/frozen_graph_l10u256.pb deleted file mode 100644 index 8c98381..0000000 --- a/examples/simple_dnn/frozen_graph_l10u256.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2e6ff985d10c4db249c88da1c56834833e1f6928f442072e53e991dc3222de5e -size 2525289 diff --git a/examples/simple_dnn/frozen_graph_l20u128.pb b/examples/simple_dnn/frozen_graph_l20u128.pb deleted file mode 100644 index 2b8d9e6..0000000 --- a/examples/simple_dnn/frozen_graph_l20u128.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cb2939752b4a5a28e8f69e68a51de97126e61737cc9c91702a1910b69c58628d -size 1410533 diff --git a/examples/simple_dnn/frozen_graph_l20u256.pb b/examples/simple_dnn/frozen_graph_l20u256.pb deleted file mode 100644 index e83d294..0000000 --- a/examples/simple_dnn/frozen_graph_l20u256.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3fa5e5ff599fbf96c377ca06568915daf3ef697943f5af9b0d44f264a6a3b0dd -size 5234149 diff --git a/examples/simple_dnn/saved_model_l10u128/fingerprint.pb b/examples/simple_dnn/saved_model_l10u128/fingerprint.pb deleted file mode 100644 index 854342e..0000000 --- a/examples/simple_dnn/saved_model_l10u128/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:014e7666fdebad543cb3fa1b38a64657ec18c93abdcca80a25acc18a48f049c2 -size 56 diff --git a/examples/simple_dnn/saved_model_l10u128/saved_model.pb b/examples/simple_dnn/saved_model_l10u128/saved_model.pb deleted file mode 100644 index a237564..0000000 --- a/examples/simple_dnn/saved_model_l10u128/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:20d7d03a198d93d1ff61473407696c177927619a311db762c4c5d5e05499ffc8 -size 1014430 diff --git a/examples/simple_dnn/saved_model_l10u128/variables/variables.data-00000-of-00001 b/examples/simple_dnn/saved_model_l10u128/variables/variables.data-00000-of-00001 deleted file mode 100644 index 49773b9..0000000 --- a/examples/simple_dnn/saved_model_l10u128/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c4b1979c8560b5f2a43c2f5a0284eff4a196a3f8ae772cfee78e4e2e56180eeb -size 699520 diff --git a/examples/simple_dnn/saved_model_l10u128/variables/variables.index b/examples/simple_dnn/saved_model_l10u128/variables/variables.index deleted file mode 100644 index 6f3561c..0000000 --- a/examples/simple_dnn/saved_model_l10u128/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fb1087e1f010ea91822f24cf51449f1baa575d83b18e5ec8590eb7868413baea -size 6152 diff --git a/examples/simple_dnn/saved_model_l10u256/fingerprint.pb b/examples/simple_dnn/saved_model_l10u256/fingerprint.pb deleted file mode 100644 index 7bf96cf..0000000 --- a/examples/simple_dnn/saved_model_l10u256/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f0f31cb51aaa7c1a18cc895d5804ed9f09d5d18997bbd68df1717cc30e9bceae -size 57 diff --git a/examples/simple_dnn/saved_model_l10u256/saved_model.pb b/examples/simple_dnn/saved_model_l10u256/saved_model.pb deleted file mode 100644 index 621b6ed..0000000 --- a/examples/simple_dnn/saved_model_l10u256/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:89531ef61a67b62f995a685b3d7b6e3af3b948be568368bc40240c7db914968c -size 1025411 diff --git a/examples/simple_dnn/saved_model_l10u256/variables/variables.data-00000-of-00001 b/examples/simple_dnn/saved_model_l10u256/variables/variables.data-00000-of-00001 deleted file mode 100644 index 2cfcd38..0000000 --- a/examples/simple_dnn/saved_model_l10u256/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:114d06dcd92ac5676aae0215a3927185957ee548161f17cbb1d517d1d7b0d97e -size 2546929 diff --git a/examples/simple_dnn/saved_model_l10u256/variables/variables.index b/examples/simple_dnn/saved_model_l10u256/variables/variables.index deleted file mode 100644 index 8d7b5a0..0000000 --- a/examples/simple_dnn/saved_model_l10u256/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0429253d2ab9515e55964ce2485fd3f2e3757b70b30df454ed7c0bb1920d07a0 -size 6172 diff --git a/examples/simple_dnn/saved_model_l20u128/fingerprint.pb b/examples/simple_dnn/saved_model_l20u128/fingerprint.pb deleted file mode 100644 index 7a8e3c1..0000000 --- a/examples/simple_dnn/saved_model_l20u128/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c7fe9e94640ff875599c1a0aa9194d9b9ce51f2cf184efddb7ac8f8bc53a5ebe -size 55 diff --git a/examples/simple_dnn/saved_model_l20u128/saved_model.pb b/examples/simple_dnn/saved_model_l20u128/saved_model.pb deleted file mode 100644 index 3517a04..0000000 --- a/examples/simple_dnn/saved_model_l20u128/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e99b7a074daf2482066750b09b028452fd2b4c420efbd48d75b7a05d624e51b8 -size 1944110 diff --git a/examples/simple_dnn/saved_model_l20u128/variables/variables.data-00000-of-00001 b/examples/simple_dnn/saved_model_l20u128/variables/variables.data-00000-of-00001 deleted file mode 100644 index 3443404..0000000 --- a/examples/simple_dnn/saved_model_l20u128/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a17fa963dd84bb6d5b7d46d3da62556f380e6d2f6756a1bb47f920877995345d -size 1423202 diff --git a/examples/simple_dnn/saved_model_l20u128/variables/variables.index b/examples/simple_dnn/saved_model_l20u128/variables/variables.index deleted file mode 100644 index f26f978..0000000 --- a/examples/simple_dnn/saved_model_l20u128/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4aeebaf568723de930bf5d1cb02ccbaff526bb2c95e9422b47d1a8d0fada315e -size 11578 diff --git a/examples/simple_dnn/saved_model_l20u256/fingerprint.pb b/examples/simple_dnn/saved_model_l20u256/fingerprint.pb deleted file mode 100644 index b19973e..0000000 --- a/examples/simple_dnn/saved_model_l20u256/fingerprint.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f601768b6443c38dc4a60ee36f8939b526d95d89c080cbde629324c5789e9153 -size 57 diff --git a/examples/simple_dnn/saved_model_l20u256/saved_model.pb b/examples/simple_dnn/saved_model_l20u256/saved_model.pb deleted file mode 100644 index e291fe7..0000000 --- a/examples/simple_dnn/saved_model_l20u256/saved_model.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:16beb4136bb1d45e7223b7f7f00b1d2bf7d36e5e220bd71d21c8a79183f157cf -size 1944110 diff --git a/examples/simple_dnn/saved_model_l20u256/variables/variables.data-00000-of-00001 b/examples/simple_dnn/saved_model_l20u256/variables/variables.data-00000-of-00001 deleted file mode 100644 index dab9d39..0000000 --- a/examples/simple_dnn/saved_model_l20u256/variables/variables.data-00000-of-00001 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5a2b77ab5c085a60dc907bf23f463facec875d0911bbd8b813d7cac35ef9b395 -size 5277538 diff --git a/examples/simple_dnn/saved_model_l20u256/variables/variables.index b/examples/simple_dnn/saved_model_l20u256/variables/variables.index deleted file mode 100644 index dfef63b..0000000 --- a/examples/simple_dnn/saved_model_l20u256/variables/variables.index +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:67a102427cf4196222c9f408b3471d7c3fcecaf01c5f3a295f63b11527ced02d -size 11688 diff --git a/examples/simple_dnn_old/model_onnx.yaml b/examples/simple_dnn_old/model_onnx.yaml deleted file mode 100644 index daaacee..0000000 --- a/examples/simple_dnn_old/model_onnx.yaml +++ /dev/null @@ -1,13 +0,0 @@ -model: - name: simple_dnn_onnx - - inference_engine: onnx - - file: simple_dnn.onnx - - inputs: - - name: input_0 - shape: [784] - - outputs: - - name: Identity diff --git a/examples/simple_dnn_old/model_tf.yaml b/examples/simple_dnn_old/model_tf.yaml deleted file mode 100644 index 78a6ad6..0000000 --- a/examples/simple_dnn_old/model_tf.yaml +++ /dev/null @@ -1,13 +0,0 @@ -model: - name: simple_dnn - - inference_engine: tf - - file: simple_dnn.pb - - inputs: - - name: input_0 - shape: [784] - - outputs: - - name: Identity diff --git a/examples/simple_dnn_old/simple_dnn.onnx b/examples/simple_dnn_old/simple_dnn.onnx deleted file mode 100644 index 6924f32..0000000 Binary files a/examples/simple_dnn_old/simple_dnn.onnx and /dev/null differ diff --git a/examples/simple_dnn_old/simple_dnn.pb b/examples/simple_dnn_old/simple_dnn.pb deleted file mode 100644 index 24f079c..0000000 --- a/examples/simple_dnn_old/simple_dnn.pb +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8da8cdf45063f479ab3f7c0d09a64120994efd779cd8d2d42f236e14acd0fd44 -size 103821 diff --git a/mlprof/plotting/plotter.py b/mlprof/plotting/plotter.py index dd512bb..4d6f0a5 100644 --- a/mlprof/plotting/plotter.py +++ b/mlprof/plotting/plotter.py @@ -113,7 +113,7 @@ def plot_batch_size_several_measurements( plot_params: dict. The dictionary containing the customization parameters. """ import matplotlib.pyplot as plt - import mplhep + import mplhep # type: ignore[import-untyped] if isinstance(measurements[0], str): measurements_labels_strs = list(measurements) @@ -143,7 +143,7 @@ def plot_batch_size_several_measurements( y_down=data["y_down"], y_up=data["y_up"], error_style=plot_params["error_style"], - color=next(ax._get_lines.prop_cycler)["color"], + color=ax._get_lines.get_next_color(), ) legend_entries.append(entry) diff --git a/mlprof/scripts/__init__.py b/mlprof/scripts/__init__.py index 50fa435..53c25f3 100644 --- a/mlprof/scripts/__init__.py +++ b/mlprof/scripts/__init__.py @@ -1,6 +1,6 @@ # coding: utf-8 -import law +import law # type: ignore[import-untyped] # enable contrib packages diff --git a/mlprof/scripts/render_aot.py b/mlprof/scripts/render_aot.py index 3079c07..b411918 100644 --- a/mlprof/scripts/render_aot.py +++ b/mlprof/scripts/render_aot.py @@ -84,7 +84,7 @@ def render_aot(plugin_file: str, header_file: str, model_name: str) -> None: def parse_signatures(header_file: str) -> tuple[list[Input], list[Output]]: - from cms_tfaot import parse_header + from cms_tfaot import parse_header # type: ignore[import-not-found] # extract header header header_data = parse_header(header_file) diff --git a/mlprof/tasks/__init__.py b/mlprof/tasks/__init__.py index 50fa435..53c25f3 100644 --- a/mlprof/tasks/__init__.py +++ b/mlprof/tasks/__init__.py @@ -1,6 +1,6 @@ # coding: utf-8 -import law +import law # type: ignore[import-untyped] # enable contrib packages diff --git a/mlprof/tasks/base.py b/mlprof/tasks/base.py index b5ac83b..43d79d4 100644 --- a/mlprof/tasks/base.py +++ b/mlprof/tasks/base.py @@ -4,10 +4,12 @@ Generic tools and base tasks that are defined along typical objects in an analysis. """ +from __future__ import annotations + import os -import luigi -import law +import luigi # type: ignore[import-untyped] +import law # type: ignore[import-untyped] from collections import OrderedDict @@ -19,7 +21,7 @@ class BaseTask(law.SandboxTask): ) allow_empty_sandbox = True - sandbox = None + sandbox: str | None = None task_namespace = None local_workflow_require_branches = False @@ -97,8 +99,8 @@ class CommandTask(BaseTask): run_command_in_tmp = False def _print_command(self, args): - from law.task.interactive import fmt_chars, _print_wrapped - from law.util import colored, get_terminal_width + from law.task.interactive import fmt_chars, _print_wrapped # type: ignore[import-untyped] + from law.util import colored, get_terminal_width # type: ignore[import-untyped] max_depth = int(args[0]) diff --git a/mlprof/tasks/parameters.py b/mlprof/tasks/parameters.py index b8e1076..c10df89 100644 --- a/mlprof/tasks/parameters.py +++ b/mlprof/tasks/parameters.py @@ -4,64 +4,16 @@ Collection of the recurrent luigi parameters for different tasks. """ +from __future__ import annotations + import os +import re -import luigi -import law +import luigi # type: ignore[import-untyped] +import law # type: ignore[import-untyped] from mlprof.tasks.base import BaseTask -from mlprof.util import expand_path - - -class Model(object): - - def __init__(self, model_file: str, name: str, label: str, **kwargs) -> None: - super().__init__(**kwargs) - - self.model_file = expand_path(model_file, abs=True) - self.name = name - self.label = label - - # cached data - self._all_data = None - self._data = None - - @property - def data(self): - if self._data is None: - all_data = law.LocalFileTarget(self.model_file).load(formatter="yaml") - if "model" not in all_data: - raise Exception(f"model file '{self.model_file}' is missing 'model' field") - self._data = all_data["model"] - self._all_data = all_data - return self._data - - @property - def full_name(self): - if self.name: - return self.name - - # create a hash - name = os.path.splitext(os.path.basename(self.model_file))[0] - return f"{name}_{law.util.create_hash(self.model_file)}" - - @property - def full_model_label(self): - if self.label: - return self.label - - # get the model.label field in the model data - model_label = self.data.get("label") - if model_label: - return model_label - - # get the model.name field in the model data - model_name = self.data.get("name") - if model_name: - return model_name - - # fallback to the full model name - return self.full_name +from mlprof.util import expand_path, Model class CMSSWParameters(BaseTask): @@ -125,7 +77,7 @@ class RuntimeParameters(BaseTask): ) tfaot_batch_rules = law.Parameter( default=law.NO_STR, - description="dash-separated tfaot batch rules with each being in the format 'target_size:size_1,size_2,...';" + description="dash-separated tfaot batch rules with each being in the format 'target_size:size_1,size_2,...'; " "default: empty", ) @@ -164,6 +116,27 @@ def store_parts(self): return parts + @property + def tfaot_batch_rules_option(self) -> list[str]: + if self.tfaot_batch_rules == law.NO_STR: + return [] + + def fmt_rule(r: str) -> str: + # interpret "ones" and "twos" as sequences of "1" and "2" + if m := re.match(r"^(\d+)\:(ones|twos)$", r): + bs = int(m.group(1)) + s = 1 if m.group(2) == "ones" else 2 + n = bs // s + n += int((n * s) < bs) + r = f"{bs}:{','.join(map(str, [s] * n))}" + + # the cms option parser does not handle commas, even escaped, so change the format + r = r.replace(",", ".") + + return r + + return [fmt_rule(r) for r in self.tfaot_batch_rules.split("-")] + class ModelParameters(BaseTask): """ @@ -171,9 +144,9 @@ class ModelParameters(BaseTask): """ model_file = luigi.Parameter( - default="$MLP_BASE/examples/simple_dnn/model_tf.yaml", + default="$MLP_BASE/examples/simple_dnn/model_tf_l10u128.yaml", description="json or yaml file containing information of model to be tested; " - "default: $MLP_BASE/examples/simple_dnn/model_tf.yaml", + "default: $MLP_BASE/examples/simple_dnn/model_tf_l10u128.yaml", ) model_name = luigi.Parameter( default=law.NO_STR, @@ -230,11 +203,13 @@ class MultiModelParameters(BaseTask): description="comma-separated list of names of models defined in --model-files to use in output paths " "instead of a hashed version of model_files; when set, the number of names must match the number of " "model files; default: ()", + brace_expand=True, ) model_labels = law.CSVParameter( default=law.NO_STR, description="when set, use this label in plots; when empty, the 'network_name' field in the " "model json data is used when existing, and full_model_name otherwise; default: empty", + brace_expand=True, ) def __init__(self, *args, **kwargs): @@ -301,9 +276,9 @@ class CustomPlotParameters(BaseTask): """ x_log = luigi.BoolParameter( - default=True, + default=False, significant=False, - description="plot the x-axis logarithmically; default: True", + description="plot the x-axis logarithmically; default: False", ) y_log = luigi.BoolParameter( default=False, diff --git a/mlprof/tasks/runtime.py b/mlprof/tasks/runtime.py index 7ebafa1..6bf0395 100644 --- a/mlprof/tasks/runtime.py +++ b/mlprof/tasks/runtime.py @@ -7,7 +7,8 @@ import os import itertools -import law +import luigi # type: ignore[import-untyped] +import law # type: ignore[import-untyped] from mlprof.tasks.base import CMSRunCommandTask, PlotTask, view_output_plots from mlprof.tasks.parameters import ( @@ -19,10 +20,18 @@ from mlprof.util import expand_path +class RemoveCMSSWSandbox(CMSSWParameters, ModelParameters, law.tasks.RunOnceTask): + + @law.tasks.RunOnceTask.complete_on_success + def run(self): + sandbox_task = CMSSWSandboxTask.req(self) + install_dir = os.path.join("$MLP_CMSSW_BASE", sandbox_task.cmssw_install_dir) + law.LocalDirectoryTarget(install_dir).remove(silent=True) + + class MeasureRuntime( CMSRunCommandTask, RuntimeParameters, - ModelParameters, CMSSWSandboxTask, ): """ @@ -30,6 +39,15 @@ class MeasureRuntime( parameters and a single batch size. """ + renew_cmssw_sandbox = luigi.BoolParameter( + default=False, + description="remove the cmssw sandbox corresponding to the inference engine of the requested model first; " + "default: False", + ) + + def requires(self): + return RemoveCMSSWSandbox.req(self) if self.renew_cmssw_sandbox else [] + def output(self): return self.local_target(f"runtime_bs{self.batch_size}.csv") @@ -61,9 +79,7 @@ def build_command(self): }) elif engine == "tfaot": if self.tfaot_batch_rules != law.NO_STR: - # the cms option parser does not handle commas, even escaped, so change the format - batch_rules = [r.replace(",", ".") for r in self.tfaot_batch_rules.split("-")] - options["batchRules"] = batch_rules + options["batchRules"] = self.tfaot_batch_rules_option return self.build_cmsrun_command(expand_path(config_file), options) diff --git a/mlprof/tasks/sandboxes.py b/mlprof/tasks/sandboxes.py index 9e9f295..26d4aa6 100644 --- a/mlprof/tasks/sandboxes.py +++ b/mlprof/tasks/sandboxes.py @@ -6,12 +6,12 @@ import os -import law +import law # type: ignore[import-untyped] -from mlprof.tasks.parameters import CMSSWParameters +from mlprof.tasks.parameters import CMSSWParameters, ModelParameters -class CMSSWSandboxTask(CMSSWParameters): +class CMSSWSandboxTask(CMSSWParameters, ModelParameters): """ Base class for tasks in cmssw sandboxes. """ @@ -55,7 +55,7 @@ def cmssw_install_dir(self): def sandbox(self): # preparations args = self.cmssw_setup_args - install_dir = os.path.join(*filter(bool, ["$MLP_CMSSW_BASE", self.cmssw_install_dir])) + install_dir = os.path.join("$MLP_CMSSW_BASE", self.cmssw_install_dir) # sandbox parts parts = [ @@ -69,3 +69,6 @@ def sandbox(self): parts.append(f"args={args}") return "::".join(parts) + + def run(self): + raise NotImplementedError diff --git a/mlprof/util.py b/mlprof/util.py index 3687dd6..5d10f42 100644 --- a/mlprof/util.py +++ b/mlprof/util.py @@ -1,14 +1,69 @@ # coding: utf-8 -__all__ = [] +from __future__ import annotations + +__all__: list[str] = [] import os +import law # type: ignore[import-untyped] + -def expand_path(path, abs=False, dir=False): +def expand_path(path: str, abs: bool = False, dir: bool = False) -> str: path = os.path.expandvars(os.path.expanduser(str(path))) if abs: path = os.path.abspath(path) if dir: path = os.path.dirname(path) return path + + +class Model(object): + + def __init__(self, model_file: str, name: str, label: str, **kwargs) -> None: + super().__init__(**kwargs) + + self.model_file = expand_path(model_file, abs=True) + self.name = name + self.label = label + + # cached data + self._all_data = None + self._data = None + + @property + def data(self): + if self._data is None: + all_data = law.LocalFileTarget(self.model_file).load(formatter="yaml") + if "model" not in all_data: + raise Exception(f"model file '{self.model_file}' is missing 'model' field") + self._data = all_data["model"] + self._all_data = all_data + return self._data + + @property + def full_name(self): + if self.name: + return self.name + + # create a hash + name = os.path.splitext(os.path.basename(self.model_file))[0] + return f"{name}_{law.util.create_hash(self.model_file)}" + + @property + def full_model_label(self): + if self.label: + return self.label + + # get the model.label field in the model data + model_label = self.data.get("label") + if model_label: + return model_label + + # get the model.name field in the model data + model_name = self.data.get("name") + if model_name: + return model_name + + # fallback to the full model name + return self.full_name diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index ebc4bae..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -cloudpickle>=1.3 -flake8>=4.0,<6.0 -flake8-commas>=2.1 -flake8-quotes>=3.3 -pytest-cov>=3.0 diff --git a/sandboxes/base.txt b/sandboxes/base.txt index ee2a812..dbea9d5 100644 --- a/sandboxes/base.txt +++ b/sandboxes/base.txt @@ -1,11 +1,5 @@ # version 1 -luigi~=3.3 -six~=1.16 -pyyaml==6.* - -# debugging -ipython~=7.16 -flake8~=4.0 -flake8-commas~=2.1 -flake8-quotes~=3.3 +luigi +six +pyyaml diff --git a/sandboxes/dev.txt b/sandboxes/dev.txt new file mode 100644 index 0000000..709b16f --- /dev/null +++ b/sandboxes/dev.txt @@ -0,0 +1,12 @@ +# all packages needed for development + +-r base.txt +-r plotting.txt + +git+https://github.com/riga/law.git@master +mypy~=1.9.0 +flake8~=7.0 +flake8-commas~=2.1.0 +flake8-quotes~=3.3.2 +types-docutils~=0.20.0 +pandas-stubs diff --git a/sandboxes/plotting.txt b/sandboxes/plotting.txt index 26d23f6..7a2a915 100644 --- a/sandboxes/plotting.txt +++ b/sandboxes/plotting.txt @@ -1,6 +1,6 @@ # version 1 -numpy~=1.19 -matplotlib~=3.3 -pandas~=1.1 -mplhep~=0.2 +numpy +pandas +matplotlib +mplhep diff --git a/setup.sh b/setup.sh index 70847f0..8bfda15 100644 --- a/setup.sh +++ b/setup.sh @@ -12,6 +12,8 @@ setup_mlp() { local this_file="$( ${shell_is_zsh} && echo "${(%):-%x}" || echo "${BASH_SOURCE[0]}" )" local this_dir="$( cd "$( dirname "${this_file}" )" && pwd )" local orig="${PWD}" + local micromamba_url="https://micro.mamba.pm/api/micromamba/linux-64/latest" + local pyv="3.9" # @@ -23,6 +25,7 @@ setup_mlp() { export MLP_BASE="${this_dir}" export MLP_DATA_BASE="${MLP_DATA_BASE:-${MLP_BASE}/data}" export MLP_SOFTWARE_BASE="${MLP_SOFTWARE_BASE:-${MLP_DATA_BASE}/software}" + export MLP_CONDA_BASE="${MLP_CONDA_BASE:-${MLP_SOFTWARE_BASE}/conda}" export MLP_VENV_BASE="${MLP_VENV_BASE:-${MLP_SOFTWARE_BASE}/venvs}" export MLP_CMSSW_BASE="${MLP_CMSSW_BASE:-${MLP_SOFTWARE_BASE}/cmssw}" export MLP_STORE_LOCAL="${MLP_STORE_LOCAL:-${MLP_DATA_BASE}/store}" @@ -38,13 +41,16 @@ setup_mlp() { export PYTHONWARNINGS="ignore" export GLOBUS_THREAD_MODEL="none" export VIRTUAL_ENV_DISABLE_PROMPT="${VIRTUAL_ENV_DISABLE_PROMPT:-1}" - ulimit -s unlimited + export MAMBA_ROOT_PREFIX="${MLP_CONDA_BASE}" + export MAMBA_EXE="${MAMBA_ROOT_PREFIX}/bin/micromamba" # # minimal local software setup # + ulimit -s unlimited + # persistent PATH and PYTHONPATH parts that should be # priotized over any additions made in sandboxes export MLP_PERSISTENT_PATH="${MLP_BASE}/bin:${MLP_BASE}/modules/law/bin:${MLP_SOFTWARE_BASE}/bin" @@ -54,16 +60,68 @@ setup_mlp() { export PATH="${MLP_PERSISTENT_PATH}:${PATH}" export PYTHONPATH="${MLP_PERSISTENT_PYTHONPATH}:${PYTHONPATH}" - # local python stack in a venv - if [ "${MLP_REINSTALL_SOFTWARE}" = "1" ]; then - echo "removing software stack at ${MLP_VENV_BASE}" - rm -rf "${MLP_VENV_BASE}" + # remove parts of the software stack if requested + if [ "${MLP_REINSTALL_CONDA}" = "1" ] || ( [ -z "${MLP_REINSTALL_CONDA}" ] && [ "${MLP_REINSTALL_SOFTWARE}" = "1" ] ); then + echo "removing conda/micromamba at ${MLP_CONDA_BASE}" + rm -rf "${MLP_CONDA_BASE}" + fi + if [ "${MLP_REINSTALL_VENV}" = "1" ] || ( [ -z "${MLP_REINSTALL_VENV}" ] && [ "${MLP_REINSTALL_SOFTWARE}" = "1" ] ); then + echo "removing venvs at ${ML_VENV_BASE}" + rm -rf "${ML_VENV_BASE}" + fi + if [ "${MLP_REINSTALL_CMSSW}" = "1" ] || ( [ -z "${MLP_REINSTALL_CMSSW}" ] && [ "${MLP_REINSTALL_SOFTWARE}" = "1" ] ); then + echo "removing cmssw at ${ML_CMSSW_BASE}" + rm -rf "${ML_CMSSW_BASE}" + fi + + # conda base environment + local conda_missing="$( [ -d "${MLP_CONDA_BASE}" ] && echo "false" || echo "true" )" + if ${conda_missing}; then + echo "installing conda/micromamba at ${MLP_CONDA_BASE}" + ( + mkdir -p "${MLP_CONDA_BASE}" + cd "${MLP_CONDA_BASE}" + curl -Ls "${micromamba_url}" | tar -xvj -C . "bin/micromamba" + ./bin/micromamba shell hook -y --prefix="${MLP_CONDA_BASE}" &> "micromamba.sh" + mkdir -p "etc/profile.d" + mv "micromamba.sh" "etc/profile.d" + cat << EOF > ".mambarc" +changeps1: false +always_yes: true +channels: + - conda-forge +EOF + ) + fi + + # initialize conda + source "${MLP_CONDA_BASE}/etc/profile.d/micromamba.sh" "" || return "$?" + micromamba activate || return "$?" + echo "initialized conda/micromamba" + + # install packages + if ${conda_missing}; then + echo + echo "setting up conda/micromamba environment" + + # conda packages (nothing so far) + micromamba install \ + libgcc \ + bash \ + "python=${pyv}" \ + git \ + git-lfs \ + || return "$?" + micromamba clean --yes --all + + # update python base packages + pip install --no-cache-dir -U pip setuptools wheel || return "$?" fi # source the base sandbox - source "${MLP_BASE}/sandboxes/base.sh" "$@" + source "${MLP_BASE}/sandboxes/base.sh" "" || return "$?" - # prepend persistent path fragments again for ensure priority for local packages + # prepend persistent path fragments again to ensure priority for local packages export PATH="${MLP_PERSISTENT_PATH}:${PATH}" export PYTHONPATH="${MLP_PERSISTENT_PYTHONPATH}:${PYTHONPATH}"