You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebGPU now supports the ONNX `Shape` operator natively. This PR removes
the workaround that existed for the old constraint.
## What was removed
| Item | Reason |
|------|--------|
| `_eliminate_shape.py` | WebGPU-only workaround — replaces
`Shape(attention_mask)` with `ReduceSum+ReduceMax`. No longer needed. |
| `_eliminate_shape_test.py` | Tests for the removed module |
| `supports_shape` field from `EpCapabilities` | Only WebGPU used it
with `False`; removing the field cleans up the API |
| `EliminateShape` lowering pass in `_optimizations.py` | Nothing calls
it anymore |
| `eliminate_shape_rules` from `rewrite_rules` public API | Removed with
the implementation |
## What was enabled
The `webgpu` EP entry in `_execution_providers.py` no longer sets
`supports_shape=False` (field removed). WebGPU models now retain their
`Shape` ops, matching all other EPs.
## Test update
`test_webgpu_no_shape_nodes` → `test_webgpu_supports_shape_nodes`:
assertion flipped from `== 0` to `> 0`, confirming Shape nodes are
preserved in WebGPU graphs.
## Stats
- 416 lines deleted, 10 lines added
- 2317 tests pass
---------
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments