aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/cfg
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2021-05-21 09:33:32 +0200
committerLester Solbakken <lesters@oath.com>2021-05-21 09:33:32 +0200
commit6448742f804482946a7bf2d17723dca6b4100b73 (patch)
tree135038f0298f3e519ed8e4327cf1bf1915df4b39 /config-model/src/test/cfg
parent864eb3da782e9795826ec78add953a76eeb2ea17 (diff)
Wire in stateless ONNX runtime evaluation
Diffstat (limited to 'config-model/src/test/cfg')
-rw-r--r--config-model/src/test/cfg/application/ml_serving/models/add_mul.onnx24
-rw-r--r--config-model/src/test/cfg/application/ml_serving/models/mnist_softmax.onnxbin31758 -> 0 bytes
-rw-r--r--config-model/src/test/cfg/application/ml_serving/models/sqrt.onnx11
-rw-r--r--config-model/src/test/cfg/application/ml_serving/models/sqrt.py23
-rw-r--r--config-model/src/test/cfg/application/onnx/files/add.onnx16
-rwxr-xr-xconfig-model/src/test/cfg/application/onnx/files/add.py26
-rw-r--r--config-model/src/test/cfg/application/onnx/models/mul.onnx16
-rwxr-xr-xconfig-model/src/test/cfg/application/onnx/models/mul.py26
-rw-r--r--config-model/src/test/cfg/application/onnx/searchdefinitions/test.sd27
-rw-r--r--config-model/src/test/cfg/application/onnx/services.xml22
10 files changed, 191 insertions, 0 deletions
diff --git a/config-model/src/test/cfg/application/ml_serving/models/add_mul.onnx b/config-model/src/test/cfg/application/ml_serving/models/add_mul.onnx
new file mode 100644
index 00000000000..ab054d112e9
--- /dev/null
+++ b/config-model/src/test/cfg/application/ml_serving/models/add_mul.onnx
@@ -0,0 +1,24 @@
+
+add_mul.py:£
+
+input1
+input2output1"Mul
+
+input1
+input2output2"Addadd_mulZ
+input1
+
+
+Z
+input2
+
+
+b
+output1
+
+
+b
+output2
+
+
+B \ No newline at end of file
diff --git a/config-model/src/test/cfg/application/ml_serving/models/mnist_softmax.onnx b/config-model/src/test/cfg/application/ml_serving/models/mnist_softmax.onnx
deleted file mode 100644
index a86019bf53a..00000000000
--- a/config-model/src/test/cfg/application/ml_serving/models/mnist_softmax.onnx
+++ /dev/null
Binary files differ
diff --git a/config-model/src/test/cfg/application/ml_serving/models/sqrt.onnx b/config-model/src/test/cfg/application/ml_serving/models/sqrt.onnx
new file mode 100644
index 00000000000..04a6420002c
--- /dev/null
+++ b/config-model/src/test/cfg/application/ml_serving/models/sqrt.onnx
@@ -0,0 +1,11 @@
+sqrt.py:V
+
+input out/layer/1:1"SqrtsqrtZ
+input
+
+
+b
+ out/layer/1:1
+
+
+B \ No newline at end of file
diff --git a/config-model/src/test/cfg/application/ml_serving/models/sqrt.py b/config-model/src/test/cfg/application/ml_serving/models/sqrt.py
new file mode 100644
index 00000000000..b7b99b3850c
--- /dev/null
+++ b/config-model/src/test/cfg/application/ml_serving/models/sqrt.py
@@ -0,0 +1,23 @@
+# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+import onnx
+from onnx import helper, TensorProto
+
+INPUT = helper.make_tensor_value_info('input', TensorProto.FLOAT, [1])
+OUTPUT = helper.make_tensor_value_info('out/layer/1:1', TensorProto.FLOAT, [1])
+
+nodes = [
+ helper.make_node(
+ 'Sqrt',
+ ['input'],
+ ['out/layer/1:1'],
+ ),
+]
+graph_def = helper.make_graph(
+ nodes,
+ 'sqrt',
+ [INPUT],
+ [OUTPUT],
+)
+model_def = helper.make_model(graph_def, producer_name='sqrt.py', opset_imports=[onnx.OperatorSetIdProto(version=12)])
+onnx.save(model_def, 'sqrt.onnx')
diff --git a/config-model/src/test/cfg/application/onnx/files/add.onnx b/config-model/src/test/cfg/application/onnx/files/add.onnx
new file mode 100644
index 00000000000..28318dbba4d
--- /dev/null
+++ b/config-model/src/test/cfg/application/onnx/files/add.onnx
@@ -0,0 +1,16 @@
+add.py:f
+
+input1
+input2output"AddaddZ
+input1
+
+
+Z
+input2
+
+
+b
+output
+
+
+B \ No newline at end of file
diff --git a/config-model/src/test/cfg/application/onnx/files/add.py b/config-model/src/test/cfg/application/onnx/files/add.py
new file mode 100755
index 00000000000..63b7dc87796
--- /dev/null
+++ b/config-model/src/test/cfg/application/onnx/files/add.py
@@ -0,0 +1,26 @@
+# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+import onnx
+from onnx import helper, TensorProto
+
+INPUT_1 = helper.make_tensor_value_info('input1', TensorProto.FLOAT, [1])
+INPUT_2 = helper.make_tensor_value_info('input2', TensorProto.FLOAT, [1])
+OUTPUT = helper.make_tensor_value_info('output', TensorProto.FLOAT, [1])
+
+nodes = [
+ helper.make_node(
+ 'Add',
+ ['input1', 'input2'],
+ ['output'],
+ ),
+]
+graph_def = helper.make_graph(
+ nodes,
+ 'add',
+ [
+ INPUT_1,
+ INPUT_2
+ ],
+ [OUTPUT],
+)
+model_def = helper.make_model(graph_def, producer_name='add.py', opset_imports=[onnx.OperatorSetIdProto(version=12)])
+onnx.save(model_def, 'add.onnx')
diff --git a/config-model/src/test/cfg/application/onnx/models/mul.onnx b/config-model/src/test/cfg/application/onnx/models/mul.onnx
new file mode 100644
index 00000000000..087e2c3427f
--- /dev/null
+++ b/config-model/src/test/cfg/application/onnx/models/mul.onnx
@@ -0,0 +1,16 @@
+mul.py:f
+
+input1
+input2output"MulmulZ
+input1
+
+
+Z
+input2
+
+
+b
+output
+
+
+B \ No newline at end of file
diff --git a/config-model/src/test/cfg/application/onnx/models/mul.py b/config-model/src/test/cfg/application/onnx/models/mul.py
new file mode 100755
index 00000000000..db01561c355
--- /dev/null
+++ b/config-model/src/test/cfg/application/onnx/models/mul.py
@@ -0,0 +1,26 @@
+# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+import onnx
+from onnx import helper, TensorProto
+
+INPUT_1 = helper.make_tensor_value_info('input1', TensorProto.FLOAT, [1])
+INPUT_2 = helper.make_tensor_value_info('input2', TensorProto.FLOAT, [1])
+OUTPUT = helper.make_tensor_value_info('output', TensorProto.FLOAT, [1])
+
+nodes = [
+ helper.make_node(
+ 'Mul',
+ ['input1', 'input2'],
+ ['output'],
+ ),
+]
+graph_def = helper.make_graph(
+ nodes,
+ 'mul',
+ [
+ INPUT_1,
+ INPUT_2
+ ],
+ [OUTPUT],
+)
+model_def = helper.make_model(graph_def, producer_name='mul.py', opset_imports=[onnx.OperatorSetIdProto(version=12)])
+onnx.save(model_def, 'mul.onnx')
diff --git a/config-model/src/test/cfg/application/onnx/searchdefinitions/test.sd b/config-model/src/test/cfg/application/onnx/searchdefinitions/test.sd
new file mode 100644
index 00000000000..d49782ddf39
--- /dev/null
+++ b/config-model/src/test/cfg/application/onnx/searchdefinitions/test.sd
@@ -0,0 +1,27 @@
+# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+search test {
+
+ document test {
+ field document_value type tensor<float>(d0[1]) {
+ indexing: attribute
+ }
+ }
+
+ onnx-model my_add {
+ file: files/add.onnx
+ input input1: attribute(document_value)
+ input input2: my_input_func
+ output output: out
+ }
+
+ rank-profile test {
+ function my_function() {
+ expression: tensor<float>(d0[1])(1)
+ }
+ first-phase {
+ expression: onnx(my_add).out{d0:1}
+ }
+ }
+
+}
diff --git a/config-model/src/test/cfg/application/onnx/services.xml b/config-model/src/test/cfg/application/onnx/services.xml
new file mode 100644
index 00000000000..8731558c6f7
--- /dev/null
+++ b/config-model/src/test/cfg/application/onnx/services.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
+<services version="1.0">
+
+ <container version="1.0">
+ <model-evaluation/>
+ <nodes>
+ <node hostalias="node1" />
+ </nodes>
+ </container>
+
+ <content id="test" version="1.0">
+ <redundancy>1</redundancy>
+ <documents>
+ <document mode="index" type="test"/>
+ </documents>
+ <nodes>
+ <node distribution-key="0" hostalias="node1" />
+ </nodes>
+ </content>
+
+</services>