onnxruntime
8fc9fd59 - [WebGPU] Fix shader cache collisions across operator variants (#33242)

Commit
9 days ago
[WebGPU] Fix shader cache collisions across operator variants (#33242) ### Description Fix five native WebGPU shader-cache collisions using the existing metadata and cache hints: - **BiasAdd / BiasSplitGelu:** key one input's program type, which captures both element type and vector width. - **LayerNormalization:** distinguish mean-only from inverse-standard-deviation-only outputs. Output count already distinguishes the other combinations. - **InstanceNormalization:** include the epsilon literal embedded in the shader. - **Boolean And:** distinguish full-vector reads from single-lane broadcasts, which both use Boolx4 storage. Also correct BiasSplitGelu's FP16 division operand type so the correctly selected shader compiles. Add six small GPU regression tests. Each puts conflicting variants in one session, covers both node insertion orders, and repeats inference for warm-cache reuse. CPU fallback is disabled and full WebGPU validation is enabled. ### Motivation and Context This extracts the confirmed correctness fixes from #33153 so they can land before the proposed cache-framework migration. The DequantizeLinear fix is already merged in #33122. ### Validation - Fresh Windows Release build with native WebGPU/D3D12, based on `6e0f154e32`. - All six new tests fail on unmodified main and pass with the fixes; about 2.5 seconds locally. - With the FP16 arithmetic correction but without BiasSplitGelu's type key, five tests pass and BiasSplitGelu still fails numerically, independently confirming that collision. - 201 affected tests pass, zero skipped, with two BERT tests rerun after staging their missing model fixtures. Broad counts include CPU execution. - All 14 original numerical reproduction checks pass, including dynamic Boolean shape swaps and cross-session cache reuse, with CPU fallback disabled. - Clang-format, lintrunner, and `git diff --check` pass. Metal, WASM and plugin builds were not run locally.
Author
Parents
Loading