[passes] Optimize ConvertConv3dToConv2d for special case#518
Open
llFreetimell wants to merge 3 commits intoSamsung:mainfrom
Open
[passes] Optimize ConvertConv3dToConv2d for special case#518llFreetimell wants to merge 3 commits intoSamsung:mainfrom
llFreetimell wants to merge 3 commits intoSamsung:mainfrom
Conversation
This commit optimizes `ConvertConv3dToConv2d` pass for special case. TICO-DCO-1.0-Signed-off-by: Seok Namkoong <seok9311@naver.com>
dayo09
reviewed
Feb 26, 2026
| return (torch.randn(5, 3, 2, 16, 16),), {} | ||
|
|
||
|
|
||
| class ConvertConv3dPerfectFitKernelTest(SinglePassValueTest): |
Contributor
There was a problem hiding this comment.
(optional) How about adding it to op test too? test/modules/op/conv3d.py
Contributor
|
@llFreetimell style failure 😢 |
dayo09
reviewed
Feb 26, 2026
Comment on lines
+452
to
+465
| conv2d = create_node( | ||
| graph, | ||
| torch.ops.aten.conv2d.default, | ||
| args=( | ||
| input_reshape, | ||
| weight_reshape, | ||
| bias, | ||
| [1, 1], # stride | ||
| [0, 0], # padding | ||
| [1, 1], # dilation | ||
| groups, | ||
| ), | ||
| origin=node, | ||
| ) |
Contributor
There was a problem hiding this comment.
@llFreetimell We have considered Linear vs Conv2d for TRIV optimization, so, in the end, is Conv2d better?
seockho-kim
reviewed
Feb 26, 2026
| N, C_in, T_in, H_in, W_in = input_shape | ||
| C_out, C_in_weight, kT, kH, kW = weight_shape | ||
|
|
||
| if T_in == kT and H_in == kH and W_in == kW and groups == 1: |
Contributor
There was a problem hiding this comment.
Does this pass work when input shape(T,H,W) is same with kernel's?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit optimizes
ConvertConv3dToConv2dpass for special case.TICO-DCO-1.0-Signed-off-by: Seok Namkoong seok9311@naver.com
For #475
Draft #517