Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing two more convtranspose usecases #308

Open
wants to merge 8 commits into
base: feature/onnx-to-tosa
Choose a base branch
from

Conversation

chaitanyakamarapu
Copy link

@chaitanyakamarapu chaitanyakamarapu commented Mar 10, 2025

Addressing below usecases

  1. kernel is [2,2] and stride is [2,2], with pads [0,0,0,0], gets decomposed to 4 conv2d operations each with kernel [1,1]
  2. kernel [4,4] and stride [2,2], with pads [1,1,1,1], gets decomposed to 4 conv2d operations each with kernel [2,2]

@chaitanyakamarapu chaitanyakamarapu marked this pull request as ready for review March 10, 2025 15:43
@@ -763,6 +767,16 @@ bool ShouldDecomposeConvTransposeOpToPhasedConvs(Value convTransposeResult,
padsShape == SmallVector<int64_t>{1, 1, 0, 0})
return true;
}
// Supports only with padding [0, 0, 0, 0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we can generalize this instead of hardcoding specific paddings and kernels

Copy link
Author

@chaitanyakamarapu chaitanyakamarapu Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the padding is of convT is changed to [ 1, 1, 1, 1], the conv outputs of conv2 get top and left garbage, requiring the slice. We have to handle the change in padding with a different decomposition.
If convT has [2,2,2,2] padding, the decomposition deviates both from [1,1,1,1] and [0,0,0,0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants