Metadata-Version: 2.4
Name: onnxruntime-ep-webgpu
Version: 0.1.0
Summary: ONNX Runtime WebGPU Plugin Execution Provider
Author-email: Microsoft Corporation <onnxruntime@microsoft.com>
License-Expression: MIT
Project-URL: Homepage, https://onnxruntime.ai
Project-URL: Source, https://github.com/microsoft/onnxruntime
Project-URL: Issues, https://github.com/microsoft/onnxruntime/issues
Project-URL: Download, https://github.com/microsoft/onnxruntime/tags
Keywords: onnx,machine learning,webgpu,execution provider
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: ThirdPartyNotices.txt
Dynamic: license-file

# ONNX Runtime WebGPU Plugin Execution Provider

WebGPU Execution Provider plugin for ONNX Runtime. Install alongside `onnxruntime` to enable WebGPU
acceleration.

## Prerequisites

This package provides the WebGPU plugin EP only. You must separately install an ONNX Runtime package
(e.g. `onnxruntime`) of version `1.24.4` or later.

If the installed ONNX Runtime is incompatible, the plugin EP will report an error when its library is
registered.

## Installation

```bash
pip install "onnxruntime>=1.24.4"
pip install onnxruntime-ep-webgpu
```

## Usage

```python
import onnxruntime as ort
import onnxruntime_ep_webgpu as webgpu_ep

# Register the plugin EP library with ONNX Runtime
ort.register_execution_provider_library("webgpu", webgpu_ep.get_library_path())

# Discover WebGPU devices
all_devices = ort.get_ep_devices()
webgpu_devices = [d for d in all_devices if d.ep_name == webgpu_ep.get_ep_name()]

# Create a session using the WebGPU EP
sess_options = ort.SessionOptions()
sess_options.add_provider_for_devices(webgpu_devices, {})
session = ort.InferenceSession("model.onnx", sess_options=sess_options)

# Run inference
output = session.run(None, {"input": input_data})
```
