diff options
author | Tai Ly <tai.ly@arm.com> | 2024-03-21 17:01:14 +0000 |
---|---|---|
committer | Tai Ly <tai.ly@arm.com> | 2024-04-08 22:18:34 +0000 |
commit | ce911a2f1d9cd678fb9fe82a40c86ad0c6772f5a (patch) | |
tree | 68faf6d7b1c676705a022b32d8aa7950db03ab5e /include/attribute.def | |
parent | 8f9e2842ce7d25645233ad4f6fa406be982346ae (diff) | |
download | serialization_lib-ce911a2f1d9cd678fb9fe82a40c86ad0c6772f5a.tar.gz |
Add conversions of U8 to/from BF16 and FP8
Adds type to PadAttribute and ClampAttribute so their pad_const
and max_val/min_val can be deserialized according to type
Adds conversion functions of U8 arrays to/from BF16/FP8 values
Also, refactor and expose TosaSerializer.convertDataToUint8Vec
for converting dtype/data to uint8 list for serialization
And modify convertDataToUint8Vec to serialize bf16 values into
2 bytes each, and serialize fp8 values into single bytes each.
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I05659e8187c76d359f1cc9f71c8c23cafd0e877f
Diffstat (limited to 'include/attribute.def')
-rw-r--r-- | include/attribute.def | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/attribute.def b/include/attribute.def index 723543e..30b432d 100644 --- a/include/attribute.def +++ b/include/attribute.def @@ -52,8 +52,9 @@ DEF_ATTRIBUTE(TransposeConv, 7, bool, S, local_bound, DType, S, acc_type) -DEF_ATTRIBUTE(Pad, 1, - uint8_t, V, pad_const) +DEF_ATTRIBUTE(Pad, 2, + uint8_t, V, pad_const, + DType, S, type) DEF_ATTRIBUTE(Axis, 1, int32_t, S, axis) @@ -64,9 +65,10 @@ DEF_ATTRIBUTE(Resize, 4, int16_t, V, border, ResizeMode, S, mode) -DEF_ATTRIBUTE(Clamp, 2, +DEF_ATTRIBUTE(Clamp, 3, uint8_t, V, min_val, - uint8_t, V, max_val) + uint8_t, V, max_val, + DType, S, type) DEF_ATTRIBUTE(Rescale, 7, int32_t, S, input_zp, |