Skip to content
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

Import matrix-multiply (PrepareA) from a separate wasm module #55

Closed
wants to merge 8 commits into from

Conversation

abhi-agg
Copy link

@abhi-agg abhi-agg commented Sep 9, 2021

Description

This PR resolves first 4 tasks of the issue browsermt/bergamot-translator#204

List of changes:

  • Restructure marian-dev, allowing it to import different implementations of int8PrepareA for wasm target
  • Add a fallback (a polyfill) dummy implementation of int8PrepareA (src/tensors/cpu/wasm_intgemm_fallback.cpp file) in marian-dev for wasm target and export it from marian wasm module
    • The fallback dummy implementation aborts initially
  • Change emscripten generated JS glue code to plug in this fallback implementation (until an optimized implementation is not landed in Firefox)

Please note that for integer 16-bit matrix multiplication, the wasm target still uses intgemm (we are not aborting for integer 16-bit matrix multiplication).

Added dependencies: none

How to test

Follow the README instructions to run the wasm test page and observe the abort messages in browser console logs.

Checklist

  • I have tested the code manually
  • I have run regression tests
  • I have read and followed CONTRIBUTING.md
  • I have updated CHANGELOG.md

@abhi-agg abhi-agg closed this Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant