-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tfloat patch 4: bugfixes for AVX2 FAST_FLOAT Extract8+16 implementations #3494
Conversation
Up to now Tesseract used double for training and recognition with "best" models. This commit replaces double by a new data type TFloat which is double by default, but float if FAST_FLOAT is defined. Ideally this should allow faster training. Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
…6d scale01234567 = _mm256_loadu_ps(scales)`, i.e. loading float vectors into double vector types. Extract from tesseract-ocr#3490.
Hi, You are doing patches wrong. |
…ation: for TFloat to work, we don't need to duplicate the integer work functions as it's only the ExtractResults16[8,16] functions that need different implementations for float vs. double. These are therefor common to both implementations: ``` static void PartialMatrixDotVector64(const int8_t *wi, const TFloat *scales, const int8_t *u, int num_in, TFloat *v) { static void PartialMatrixDotVector32(const int8_t *wi, const TFloat *scales, const int8_t *u, int num_in, TFloat *v) { static void PartialMatrixDotVector16(const int8_t *wi, const TFloat *scales, const int8_t *u, int num_in, TFloat *v) { static inline void PartialMatrixDotVector8(const int8_t *wi, const TFloat *scales, const int8_t *u, int num_in, TFloat *v) { static void matrixDotVector(int dim1, int dim2, const int8_t *wi, const TFloat *scales, const int8_t *u, TFloat *v) { ```
Note: #3495 is this one (#3494) PLUS FAST_FLOAT condition only applied to the ExtractXYZ calls, as the others are good to go with only their prototype adjusted from double --> TFloat. Hence #3495 is only moving code compared to this one, no code change. (I don't know what diff tools you use, but thus this one (#3494) would be easier to diff/review, and then verify that #3495 is only copy/cut/paste work, resulting in a much larger diff) |
Crap. Yep, seen it. 😊 Discard. Will re-issue. |
🤔 I used the github link and didn't watch carefully that the bugger ref'd against mainline master instead of stweil/tfloat. Checked against my own visual commit graph and these were correct, but definitely wholly wrong to submit against master. ugh. |
Re-issued as stweil#4. |
Extract from #3490 - bugfixing the AVX2 Extract8+16 codes, where there's lines like
__m256d scale01234567 = _mm256_loadu_ps(scales)
, i.e. loading float vectors into double vector types. Extract from #3490.Note: next pullreq is a reduced version of this: less code duplication for bleeding edge tfloat branch.