onnxruntime
b652e595 - [WebGPU] Prepack Conv weights for the im2col-matmul path (#32420)

Commit
2 days ago
[WebGPU] Prepack Conv weights for the im2col-matmul path (#32420) ### Description <!-- Describe your changes. --> The im2col-matmul Conv path consumes weights in OHWI layout, but the Conv kernel receives them as OIHW, so `ApplyIm2ColMatMulProgram` transposed them on every inference. This PR moves that transpose into `Conv::PrePackInternal` so it runs once at session initialization. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> The weight transpose was marked `// TODO: Use prepack` and was re-dispatched on every Conv execution even though the weights are constant. This removes a redundant GPU dispatch and a transient buffer allocation per Conv per inference on the im2col-matmul path. ### Testing Verified on Intel Panther Lake (xe-3lpg) - `ConvFp16Test.Conv2D_1` - `ConvFp16Test.Conv2D_KleidiAiImatmulEligibleNoBias` - `ConvFp16Test.Conv2D_KleidiAiImatmulEligibleBiasAndDisabledFallback` - `ConvFp16Test.Conv2D_Bias_1` - `ConvFp16Test.Conv2D_Bias_2` - `ConvFp16Test.Conv2D_AutoPad1` - `ConvFp16Test.Conv2D_AutoPad2` - `ConvFp16Test.Conv_AutoPad_with_non_default_strides` The `AutoPad` cases specifically cover prepacking ahead of the `auto_pad != NOTSET` early return, and the bias/no-bias pairs cover both input-count variants.
Author
Parents
Loading