plugin-ep-webgpu/python/README.md
This directory contains the packaging source for the onnxruntime-ep-webgpu Python package.
Install build dependencies:
pip install -r requirements-build-wheel.txt
Wheels are built via build_wheel.py. Running pip install or pip wheel directly against this directory is not
supported — the source tree contains pyproject.toml.in (a template), not a real pyproject.toml.
The wheel is platform-specific. Each platform's wheel is built from binaries produced on that platform —
build_wheel.py does not cross-build. See the
bundled wheel readme for the list of supported platforms.
python build_wheel.py --binary_dir <path-to-built-binaries> --version <PEP-440-version> --output_dir <output-directory>
Example:
python build_wheel.py --binary_dir ./build/Release --version 0.1.0.devYYYYMMDD --output_dir ./dist
The script combines the pre-built plugin EP binaries with the package source to produce a platform-specific wheel.
Install the wheel and dependencies in a clean environment, then run the smoke test:
python -m venv test_venv
source test_venv/bin/activate # or test_venv\Scripts\Activate.ps1 on Windows
pip install onnx numpy onnxruntime
pip install dist/onnxruntime_ep_webgpu-*.whl
python test/test_webgpu_plugin_ep.py
onnx and numpy are required only by the smoke test, not by the onnxruntime-ep-webgpu wheel itself. The wheel's
only runtime dependency is a compatible onnxruntime (see
../MIN_ONNXRUNTIME_VERSION).
The test validates import, EP registration, device discovery, and inference (requires WebGPU-capable hardware for the
inference portion). Set the environment variable ORT_TEST_VERBOSE=1 to print additional diagnostic information
(environment, available providers, discovered devices, etc.).
The package version is derived from ../VERSION_NUMBER by the packaging pipeline (see
set-plugin-ep-build-variables-step.yml),
which produces a PEP 440 version string.