Closed Bug 1811908 Opened 1 year ago Closed 5 months ago

Allow translations to work without requiring SSE 4.1

Categories

(Firefox :: Translations, enhancement)

enhancement

Tracking

()

RESOLVED WONTFIX

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.

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:

  1. We enable WASM SIMD also for SSE < 4.1;
  2. We build Marian without SSE and only ship that one to all users;
  3. 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.
Summary: Build Marian without forcing SSE 4.1 → Allow translations to work without requiring SSE 4.1

We can also ship multiple wasm bundles, and choose ones at runtime if that's helpful.

André, could you share a benchmark we could run to evaluate the various options we have here?

Flags: needinfo?(anatal)

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?

Flags: needinfo?(anatal)

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.

Flags: needinfo?(anatal)
See Also: → 1713062

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).

Flags: needinfo?(ydelendik)
Flags: needinfo?(aaggarwal)
Depends on: 1823968

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

Flags: needinfo?(ydelendik)
No longer blocks: fx-translation
Type: defect → enhancement
Flags: needinfo?(aaggarwal)

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.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.