Closed Bug 1714438 Opened 4 years ago Closed 2 years ago

Firefox Translations doesn't work using an ARM CPU

Categories

(Firefox :: Translations, defect)

Firefox 91
ARM64
All
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox91 --- affected

People

(Reporter: AwesomeSheep48, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

Steps to reproduce

  1. Set extensions.translations.disabled to false in about:config and restart Firefox
  2. go to https://es.wikipedia.org/wiki/Wikipedia:Portada
  3. Select "translate this page"

Expected results

The page gets translated to something readable

Actual results

Every word gets changed to "outside"

Summary: Firefox Translations translates everything on es.wikipedia.org to "Outside" → Firefox Translations translates everything in Spanish "Outside"

I'm the project coordinator. This sounds like one of the numerical routines broke. Can you tell us which CPU model you have?

Flags: needinfo?(daviswill048)

Apple M1

Flags: needinfo?(daviswill048)

Root cause is WebAssembly doesn't support 8-bit integer multiplication. We went behind WebAssembly's back to get access to the 8-bit x86 instruction maddubs via https://bugzilla.mozilla.org/show_bug.cgi?id=1672160 . This hasn't been done for ARM. If we want to support ARM, then we need to talk to Mozilla's Spidermonkey team about how to get the wormhole for ARM using e.g. SDOT.

Until then, the 8-bit matrix multiply is broken and the translation system will produce garbage results on non-x86.

Hardware: Unspecified → ARM64

Reproduced on the latest version of Firefox Nightly 91.0a1 (2021-06-07) on MiniMac M1 11.0.1.
Setting a Severity of S3.

Kennet is this translation feature only available in 91? I cannot test it for beta or release since the pref isn't implemented.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(bugzilla)

It's only available in nightly.

Flags: needinfo?(bugzilla)

@lth do we have support for arm listed in the bugtree of dependencies we recently created and/or is this something we can do and add to our roadmap?

Flags: needinfo?(lhansen)
Blocks: 1713056
No longer blocks: 1713056
Depends on: 1713056

We could easily add arm64 SDOT and/or UDOT through the wormhole, we might also need to have some kind of hardware detection, ideally something that will resolve to a constant as the JIT compiles the code. Not terribly hard to do that, very modest work. One thing that gives me pause is that SDOT/UDOT are ARMv8.2 and later, and are marked as optional in ARMv8.2 and ARMv8.3. They are probably available on the M1 (haven't checked; will check) but there may be a need for a fallback for non-Apple CPUs, if/when that becomes a concern.

A better fix would be the matrix multiply intrinsic that Kenneth and I have been discussing, but that's quite a bit more work of course.

Flags: needinfo?(lhansen)

(In reply to Lars T Hansen [:lth] from comment #8)

One thing that gives me pause is that SDOT/UDOT are ARMv8.2 and later, and are marked as optional in ARMv8.2 and ARMv8.3. They are probably available on the M1 (haven't checked; will check) but there may be a need for a fallback for non-Apple CPUs, if/when that becomes a concern.

The M1 is an ARMv8.5-A and SDOT and UDOT are required features since v8.4 so we're OK for Apple hardware. If we were doing something quick and dirty to just get this feature off the ground for the new Apple systems then I would probably ifdef the wormhole feature as Darwin-only; that should be OK in the short term. Going beyond that we would need to do feature detection, which is known territory on Linux/Android but will require new code on eg Win10-on-arm64.

Spun this off as bug 1715704, please follow up there with technical matters.

Attached image es.wikipedia.org

Doesn't say outside anymore, instead it says

lorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlor éstelor éste éste
lorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlor éstelor éste éste
lorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlor éstelor éste éste
lorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlor éstelor éste éste
lorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlor éstelor éste éste
lorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlorlor
Attachment #9225073 - Attachment is obsolete: true
Attachment #9225513 - Attachment is obsolete: true
OS: Unspecified → All
Summary: Firefox Translations translates everything in Spanish "Outside" → Firefox Translations doesn't work using an ARM CPU

The Firefox Translations extension does work now on my M1 mac

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

Attachment

General

Created:
Updated:
Size: