diff options
author | Arne Juul <arnej@yahooinc.com> | 2023-03-17 11:58:03 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2023-03-17 13:43:26 +0000 |
commit | 6ee5e08f1ae70a16125f8dcfe49dee84cb99bbd5 (patch) | |
tree | ded6e0fce163f28bc84d2b42de9c0461fd830703 | |
parent | 07c7d7c29a960940213dba2db6f24c63353a0064 (diff) |
split test into multiple rank-profiles, and test DynamicTensor handling
-rw-r--r-- | config-model/src/test/derived/globalphase_onnx_inside/rank-profiles.cfg | 108 | ||||
-rw-r--r-- | config-model/src/test/derived/globalphase_onnx_inside/test.sd | 74 |
2 files changed, 171 insertions, 11 deletions
diff --git a/config-model/src/test/derived/globalphase_onnx_inside/rank-profiles.cfg b/config-model/src/test/derived/globalphase_onnx_inside/rank-profiles.cfg index e456dec58ed..9d21691a910 100644 --- a/config-model/src/test/derived/globalphase_onnx_inside/rank-profiles.cfg +++ b/config-model/src/test/derived/globalphase_onnx_inside/rank-profiles.cfg @@ -1,10 +1,49 @@ rankprofile[].name "default" +rankprofile[].fef.property[].name "vespa.type.attribute.aa" +rankprofile[].fef.property[].value "tensor(d1[3])" +rankprofile[].fef.property[].name "vespa.type.query.bb" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].fef.property[].name "vespa.type.query.yy" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].name "unranked" +rankprofile[].fef.property[].name "vespa.rank.firstphase" +rankprofile[].fef.property[].value "value(0)" +rankprofile[].fef.property[].name "vespa.hitcollector.heapsize" +rankprofile[].fef.property[].value "0" +rankprofile[].fef.property[].name "vespa.hitcollector.arraysize" +rankprofile[].fef.property[].value "0" +rankprofile[].fef.property[].name "vespa.dump.ignoredefaultfeatures" +rankprofile[].fef.property[].value "true" +rankprofile[].fef.property[].name "vespa.type.attribute.aa" +rankprofile[].fef.property[].value "tensor(d1[3])" +rankprofile[].name "simple" +rankprofile[].fef.property[].name "vespa.rank.firstphase" +rankprofile[].fef.property[].value "rankingExpression(firstphase)" +rankprofile[].fef.property[].name "rankingExpression(firstphase).rankingScript" +rankprofile[].fef.property[].value "reduce(attribute(aa), sum)" +rankprofile[].fef.property[].name "vespa.rank.globalphase" +rankprofile[].fef.property[].value "rankingExpression(globalphase)" +rankprofile[].fef.property[].name "rankingExpression(globalphase).rankingScript" +rankprofile[].fef.property[].value "onnx(direct).out{d0:(attribute(extra))}" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "attribute(aa)" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "attribute(extra)" +rankprofile[].fef.property[].name "vespa.globalphase.rerankcount" +rankprofile[].fef.property[].value "13" +rankprofile[].fef.property[].name "vespa.type.attribute.aa" +rankprofile[].fef.property[].value "tensor(d1[3])" +rankprofile[].fef.property[].name "vespa.type.query.bb" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].fef.property[].name "vespa.type.query.yy" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].name "one" rankprofile[].fef.property[].name "rankingExpression(handicap).rankingScript" rankprofile[].fef.property[].value "query(yy)" rankprofile[].fef.property[].name "rankingExpression(handicap).type" rankprofile[].fef.property[].value "tensor(d0[2])" rankprofile[].fef.property[].name "rankingExpression(indirect_a).rankingScript" -rankprofile[].fef.property[].value "attribute(aa) + tensor(d1[3])((d1 + attribute(extra)))" +rankprofile[].fef.property[].value "attribute(aa)" rankprofile[].fef.property[].name "rankingExpression(indirect_a).type" rankprofile[].fef.property[].value "tensor(d1[3])" rankprofile[].fef.property[].name "rankingExpression(indirect_x).rankingScript" @@ -25,24 +64,73 @@ rankprofile[].fef.property[].name "rankingExpression(globalphase).rankingScript" rankprofile[].fef.property[].value "reduce(constant(ww) * (onnx(inside).foobar - rankingExpression(handicap)), sum)" rankprofile[].fef.property[].name "vespa.match.feature" rankprofile[].fef.property[].value "attribute(aa)" +rankprofile[].fef.property[].name "vespa.globalphase.rerankcount" +rankprofile[].fef.property[].value "13" +rankprofile[].fef.property[].name "vespa.type.attribute.aa" +rankprofile[].fef.property[].value "tensor(d1[3])" +rankprofile[].fef.property[].name "vespa.type.query.bb" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].fef.property[].name "vespa.type.query.yy" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].name "two" +rankprofile[].fef.property[].name "rankingExpression(indirect_a).rankingScript" +rankprofile[].fef.property[].value "tensor(d1[3])((d1 + attribute(extra)))" +rankprofile[].fef.property[].name "rankingExpression(indirect_a).type" +rankprofile[].fef.property[].value "tensor(d1[3])" +rankprofile[].fef.property[].name "rankingExpression(indirect_x).rankingScript" +rankprofile[].fef.property[].value "constant(xx)" +rankprofile[].fef.property[].name "rankingExpression(indirect_x).type" +rankprofile[].fef.property[].value "tensor(d0[2],d1[3])" +rankprofile[].fef.property[].name "rankingExpression(indirect_b).rankingScript" +rankprofile[].fef.property[].value "query(bb)" +rankprofile[].fef.property[].name "rankingExpression(indirect_b).type" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].fef.property[].name "vespa.rank.firstphase" +rankprofile[].fef.property[].value "rankingExpression(firstphase)" +rankprofile[].fef.property[].name "rankingExpression(firstphase).rankingScript" +rankprofile[].fef.property[].value "reduce(attribute(aa), sum)" +rankprofile[].fef.property[].name "vespa.rank.globalphase" +rankprofile[].fef.property[].value "rankingExpression(globalphase)" +rankprofile[].fef.property[].name "rankingExpression(globalphase).rankingScript" +rankprofile[].fef.property[].value "reduce(constant(ww) * onnx(twoside).foobar, sum)" rankprofile[].fef.property[].name "vespa.match.feature" rankprofile[].fef.property[].value "attribute(extra)" rankprofile[].fef.property[].name "vespa.globalphase.rerankcount" -rankprofile[].fef.property[].value "13" +rankprofile[].fef.property[].value "42" rankprofile[].fef.property[].name "vespa.type.attribute.aa" rankprofile[].fef.property[].value "tensor(d1[3])" rankprofile[].fef.property[].name "vespa.type.query.bb" rankprofile[].fef.property[].value "tensor(d0[2])" rankprofile[].fef.property[].name "vespa.type.query.yy" rankprofile[].fef.property[].value "tensor(d0[2])" -rankprofile[].name "unranked" +rankprofile[].name "three" +rankprofile[].fef.property[].name "rankingExpression(indirect_a).rankingScript" +rankprofile[].fef.property[].value "tensor(d1[3]):{{d1:0}:0.25,{d1:1}:(attribute(extra)),{d1:2}:0.75}" +rankprofile[].fef.property[].name "rankingExpression(indirect_a).type" +rankprofile[].fef.property[].value "tensor(d1[3])" +rankprofile[].fef.property[].name "rankingExpression(indirect_x).rankingScript" +rankprofile[].fef.property[].value "constant(xx)" +rankprofile[].fef.property[].name "rankingExpression(indirect_x).type" +rankprofile[].fef.property[].value "tensor(d0[2],d1[3])" +rankprofile[].fef.property[].name "rankingExpression(indirect_b).rankingScript" +rankprofile[].fef.property[].value "query(bb)" +rankprofile[].fef.property[].name "rankingExpression(indirect_b).type" +rankprofile[].fef.property[].value "tensor(d0[2])" rankprofile[].fef.property[].name "vespa.rank.firstphase" -rankprofile[].fef.property[].value "value(0)" -rankprofile[].fef.property[].name "vespa.hitcollector.heapsize" -rankprofile[].fef.property[].value "0" -rankprofile[].fef.property[].name "vespa.hitcollector.arraysize" -rankprofile[].fef.property[].value "0" -rankprofile[].fef.property[].name "vespa.dump.ignoredefaultfeatures" -rankprofile[].fef.property[].value "true" +rankprofile[].fef.property[].value "rankingExpression(firstphase)" +rankprofile[].fef.property[].name "rankingExpression(firstphase).rankingScript" +rankprofile[].fef.property[].value "reduce(attribute(aa), sum)" +rankprofile[].fef.property[].name "vespa.rank.globalphase" +rankprofile[].fef.property[].value "rankingExpression(globalphase)" +rankprofile[].fef.property[].name "rankingExpression(globalphase).rankingScript" +rankprofile[].fef.property[].value "reduce(constant(ww) * onnx(another).foobar, sum)" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "attribute(extra)" +rankprofile[].fef.property[].name "vespa.globalphase.rerankcount" +rankprofile[].fef.property[].value "1001" rankprofile[].fef.property[].name "vespa.type.attribute.aa" rankprofile[].fef.property[].value "tensor(d1[3])" +rankprofile[].fef.property[].name "vespa.type.query.bb" +rankprofile[].fef.property[].value "tensor(d0[2])" +rankprofile[].fef.property[].name "vespa.type.query.yy" +rankprofile[].fef.property[].value "tensor(d0[2])" diff --git a/config-model/src/test/derived/globalphase_onnx_inside/test.sd b/config-model/src/test/derived/globalphase_onnx_inside/test.sd index f5788611b0a..3e48f912931 100644 --- a/config-model/src/test/derived/globalphase_onnx_inside/test.sd +++ b/config-model/src/test/derived/globalphase_onnx_inside/test.sd @@ -23,6 +23,26 @@ schema test { query(bb) tensor(d0[2]) query(yy) tensor(d0[2]) } + } + + rank-profile simple inherits default { + onnx-model direct { + file: files/ax_plus_b.onnx + input vector_A: attribute(aa) + input matrix_X: constant(xx) + input vector_B: query(bb) + output vector_Y: out + } + first-phase { + expression: sum(attribute(aa)) + } + global-phase { + rerank-count: 13 + expression: onnx(direct).out{d0:attribute(extra)} + } + } + + rank-profile one inherits default { onnx-model inside { file: files/ax_plus_b.onnx input vector_A: indirect_a @@ -41,7 +61,59 @@ schema test { expression: sum(constant(ww) * (onnx(inside).foobar - handicap)) } function indirect_a() { - expression: attribute(aa) + tensor(d1[3])(d1+attribute(extra)) + expression: attribute(aa) + } + function indirect_x() { + expression: constant(xx) + } + function indirect_b() { + expression: query(bb) + } + } + + rank-profile two inherits default { + onnx-model twoside { + file: files/ax_plus_b.onnx + input vector_A: indirect_a + input matrix_X: indirect_x + input vector_B: indirect_b + output vector_Y: foobar + } + first-phase { + expression: sum(attribute(aa)) + } + global-phase { + rerank-count: 42 + expression: sum(constant(ww) * onnx(twoside).foobar) + } + function indirect_a() { + expression: tensor(d1[3])(d1+attribute(extra)) + } + function indirect_x() { + expression: constant(xx) + } + function indirect_b() { + expression: query(bb) + } + } + + rank-profile three inherits default { + onnx-model another { + file: files/ax_plus_b.onnx + input vector_A: indirect_a + input matrix_X: indirect_x + input vector_B: indirect_b + output vector_Y: foobar + } + first-phase { + expression: sum(attribute(aa)) + } + global-phase { + rerank-count: 1001 + expression: sum(constant(ww) * onnx(another).foobar) + } + function indirect_a() { + expression: tensor(d1[3]):[0.25, attribute(extra), 0.75] } function indirect_x() { expression: constant(xx) |