Closed Bug 1933012 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 49343 - webnn: Support gatherElements in tflite converter

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox135 fixed)

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 49343 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/49343
Details from upstream follow.

junwei <junwei.fu@intel.com> wrote:

webnn: Support gatherElements in tflite converter

There is no TFLite operator to map directly WebNN gatherElements, but
it can be supported with tfl.gather_nd, the test cases[1] and the
doc[2] show the gather_nd can gether not only slices but also elements,
but gather_nd can't gather along the axis, so the indices used by
gather_nd need to be calculated by unravelling the flat index and
adjusting value with the axis.

The coordinates are calculated by the stride of each dimension. For
example a shape (3, 2) array can map to the following coordinates:
// index row, col
// [[0, 1,] [[0, 0], [0, 1],
// [2, 3,] => [1, 0], [1, 1]
// [4, 5,]] [2, 0], [2, 1]]

Adjusting the coordinates with WebNN indices operand along the axis,
// unravelled index WebNN indices axis = 0 TFLite indices
// [[0, 0], [0, 1], [[1, 0], [[1 ,0], [0, 1],
// [1, 0], [1, 1] [2, 1], => [2, 0], [1, 1],
// [2, 0], [2, 1]] [0, 2]] [0, 0], [2, 1]]

[1] https://www.tensorflow.org/mlir/tfl_ops#tflgather_nd_tflgatherndop
[2] https://www.tensorflow.org/guide/tensor_slicing#insert_data_into_tensors

Bug: 40206287
Change-Id: I61ad75585405039da10af05f3300799fe8f32855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000111
Reviewed-by: ningxin hu \<ningxin.hu@intel.com>
Reviewed-by: Reilly Grant \<reillyg@chromium.org>
Commit-Queue: Junwei Fu \<junwei.fu@intel.com>
Cr-Commit-Position: refs/heads/main@{#1387213}

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 6 tests and 7 subtests

Status Summary

Firefox

OK : 6
FAIL: 6

Chrome

OK : 6
FAIL: 36

Safari

OK : 6
FAIL: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /webnn/conformance_tests/gatherElements.https.any.worker.html?npu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • assert_implements(navigator.ml, 'missing navigator.ml'): FAIL (Safari: FAIL)
  • /webnn/conformance_tests/gatherElements.https.any.html?cpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • assert_implements(navigator.ml, 'missing navigator.ml'): FAIL (Safari: FAIL)
  • /webnn/conformance_tests/gatherElements.https.any.worker.html?gpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • assert_implements(navigator.ml, 'missing navigator.ml'): FAIL (Safari: FAIL)
  • /webnn/conformance_tests/gatherElements.https.any.worker.html?cpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • assert_implements(navigator.ml, 'missing navigator.ml'): FAIL (Safari: FAIL)
  • /webnn/conformance_tests/gatherElements.https.any.html?gpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • assert_implements(navigator.ml, 'missing navigator.ml'): FAIL (Safari: FAIL)
  • /webnn/conformance_tests/gatherElements.https.any.html?npu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • assert_implements(navigator.ml, 'missing navigator.ml'): FAIL (Safari: FAIL)

Tests Disabled in Gecko Infrastructure

  • /webnn/conformance_tests/gatherElements.https.any.worker.html?npu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
  • /webnn/conformance_tests/gatherElements.https.any.html?cpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
  • /webnn/conformance_tests/gatherElements.https.any.worker.html?gpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
  • /webnn/conformance_tests/gatherElements.https.any.worker.html?cpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
  • /webnn/conformance_tests/gatherElements.https.any.html?gpu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
  • /webnn/conformance_tests/gatherElements.https.any.html?npu [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/edbd32557d5a [wpt PR 49343] - webnn: Support gatherElements in tflite converter, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.