Skip to content

[ORT CPU][ORT GPU][WebNN] Wrong results to run some WebNN dequantizeLinear tests #26525

@BruceDai

Description

@BruceDai

Describe the issue

Wrong results to run some WebNN dequantizeLinear tests by both ORT default CPU EP and ORT default GPU EP.

Test Error message
dequantizeLinear int32 1D tensor with float32 1D scale assert_less_than_equal: assert_array_approx_equals_ulp: test dequantizeLinear float32 actual 0 should be close enough to expected -22405.495643615723 by ULP distance: expected a number less than or equal to 1n but got 1185876734n
dequantizeLinear with float32 3D scale as an intermediate node assert_less_than_equal: assert_array_approx_equals_ulp: test transpose reshape dequantizeLinear float32 actual 0 should be close enough to expected -1.1202747821807861 by ULP distance: expected a number less than or equal to 1n but got 1066362154n
dequantizeLinear int32 1D tensor with float16 1D scale assert_less_than_equal: assert_array_approx_equals_ulp: test dequantizeLinear float16 actual 0 should be close enough to expected -22400 by ULP distance: expected a number less than or equal to 1 but got 62840
dequantizeLinear with float16 3D scale as an intermediate node assert_less_than_equal: assert_array_approx_equals_ulp: test transpose reshape dequantizeLinear float16 actual 0 should be close enough to expected -1.1201171875 by ULP distance: expected a number less than or equal to 1 but got 48251

/cc @fdwr PTAL, thanks!

To reproduce

  1. Install Windows App SDK Stable 1.8.2 (1.8.251003001)
  2. Install lates Edge Canary browser
  3. Launch Edge Canary browser, navigate to about://flags enabled "Enables WebNN API" and "ONNX Runtime backend for WebNN" flags, then relaunch browser
  4. Navigate to below test url, get above issue with wrong results
Test Test URL
dequantizeLinear int32 1D tensor with float32 1D scale https://wpt.live/webnn/conformance_tests/dequantizeLinear.https.any.html?device=cpu&tc=dequantizeLinear%20int32%201D%20tensor%20with%20float32%201D%20scale
dequantizeLinear with float32 3D scale as an intermediate node https://wpt.live/webnn/conformance_tests/dequantizeLinear.https.any.html?device=cpu&tc=dequantizeLinear%20with%20float32%203D%20scale%20as%20an%20intermediate%20node
dequantizeLinear int32 1D tensor with float16 1D scale https://wpt.live/webnn/conformance_tests/dequantizeLinear.https.any.html?device=cpu&tc=dequantizeLinear%20int32%201D%20tensor%20with%20float16%201D%20scale
dequantizeLinear with float16 3D scale as an intermediate node https://wpt.live/webnn/conformance_tests/dequantizeLinear.https.any.html?device=cpu&tc=dequantizeLinear%20with%20float16%203D%20scale%20as%20an%20intermediate%20node

Note: Please replace cpu with gpu for device parameter in Test URL to test by ORT default GPU EP.

Urgency

No response

ONNX Runtime Installation

Released Package Windows App SDK Stable 1.8.2 (1.8.251003001)

ONNX Runtime Version or Commit ID

1.23.25.928

Execution Provider

ORT default CPU EP

Metadata

Metadata

Assignees

No one assigned

    Labels

    ep:WebNNWebNN execution providerplatform:webissues related to ONNX Runtime web; typically submitted using templatequantizationissues related to quantization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions