You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix edge in softmax stable impl norm_t type inference: consider fixed<2,2> *arr of range {-2,-1,0,1}max(arr) - arr can be all {0,1,2,3}, so iwidth and width shall be kept if was signed.
Indeed they are reproducible, but the situation is rather complicated:
First of all, it is possible to have overflows without the fix. However, having an overflow here that is noticeable in practice is pretty rare.
Regarding the precision drop, by default, the table_sizes are 1024 everywhere, which means we always take 10 most significant bits from the inputs. However, since the output of the last dense is not quantized, it gets by default fixed<16,6>. Without the fix, the table effectively sees ufixed<15,-5>, but with the fix, the table now sees ufixed<16,-6>, making the lookup less accurate in the relevant region (low value).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Description
Fix edge in softmax stable impl norm_t type inference: consider
fixed<2,2> *arrof range{-2,-1,0,1}max(arr) - arrcan be all{0,1,2,3}, soiwidthandwidthshall be kept if was signed.Type of change
Tests
Checklist