summaryrefslogtreecommitdiff
path: root/nn/runtime/test/fuzzing/TestRandomGraph.cpp
diff options
context:
space:
mode:
authorXusong Wang <xusongw@google.com>2019-06-10 17:29:38 -0700
committerXusong Wang <xusongw@google.com>2019-06-11 11:00:53 -0700
commitf0b6c450af089a1d1078f070001581e5ea2c7cf3 (patch)
tree10db90d5dcb96f3f061a614456d60f4950cf6a95 /nn/runtime/test/fuzzing/TestRandomGraph.cpp
parent92dfcd3899bba47d1db562365635c165292fa514 (diff)
downloadml-f0b6c450af089a1d1078f070001581e5ea2c7cf3.tar.gz
Relax the tolerable range for quant and boolean values.
Before this CL, the quant tolerable range is too strict for complex operations such as HEATMAP_MAX_KEYPOINT. The absolute tolerance, bias, and MSE criteria for quantized tensors are slightly relaxed. Before this CL, the accuracy checker does not allow any boolean value mismatch. However, there are several cases that two floating point values are very close to each other, and the result of comparison operations, e.g. GREATER, ends up to be flipped because of the accumulated error. With this CL, we only expect the number of mismatches does not exceed a certain ratio. Bug: 134801089 Test: NNT_static_fuzzing Change-Id: I7faabafce91b245f525b4ef39736862d82f38edc
Diffstat (limited to 'nn/runtime/test/fuzzing/TestRandomGraph.cpp')
-rw-r--r--nn/runtime/test/fuzzing/TestRandomGraph.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/nn/runtime/test/fuzzing/TestRandomGraph.cpp b/nn/runtime/test/fuzzing/TestRandomGraph.cpp
index eb6d4c663..4135bc6f2 100644
--- a/nn/runtime/test/fuzzing/TestRandomGraph.cpp
+++ b/nn/runtime/test/fuzzing/TestRandomGraph.cpp
@@ -413,10 +413,10 @@ const AccuracyCriteria kRelaxedCriteria = {
.float32 = {.atol = 1e-3f, .rtol = 1e-3f, .bias = 2e-5f, .mse = 1e-7f},
.float16 = {.atol = 1.0f, .rtol = 1.0f, .bias = 5e-3f, .mse = 1e-4f},
.int32 = {.atol = 1},
- .quant8Asymm = {.atol = 8, .bias = 1, .mse = 1},
- .quant8Symm = {.atol = 8, .bias = 1, .mse = 1},
- .quant16Asymm = {.atol = 8, .bias = 1, .mse = 1},
- .quant16Symm = {.atol = 8, .bias = 1, .mse = 1}};
+ .quant8Asymm = {.atol = 10, .bias = 1.5, .mse = 1.5},
+ .quant8Symm = {.atol = 10, .bias = 1.5, .mse = 1.5},
+ .quant16Asymm = {.atol = 10, .bias = 1.5, .mse = 1.5},
+ .quant16Symm = {.atol = 10, .bias = 1.5, .mse = 1.5}};
/*-- NNAPI 1.0 Operations ---------------------------------------------------*/
@@ -565,19 +565,19 @@ const AccuracyCriteria kSmallGraphCriteria = {
.float32 = {.atol = 1e-2f, .rtol = 1e-2f, .bias = 2e-5f, .mse = 1e-7f},
.float16 = {.atol = 1.0f, .rtol = 1.0f, .bias = 5e-3f, .mse = 1e-4f},
.int32 = {.atol = 1},
- .quant8Asymm = {.atol = 8, .bias = 1, .mse = 1},
- .quant8Symm = {.atol = 8, .bias = 1, .mse = 1},
- .quant16Asymm = {.atol = 8, .bias = 1, .mse = 1},
- .quant16Symm = {.atol = 8, .bias = 1, .mse = 1}};
+ .quant8Asymm = {.atol = 12, .bias = 2, .mse = 2},
+ .quant8Symm = {.atol = 12, .bias = 2, .mse = 2},
+ .quant16Asymm = {.atol = 12, .bias = 2, .mse = 2},
+ .quant16Symm = {.atol = 12, .bias = 2, .mse = 2}};
const AccuracyCriteria kLargeGraphCriteria = {
.float32 = {.atol = 1e-1f, .rtol = 1e-1f, .bias = 1e-2f, .mse = 1e-4f},
.float16 = {.atol = 1.0f, .rtol = 1.0f, .bias = 1e-1f, .mse = 5e-2f},
.int32 = {.atol = 1},
- .quant8Asymm = {.atol = 10, .bias = 2, .mse = 2},
- .quant8Symm = {.atol = 10, .bias = 2, .mse = 2},
- .quant16Asymm = {.atol = 10, .bias = 2, .mse = 2},
- .quant16Symm = {.atol = 10, .bias = 2, .mse = 2}};
+ .quant8Asymm = {.atol = 12, .bias = 2, .mse = 2},
+ .quant8Symm = {.atol = 12, .bias = 2, .mse = 2},
+ .quant16Asymm = {.atol = 12, .bias = 2, .mse = 2},
+ .quant16Symm = {.atol = 12, .bias = 2, .mse = 2}};
// Due to the limitation of the random graph generator, graphs generated with mixed-type or
// mixed-rank operations are likely to result in a disconnected network. Thus, we filter the