Skip to content

Support SIMD #56

Closed
Closed

Description

@dtruffaut

SIMD instructions (https://v8.dev/features/simd) are interesting for parallel processing tasks like

  • Machine Learning (Tensorflow)
  • Image manipulation
  • ...etc.

For example, WASM VIPS (https://github.com/kleisauke/wasm-vips), used for image manipulation, requires a platform that supports SIMD.

For V8-based engines, at least version 9.1.54 is required to match the final SIMD opcodes, this corresponds to Chrome 91, Node.js 16.4.0 and Deno 1.9.0.

For Spidermonkey-based engines, the JavaScript engine used in Mozilla Firefox and whose version numbers are aligned, at least version 89 is required.

JavaScriptCore-based (e.g. Safari, Bun) engines are currently not supported.

WASM VIPS cannot currently run on Cloudflare Workers for other reasons (SharedBufferAPI)
See kleisauke/wasm-vips#2

That being said, supporting SIMD would make Cloudflare Workers a step closer to the browser's web workers.

Activity

  1. anarchodin commented on Sep 29, 2022

    @anarchodin

    The V8 documentation page you referred to suggests using wasm-feature-detect to check if the WASM engine supports SIMD instructions. According to that, workerd already supports SIMD instructions, so that shouldn't be an obstacle to getting wasm-vips to work. The fact that it assumes that thread spawning (new Worker()) is available seems to be the real stumbling block.

  2. kentonv commented on Sep 30, 2022

    @kentonv
    Member

    AFAIK, Cloudflare Workers has supported SIMD ever since V8 turned it on by default, which was years ago.

    That said, I haven't tested it personally. Do you have some reason to believe that SIMD doesn't work on Workers?

  3. dtruffaut commented on Sep 30, 2022

    @dtruffaut
    Author

    Good to know !

    I did not test the support of SIMD.

    I simply needed to know if it was supported or not.

    As a developer, it is sometimes hard to track what feature is available or not on the platform, as Workers is not exactly Chrome nor V8.

    I understand that documenting every supported feature can be complex and time consuming.

    Maybe a matrix with known supported or at least known unsupported features could help to enlight developers in their design choices, before the development phase (before they engage development costs).

    I close this issue.

    Thanks for your reactivity !

  4. irvinebroque commented on May 16, 2023

    @irvinebroque
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest for Workers team to add a feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions