Allow translations to work without requiring SSE 4.1
Categories
(Firefox :: Translations, enhancement)
Tracking
()
People
(Reporter: marco, Unassigned)
References
Details
Currently there appears to be a requirement for SSE 4.1 (from https://addons.mozilla.org/firefox/addon/firefox-translations/, "A CPU that supports SSE4.1 extensions is required for this addon to function properly. If it doesn't, an error will be displayed when the translation is being started."), which limits the number of users who can perform translations.
It would be nice to figure out if this requirement actually holds (bug 1713062 seems to point in another direction), and whether we can relax it.
Reporter | ||
Comment 1•1 year ago
|
||
The requirement actually comes from SpiderMonkey, Marian isn't built with SSE 4.1.
For Firefox, we enable WASM SIMD only if (Intel) hardware has SSE 4.1.
There are a few options:
- We enable WASM SIMD also for SSE < 4.1;
- We build Marian without SSE and only ship that one to all users;
- We build a Marian without SSE and a Marian with SSE, and ship the first to users with SSE < 4.1 and the second to users with SSE >= 4.1.
Comment 2•1 year ago
|
||
We can also ship multiple wasm bundles, and choose ones at runtime if that's helpful.
Reporter | ||
Comment 3•1 year ago
|
||
André, could you share a benchmark we could run to evaluate the various options we have here?
Comment 4•1 year ago
•
|
||
https://docs.google.com/spreadsheets/d/1oJaYqtRztfauYhUAR83tdd0ru-1DmYm5C1FKZEH7MeU/edit#gid=0
https://github.com/browsermt/marian-dev/pull/6#issuecomment-740439576
Reporter | ||
Comment 5•1 year ago
|
||
I was looking for a benchmark we could run ourselves to compare e.g. Marian without SIMD instructions (which was not tested before in the results you pointed to). Is there one we could easily run ourselves?
Comment 6•1 year ago
•
|
||
Not sure if I understood. You want to know if there's a tool to automatically profile and benchmark marian? If so, not that I'm aware. All tests to count wps were run manually.
I know Abhi profiled it recently when developing the intrinsics. You can ask if he has something. Not sure either if we ever built it without simd, probably not.
Reporter | ||
Comment 7•1 year ago
|
||
Maybe Yury or Abhishek can help here: either providing a benchmark that you used in the past, or helping us compile Bergamot/Marian without SSE and benchmark it against a Bergamot/Marian with SSE.
Also worth noting that the current build is not optimal because it is using SSE3 and not SSE4.1, and so the translation to WASM SIMD is not as good as it could be (see bug 1713062).
Comment 8•1 year ago
|
||
In the past JS team only needed tests to verify intrinsic interface implementation, which were provided at js/src/jit-test/tests/wasm/intrinsics/integer-gemm/ and dom/tests/mochitest/integer-gemm/ . There was no interest in correctness or performance.
I did some experiments to verify speed ups Wasm SIMD vs SSE3 vs AVX2 using e.g. https://github.com/yurydelendik/intgemm/blob/wasi/benchmarks/benchmark.cc
Updated•10 months ago
|
Reporter | ||
Updated•10 months ago
|
Reporter | ||
Updated•10 months ago
|
Reporter | ||
Comment 9•5 months ago
|
||
We have decided not to support < SSE 4.1 machines. The usage numbers are even lower now than those I found back in bug 1823968, so it's reasonable to estimate they'll soon reach 0.
Description
•