-
Notifications
You must be signed in to change notification settings - Fork 1
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 float and double coexistance -- working towards that goal #7
Tfloat float and double coexistance -- working towards that goal #7
Commits on Jul 15, 2021
-
Add TFloat data type for neural network
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]>
Configuration menu - View commit details
-
Copy full SHA for 731726a - Browse repository at this point
Copy the full SHA 731726aView commit details -
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fa1850f - Browse repository at this point
Copy the full SHA fa1850fView commit details -
Optimize DotProductStdInnerProduct for float
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 507b8cb - Browse repository at this point
Copy the full SHA 507b8cbView commit details -
Avoid double / float conversion
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0f9acea - Browse repository at this point
Copy the full SHA 0f9aceaView commit details -
Implement TFloat for IntSimdMatrix
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 16437ca - Browse repository at this point
Copy the full SHA 16437caView commit details -
Test more implementations of DotProduct
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8e77429 - Browse repository at this point
Copy the full SHA 8e77429View commit details -
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c7034f0 - Browse repository at this point
Copy the full SHA c7034f0View commit details -
Support Apple Accelerate framework for training and best models
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f497c18 - Browse repository at this point
Copy the full SHA f497c18View commit details -
Fix TFloat builds for Apple M1
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4676d22 - Browse repository at this point
Copy the full SHA 4676d22View commit details -
Fix DotProductNative for TFloat
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 82236f6 - Browse repository at this point
Copy the full SHA 82236f6View commit details -
bugfix of FMA port to FAST_FLOAT: 8 float FPs fit in a single 256bit …
…vector (8x32) (contrasting 4 double FPs: 4*64)
Configuration menu - View commit details
-
Copy full SHA for 1402521 - Browse repository at this point
Copy the full SHA 1402521View commit details -
Configuration menu - View commit details
-
Copy full SHA for 00feac2 - Browse repository at this point
Copy the full SHA 00feac2View commit details -
bugfixing the AVX2 Extract8+16 codes, where there's lines like `__m25…
…6d scale01234567 = _mm256_loadu_ps(scales)`, i.e. loading float vectors into double vector types. Extract from tesseract-ocr#3490.
Configuration menu - View commit details
-
Copy full SHA for dd3b5f2 - Browse repository at this point
Copy the full SHA dd3b5f2View commit details -
Improve build code for native dotproduct
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a9ff366 - Browse repository at this point
Copy the full SHA a9ff366View commit details -
Enhance unittest/dotproduct_test
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9c6503b - Browse repository at this point
Copy the full SHA 9c6503bView commit details -
Remove test code for fast float dotproduct
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 284fdb0 - Browse repository at this point
Copy the full SHA 284fdb0View commit details -
Implement fast float dotproduct for SSE IntSimdMatrix
Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a71edc9 - Browse repository at this point
Copy the full SHA a71edc9View commit details -
Partially revert "Merge pull request tesseract-ocr#3330 from Sintun/m…
…aster" This partially reverts commit 122daf1, reversing changes made to 4cd56dc. This fixes a fatal assertion for certain images: cell_y_.size() >= 2 && cell_x_.size() >= 2:Error:Assert failed:in file ../../../src/textord/tablerecog.cpp, line 363 Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ffea0f2 - Browse repository at this point
Copy the full SHA ffea0f2View commit details -
Place TFloat type in the tesseract namespace, same as has been done w…
…ith all other tesseract defined types, to prevent collisions with thirdparty software.
Configuration menu - View commit details
-
Copy full SHA for 77cd861 - Browse repository at this point
Copy the full SHA 77cd861View commit details -
just a couple of 'shadowed local variables' compiler warning fixes th…
…at got through while I manually extracted the template work from my mainline (warnings due to running MSVC at Level 4) [sw]: Use different fix for blamer.cpp Signed-off-by: Stefan Weil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8d1c1e1 - Browse repository at this point
Copy the full SHA 8d1c1e1View commit details -
This is how the idea expressed in tesseract-ocr#3490 looks like: usin…
…g function templates for TFloat float & double implementations to co-exist in the run-time without cluttering the code with #if/#else and no run-time switches (yet). ## Observations thus far - DRY? Check! - the whole function template (and let the C++ compiler do the heavy lifting) idea of stops somewhere. This regrettably happens to be at the weightmatrix.cpp code, where the code calls the CPU+configuration-selected SIMD implementation via function pointer: `intSimdMatrix->matrixDotVectorFunction` -- this would require code duplication of some kind (e.g. a FP32 callback pointer co-existing with a FP64 callback ptr in the struct and then have the code pick the right one, depending on current TFloat size, for example) and is thus deemed unsatisfactory (my opinion). - So far, and very probably independent of any solutions for the co-existence issue at higher levels in the code, this template approach works out well, with the compiler smartly picking the one matching the current float/double choice. - while we have double the number of specialized SIMD implementations (obviously), these do not need #if/#else checks as we can let the C++ compiler do its prototype matching job --> cleaner code. - the template functions also help clean up the serialization/de-serialization code as the `<T, ST>` dual-type approach there allows one to specify the run-time type (TFloat) and the file-storage type at the same time: also do note how this cleans up the 'Old' scales deserialization code, as the old file storage is simply 'float' instead of 'double'. - the added cost there is a double copy of file data when T==ST, but that turned out negligible in the preliminary tests as that bit of code didn't even reach the Top20 CPU Guzzlers Chart, so that extra copy can wait for smarter C++ template writers to take care of when microtuning is called for.
Configuration menu - View commit details
-
Copy full SHA for 97834d0 - Browse repository at this point
Copy the full SHA 97834d0View commit details