diff options
author | Dominic Symes <dominic.symes@arm.com> | 2023-01-20 16:09:31 +0000 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2023-02-01 16:40:50 +0000 |
commit | c386a052b8e1cd109ab4888c87cd3073a74edaa2 (patch) | |
tree | 914078caadda0244f81e306c3ca625fc55f0f0ff /chapters/appendix_a.adoc | |
parent | 5bb1f025503f0f626f187fdd5696864dc0ca1f2c (diff) | |
download | specification-c386a052b8e1cd109ab4888c87cd3073a74edaa2.tar.gz |
Main inference conformance draft
This patch contains a draft of the
Main Inference profile floating-point
conformance requirements.
Change-Id: Ib1201fff7f4015668b2de6dccf4cd85b419c3f76
Signed-off-by: Dominic Symes <dominic.symes@arm.com>
Diffstat (limited to 'chapters/appendix_a.adoc')
-rw-r--r-- | chapters/appendix_a.adoc | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/chapters/appendix_a.adoc b/chapters/appendix_a.adoc new file mode 100644 index 0000000..33a4f11 --- /dev/null +++ b/chapters/appendix_a.adoc @@ -0,0 +1,66 @@ +// +// This confidential and proprietary software may be used only as +// authorised by a licensing agreement from ARM Limited +// (C) COPYRIGHT 2023 ARM Limited +// ALL RIGHTS RESERVED +// The entire notice above must be reproduced on all authorised +// copies and copies may only be made to the extent permitted +// by a licensing agreement from ARM Limited. + +== Appendix A + +NOTE: This appendix is at an early stage of development at this point in time + +=== Random data generation + +The following function generates a pseudo-random floating-point value in the range -1.0 to +1.0 for use as test data. +It uses a modulo (1<<32) recurrent sequence with multiplier derived from "TOSASETS" and the set number. + +[source,c++] +---- +float set_data(uint32_t set, uint32_t index) +{ + uint32_t m = (8*set + 1) * 0x705A5E75; // mod (1<<32) calculation + uint32_t r = m + 1; // mod (1<<32) calculation + for (uint32_t i = 0; i < index; i++) { + r = r * m + 1; // mod (1<<32) calculation + } + float sign = (r>>31)==0 ? +1 : -1; + return sign * (float)(r & 0x7FFFFFFF) / (float)(0x7FFFFFFF); +} +---- + +=== Dot product floating-point test data sets + +Each test set is indexed by a pair (S, N) where: + +* S is the test set number +* N is the number of elements in a single test vector + +Each test set (S, N) contains multiple tests that statistics are calculated over. +The parameter T is the number of tests in a given set. +In the table below, t is the test number within a set in the range 0 to T-1. + +[cols="1,1,1,5,5"] +|=== +| Set S | N range | T | x[k] formula for k < N | w[k] formula for k < N + +| 0 +| 2-25,50,100,1000 +| 10 +| x[k]=set_data(S, 2*t*N+2*k) < 0 ? 0.0 : set_data(S, 2*t*N+2*k+1) +| w[k]=set_data(S, 2*t*N+2*k) < 0 ? set_data(S, 2*t*N+2*k+1) : 0.0 + +| 1 +| 2-25,50,100,1000 +| 1000 +| x[k]=2.0*set_data(S, 2*t*N + k) +| w[k]=2.0*set_data(S, (2*t+1)*N + k) + +| 2 +| 2-25,50,100,1000 +| 1000 +| x[0]=1.0, x[k]=set_data(S, 2*t*N + k)/sqrt(N) for k>0 +| w[0]=1.0, w[k]=set_data(S, (2*t+1)*N + k)/sqrt(N) for k>0 + +|=== |