diff options
author | Eric Kunze <eric.kunze@arm.com> | 2023-10-20 15:58:55 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2024-02-14 16:36:04 -0800 |
commit | 74e2ceba954ed6111b3e3ce40c5ff88fe79ff043 (patch) | |
tree | 7e1967b073313d7df4885693eda931230d401eb0 /pseudocode/library/numeric_accuracy_helpers.tosac | |
parent | 9fe5e964e2193f0e345670f7f4098beecd7fd6eb (diff) | |
download | specification-74e2ceba954ed6111b3e3ce40c5ff88fe79ff043.tar.gz |
Initial FP8 support
Adds support for Open Compute Project (OCP) 8-bit floating point operations
to the TOSA specification. Both E4M3 and E5M2 types are supported for profiles
as indicated in the Supported Data Types table for each operator.
FP8 operator list
ARGMAX
AVGPOOL
CONV2D
CONV3D
DEPTHWISE_CONV2D
MATMUL
MAX_POOL2D
TRANSPOSE_CONV2D
CONST
CAST
CONCAT
PAD
DIM
RESHAPE
REVERSE
SLICE
TILE
TRANSPOSE
GATHER
SCATTER
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: I3dd83f48afcc3c880c5c88039337ff4f1fd95b1b
Diffstat (limited to 'pseudocode/library/numeric_accuracy_helpers.tosac')
-rw-r--r-- | pseudocode/library/numeric_accuracy_helpers.tosac | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pseudocode/library/numeric_accuracy_helpers.tosac b/pseudocode/library/numeric_accuracy_helpers.tosac index 4a2b111..b89d898 100644 --- a/pseudocode/library/numeric_accuracy_helpers.tosac +++ b/pseudocode/library/numeric_accuracy_helpers.tosac @@ -31,6 +31,8 @@ fp64_t normal_min<in_t>() { case fp32_t: return exp2(-126); case bf16_t: return exp2(-126); case fp16_t: return exp2( -14); + case fp8e4m3_t: return exp2(-6); + case fp8e5m2_t: return exp2(-14); } } @@ -39,6 +41,8 @@ fp64_t normal_max<in_t>() { case fp32_t: return exp2(128) - exp2(127-23); case bf16_t: return exp2(128) - exp2(127- 7); case fp16_t: return exp2( 16) - exp2( 15-10); + case fp8e4m3_t: return exp2( 9) - exp2( 8-2); + case fp8e5m2_t: return exp2( 16) - exp2( 15-2); } } @@ -48,5 +52,7 @@ int normal_frac<in_t> () { case fp32_t: return 23; case fp16_t: return 10; case bf16_t: return 7; + case fp8e4m3_t: return 3; + case fp8e5m2_t: return 2; } } |