aboutsummaryrefslogtreecommitdiff
path: root/chapters/introduction.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'chapters/introduction.adoc')
-rw-r--r--chapters/introduction.adoc34
1 files changed, 24 insertions, 10 deletions
diff --git a/chapters/introduction.adoc b/chapters/introduction.adoc
index fd9ec25..1fabcc3 100644
--- a/chapters/introduction.adoc
+++ b/chapters/introduction.adoc
@@ -210,13 +210,6 @@ The function tosa_reference_check_fp() defines the error range permitted by a gi
NOTE: The error criteria in this section are at an early draft stage and are likely to change during conformance test development.
-Error criteria are specified for a single operator.
-For a sequence of n operators, A[0] to A[n-1], there must be corresponding implementations, I[0] to I[n-1], such that:
-
-* Each I[k] implements A[k] with same or higher precision datatypes
-* Each I[k] meets the accuracy defined in this specification for the A[k] precision
-* The accuracy of the sequence A[0] to A[n-1] is no worse than the accuracy of the sequence I[0] to I[n-1]
-
The following criteria apply to all operations:
* If any input is a NaN and the result is floating-point then the result must be a NaN
@@ -268,14 +261,24 @@ Otherwise:the result must be within 1 ulp of the mathematical result.
Otherwise if the input is a zero the output must be an infinity of the same sign. +
Otherwise the result must be within 1 ulp of the mathematical result.
-| <<SIGMOID>>, <<TANH>>, <<POW>>, <<EXP>>, <<LOG>>, <<ERF>>
+| <<SIGMOID>>, <<TANH>>, <<LOG>>, <<ERF>>
| If the input to LOG is less than zero then the result must be a NaN. +
-If the inputs to POW are both zero then the result must be a NaN. +
-If the first input to POW is less than zero and the second input is not an integer then the result must be a NaN. +
If the result overflows the output must be an infinity of the correct sign. +
If the result underflows the output must be a zero of the correct sign. +
Otherwise the result must be within 5 ulp of the mathematical result.
+| <<EXP>>
+| Let `x` be an input element and `out_imp` the implementation output of `exp(x)`. +
+Let `out_ref` be the result of the fp64_t reference implementation of `exp(x)`. +
+Let `err_bnd = out_ref*exp2(-normal_fraction<in_out_t>)*(1+abs(x))` +
+Then `tosa_reference_check_fp_bnd<in_out_t>(out_imp, out_ref, out_bnd)` must be true
+
+| <<POW>>
+| Let `x`, `y` be input elements and `out_imp` the implementation output of `pow(x,y)`. +
+Let `out_ref` be the result of the fp64_t reference implementation of `pow(x,y)`. +
+Let `err_bnd = out_ref*exp2(-normal_fraction<in_out_t>)*(1+abs(log(abs(x))*y))` +
+Then `tosa_reference_check_fp_bnd<in_out_t>(out_imp, out_ref, out_bnd)` must be true
+
| <<REDUCE_SUM>>
| Each output can be expressed as a dot product of an input vector with a vector of ones. +
This dot product must meet the <<Dot product accuracy requirements>>
@@ -292,6 +295,17 @@ where `E = pow(1 + pow(2, -M-1), N) - 1`. In this expression M is the number of
|===
+===== Operator sequence precision requirement
+
+Precision criteria are specified for a single operator.
+
+An implementation M of a sequence of n TOSA operators, A[0] to A[n-1] is said to
+be compliant if M gives the same result as a sequence of implementations
+M[0] to M[n-1] such that:
+
+* Each M[k] implements A[k] with same or higher precision datatypes
+* Each M[k] meets the accuracy defined in this specification for A[k] where the M[k] output is converted to A[k] output precision using round to nearest
+
===== Dot product accuracy requirements
This section assumes an operation acting on tensors named 'input', 'weight' and optionally 'bias'.