Skip to content

[WebNN EP] Support int64 output data type for CoreML backend  #21401

Open
@Honry

Description

Describe the feature request

WebNN CoreML backend doesn't support int64 data type, however some ops from ONNX produce int64 output, e.g. ArgMax, ArgMin, etc., CoreML's AragMax reproduces int32 output.

That means we should check the dimension size being reduced is within int32 range, then do type casting (int32 -> int64) for the output.

The node of such op must be the output of a subgraph model, as its next node is int64 input which is not supported by CoreML backend, and it will fall back, unless it is a special case: ArgMax-Cast (from int64 to int32).

Following actions can be taken into account:

  • Use WebNN's opSupportLimits() to check if whether int64 data type is supported
  • Make sure producing int32 output instead is safe
  • Fuse ops for e.g. ArgMax-Cast(int64->int32)
  • Convert int32 output tensor back to int64

Besides, how CoreML EP handles int64 data type would be a good reference.

Describe scenario use case

N/A

Metadata

Assignees

No one assigned

    Labels

    ep:WebNNWebNN execution providerfeature requestrequest for unsupported feature or enhancementplatform:mobileissues related to ONNX Runtime mobile; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions