Skip to content

[Feature Request] [web/webgpu] Support non-symmetrical padding in Conv #24800

Open
@poke1024

Description

@poke1024

Describe the feature request

ONNX runtime web with ep:webgpu currently expects padding in Conv to be totally symmetrical:

if (!pad.every((val, _, arr) => val === arr[0])) {
throw Error(`Unsupported padding parameter: ${pad}`);
}

Models that need Conv with asymmetrical padding fail to run with the error shown above.

A possible workaround for users might involve factoring out the padding into a separate Pad op. This is tricky to do for models with pretrained weight however.

Describe scenario use case

Necessary for executing any model that needs convolutions with Conv with non-symmetric padding under ONNX runtime web with ep:webgpu. One example of such a model is TransnetV2 (https://github.com/soCzech/TransNetV2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ep:WebGPUort-web webgpu providerfeature requestrequest for unsupported feature or enhancementplatform:webissues related to ONNX Runtime web; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions