-
Notifications
You must be signed in to change notification settings - Fork 41
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
Performance of Rust crate #30
Comments
Hi, which bindings to nnsplit are you using? The Rust bindings can be quite slow unfortunately because batching in tract does not work if the length dimension is dynamic too (there can only be one dynamic dim). Python bindings should be very fast though with sufficiently large batch size. |
Hello, I am indeed using it from Rust. |
Having a fixed length is not possible or at least not feasible. That would mean specifying ahead of time that you are e.g. always using 100 bytes as input. That means that you have to pad input which is shorter than that and have to truncate input which is longer. Padding shorter texts is possible (but will slow things down too) but truncating longer text loses information. The proper fix is tract being able to optimize models across more than one dimension which is tracked here: sonos/tract#313 The easiest way to make things faster right now is using the Python bindings (the Python bindings are written in Rust too, you might get https://github.com/bminixhofer/nnsplit/tree/master/bindings/python/src usable from your Rust code). Alternatively you can use the |
Thanks for pointing me at |
That would be great! FYI, https://github.com/languagetool-org/languagetool/blob/master/languagetool-core/src/main/resources/org/languagetool/resource/segment.srx is the most useful SRX file for sentence segmentation that I know of. I'll leave this open for now, performance of the Rust backend is indeed an issue (and the reason I made |
There's been significant progress in tract and batched input is working now: sonos/tract#383 Once it is released, I'll update it in nnsplit. It should lead to a > 20x Speedup of the Rust & Javascript bindings for batched input. |
Nice, I need to check it out. |
I finally got around to updating this, the Rust bindings should be at least 10x faster as of v0.5.8 for sufficiently large input. |
I am getting fairly poor performance in release mode (CPU)… 2kB/s.
Is there a guide on using the GPU?
The text was updated successfully, but these errors were encountered: