export and run with bfloat16 weight matrices #407
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added export method to save matrix data in weights as bfloat16 while saving the rest as fp32. The
--version
value must be set to -1 (preliminary). Only the legacy export was changed so far.Added runbf16.c demonstrator how to run the bfloat16 matrix multiply using float32 arithmetics.
Speed is ok'ish, not great, but space is halved compared to fp32. 12 core skylake gold [email protected] runs with 1.3 tokens/s. Maybe somebody cares to optimize the matmul further.
This patch is a prerequisite for a SX-Aurora Vector Engine patch enabling it to run on bfloat16 data with >32 tokens / s (while running only in fp32 arithmetic units, too).