microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.77k stars 2.94k forks source link

[Web] Support iOS devices #22776

Open AvivSham opened 1 week ago

AvivSham commented 1 week ago

Describe the issue

From other discussions and the npm release page, onnxruntime-web (WebGPU) is not supported in iOS devices regardless of browser type. Is there an estimation on when this feature will be released it is really important for developers!!

To reproduce

Useful links:

Urgency

No response

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.20.0

Execution Provider

'webgpu' (WebGPU)

gyagp commented 1 week ago

On iOS, we have to wait for Apple to implement WebGPU. In the recent WebGPU F2F on Oct 29, Apple updated their status as "Functionally, largely complete. In Safari preview for several months. No comment on ship date. Functionally, there are a few missing CTS features we haven't seen used (like importing texture formattings is known not to work). HDR support on WebKit main is added, expect to see in preview soon. Otherwise, looking into iOS memory usage issues and various security issues. Hope to ship soon."

AvivSham commented 1 week ago

@gyagp Thank you for the clarification! There is something I'm missing, if WebGPU has been in preview for several months why onnxruntime-web cannot be supported on Safari? Are you waiting for the official release?

gyagp commented 1 week ago

My understanding is Safari Technology Preview can only be installed on macOS, but not iOS. So you couldn't run WebGPU on iOS now. For onnxruntime-web, it can run everywhere that WebGPU is supported. This means you can run onnxruntime-web on macOS now with Safari Technology Preview, in addition to Chrome.

AvivSham commented 1 week ago

@gyagp Got it, thanks! How do you suggest to follow the updates around this? i.e. when WebGPU will be available on iOS.

guschmue commented 1 week ago

Seems to be under feature flags in iOS/Safari to turn it on: Settings -> Apps -> Safari -> Advanced -> Feature Flags -> Webgpu

You can go to https://webgpureport.org/ and see if that worked.

gyagp commented 4 days ago

Someone mentioned WebGPU is enabled by default in iOS 18.2: https://news.ycombinator.com/item?id=42110252.

AvivSham commented 2 days ago

Thanks for the update @gyagp, have you tried it?

gyagp commented 2 days ago

I don't have an iPhone :(