Skip to content
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

Bump rten v0.10.0 #79

Merged
merged 2 commits into from
May 25, 2024
Merged

Bump rten v0.10.0 #79

merged 2 commits into from
May 25, 2024

Conversation

robertknight
Copy link
Owner

The changes include significant performance improvements for the GRU operator, which makes recognition of long text lines faster, as well as adapting the thread pool size to the number of physical rather than logical cores, reducing overhead on systems with SMT / hyperthreading.

To adapt to the thread pool changes, rten::thread_pool().run(...) is now used to run line recognition preprocessing in the same thread pool that is used to execute the recognition model. This avoids contention from having more threads than cores.

Benchmarks:

Testing with the polar-bears.png example on an Ice Lake Intel i5:

cargo build -r -p ocrs-cli
time target/release/ocrs ocrs-cli/test-data/polar-bears.png

Before: ~1.00s
After: ~570ms

In contrast with the why-rust.png example, which has a larger image but shorter lines, the impact is smaller:

Before: ~916ms
After: ~790ms

The changes include significant performance improvements for the GRU operator,
which makes recognition of long text lines faster, as well as adapting the
thread pool size to the number of physical rather than logical cores, reducing
overhead on systems with SMT / hyperthreading.
RTen model execution is multi-threaded by default. To avoid contention between
threads in the Rayon global thread pool and RTen's thread pool, run parallel
recognition over batches of line images in RTen's thread pool.
@robertknight robertknight merged commit 7e00182 into main May 25, 2024
2 checks passed
@robertknight robertknight deleted the bump-rten-v0.10.0 branch May 25, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant