Skip to content

[Web] Allow to disable the SIMD detection check #24292

Description

@Eldow

Hello dear onnx team 👋

We are currently making verifications before switching from a legacy sklearn implementation in javascript to ONNX runtime web to run our machine learning models in our web extension and are noticing an issue with a sizeable share of our users.

When trying to load the WASM file, ONNX runtime web performs a feature detection for SIMD which fails in our case for about 20K users out of 600K active users.

From the logs, I figured it couldn't be related to the browser version as they were happening on up to date browsers which should have proper SIMD support, neither OS related as the issue seems to happen on Windows 10, MacOS Catalina and Linux x86_64 distributions. I suspect the issue might be hardware/CPU related.

Could it be because of some specific features from the SIMD detection being not available in some systems ? Are you aware of some limitations ?
eg.

// (module
    //   (type $t0 (func))
    //   (func $f0 (type $t0)
    //     (drop
    //       (i32x4.dot_i16x8_s
    //         (i8x16.splat
    //           (i32.const 0))
    //         (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)))))

We are building our own WASM file using the documentation so we could theoretically build a non-SIMD WASM but there is no option to disable the detection check in onnx-runtime-web.

Do you think it would makes sense to add some sort of flag to disable SIMD detection to support providing custom non SIMD wasm files ?

Thank you !

To reproduce

I am not sure how to reproduce exactly as I don't have the exact hardware information where the simd detection fails.

Urgency

This issue prevents a share of our users (20K) to benefit from some AI features.

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.19.2

Execution Provider

'wasm'/'cpu' (WebAssembly CPU)

Metadata

Metadata

Assignees

No one assigned

    Labels

    api:Javascriptissues related to the Javascript APIplatform:webissues related to ONNX Runtime web; typically submitted using template

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions