-
Notifications
You must be signed in to change notification settings - Fork 38
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
Translations produced by test_page are (very, hilariously) wrong #206
Comments
This is an issue with the GEMM, because either the WASM wormhole was not enabled (have you checked if it's enabled?) or if you are running apple M1 hardware, which is not supported. |
For what it's worth, I had previously reported this on |
@XapaJIaMnu how do I check whether its enabled? I did run the patch script. And this is executed in chromium, with the command line arguments that are given in the readme. |
Also, it's not on M1 |
Did you use the Chrome canary 90+ with the appropriate flag: https://github.com/browsermt/bergamot-translator/tree/main/wasm#demo
|
@lhk Currently, this feature doesn't work on Google Chrome browser (it used to). We are working on making it run there again. In the meanwhile, you can try running it on Firefox Nightly where the translation speeds will be higher compared to running it on Chrome. I will update the README to reflect the latest status 👍 |
Root cause is WebAssembly. Specifically it does not support 8-bit integer multiplication anywhere near efficiently WebAssembly/relaxed-simd#9 . As mitigations, we should check that the 8-bit instruction is working first (by running it) and bail with an error when that happens, ideally one presented to the user. We could emulate with 16-bit integer instructions though this will make it even slower. Full resolution entails not using WebAssembly at all for 12x speedup: https://translatelocally.com/ |
@XapaJIaMnu I'm running chromium 90+, over the command line and specifying that flag. @abhi-agg can I run the code without this feature then? What if I don't apply the patch script? @kpu interesting, thanks a lot for the details. |
@lhk Unfortunately not because this feature was statically included for a faster experimentation. However, as I mentioned, we are working on a solution (should be landed soon) that will allow it to perform inference on Chrome as well (without this feature). |
If you want a working version but care even less about speed, compile all the WASM stuff with https://github.com/kpu/intgemm/blob/master/CMakeLists.txt#L82-L85 with |
I've followed your instructions to the letter, regarding the building of wasm, hosting the test page and running chrome with the correct command line arguments.
But when I open the test translation page and try it on some simple sentences, it outputs translations that are not even close to anything reasonable. In case you wonder, "schwanger" means "pregnant":
Similar problems appear for the other languages. At least "schwanger" is actually a German word. English to Spanish translates that phrase as "engineering engineering engineering engineering ...."
The text was updated successfully, but these errors were encountered: