Coder Social home page Coder Social logo

Comments (5)

abhi-agg avatar abhi-agg commented on July 21, 2024 1

But why can't we use the wormhole version when the intrinsics are not present, like in Release?

We can definitely use this approach but only in FFx because wormhole is FFx specific. For non-FFx case, we will have to use the slow fallback gemm. So the solution would be:

  1. In Firefox browser
    1. Use mozIntGemm (i.e. optimized gemm) if available else use wormhole
  2. All other browsers
    1. Use pure wasm based gemm without any wormhole

To support this workflow, the extension:

  1. Should have the capability to differentiate b/w various browser environments i.e. Firefox Nightly vs Firefox non-Nightly vs Non-Firefox). This is possible. Right?
  2. Should download the specific bergamot-translator-worker.js and bergamot-translator-worker.wasm artifacts based on the browser environment (because these artifacts are different for wormhole than the non-wormhole case) and work with them. #82 is a prerequisite for achieving this task.

from firefox-translations.

abhi-agg avatar abhi-agg commented on July 21, 2024

We will see speed-up only if the extension is a privileged one. Otherwise, the extension will fallback to extremely slow fallback gemm.

from firefox-translations.

andrenatal avatar andrenatal commented on July 21, 2024

Well, if the extension is not privileged, it won't work at all, since the UI also requires privileged permissions. There's no scenario where this can work at all if not privileged.

But why can't we use the wormhole version when the intrinsics are not present, like in Release?

from firefox-translations.

andrenatal avatar andrenatal commented on July 21, 2024

@abhi-agg the extension won't work on non-FF environments anyway, since it utilizes privileged APIs not available in other browsers, so yes, in other browsers, in the context of a regular webpage, it should Use pure wasm based gemm without any wormhole

Being specific to your question:
1 - Yes.
2 - Yes.

from firefox-translations.

abhi-agg avatar abhi-agg commented on July 21, 2024

@abhi-agg the extension won't work on non-FF environments anyway, since it utilizes privileged APIs not available in other browsers, so yes, in other browsers, in the context of a regular webpage, it should Use pure wasm based gemm without any wormhole

This reduces the overall complexity then. Since this extension won't work on non-FFx environments, there is no need to load/import the translator artifacts that support the non-FFx browsers (i.e. non-wormhole ones) in this extension. This implies:

To support this workflow, the extension:

1. Should have the capability to differentiate b/w various browser environments i.e. Firefox Nightly vs Firefox non-Nightly vs Non-Firefox). This is possible. Right?

2. Should download the specific `bergamot-translator-worker.js` and `bergamot-translator-worker.wasm` artifacts based on the browser environment (because these artifacts are different for wormhole than the non-wormhole case) and work with them.

We don't need to do any of this because the extension should use optimized gemm whenever it is available and resorts to use wormhole-based fallback gemm otherwise. This is achievable using only 1 set of artifacts and has been fixed in #111. Hence closing this issue.

from firefox-translations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.