-
Notifications
You must be signed in to change notification settings - Fork 9.8k
RFC: Best Practices re OPENMP - for training, evaluation and recognition #3744
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
Comments
OPENMP is not needed for training. It even makes things worse for me. Timing results for
|
The plan is to disable it by default in 5.1.0. |
... in autoconf builds. cmake already disables it by default. |
Note that even without OPENMP training uses up to two CPU threads, one for training which runs until training is finished and one for evaluation which runs from time to time during the training process. |
The reason for disabling OpenMP is that Tesseract currently uses it inefficiently. For text recognition the speed benefit for using OpenMP with fast / tessdata (best->int) traineddata is too small while it consumes too much CPU resources. For training the OpenMP code is even more problematic than the code used for text recognition. I'm not sure how much speed will be lost here. |
Thank you!
Does |
Yes, currently it is necessary to use I updated my comment to be clearer. |
|
Stefan, for 5.1.0, do you want to keep a way to enable OpenMP with |
Ok. I will try to test training from font scenarios in my tess5train-fonts repo to see if they get similar results. |
lstmevalWhich no OPENMP (--disable-openmp)
Enabled OPENMP
|
lstmeval - engImpactNo OPENMP
OPENMP
|
"real" is the time spent from program start to termination. In your test scenario
Yes, I think that's necessary because of compatibility and also because it can be useful as in @Shreeshrii's test case on ARM. |
Running Tesseract with several threads seems to work better on ARM than on Intel architectures. I noticed that with Apple M1 (AARCH64), too. |
I am running this on AARCH64. |
Also, my tests shows that the enabled OPENMP could make sense in some cases (e.g. for the best data model on Windows & MSVC2019 and Intel processor) It would be great if we found somebody familiar with OpenMP at least for review how tesseract use it... |
My timings for OpenMP on Windows MSVC at the end of issue #3044. |
Thanks, @tdhintz It would be good to know if the results still hold. If possible, please rerun tests with the tesseract 5 released version or latest GitHub version, since there have been many changes since 2020. |
@Shreeshrii I'll add that task to our plan for late March. We build with very specific settings to get best results and I'm sure the build process has changed again, so this will be a heavy lift. |
Looks like someone did this already: OpenMP benchmark |
That test by @zdenop uses one image 15 times. Your tests use many more combinations.
I understand. |
For Tesseract 5 what are the best practices regarding OPENMP.
Is it still true:
--enable-openmp
.lstmeval
(built with--enable-openmp
), useOMP_THREAD_LIMIT=1
.tesseract
(built with--enable-openmp
), useOMP_THREAD_LIMIT=1
.The text was updated successfully, but these errors were encountered: