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

[Enabling] [CNN] Resnext #25

Open
Devjiu opened this issue Feb 16, 2024 · 0 comments
Open

[Enabling] [CNN] Resnext #25

Devjiu opened this issue Feb 16, 2024 · 0 comments

Comments

@Devjiu
Copy link

Devjiu commented Feb 16, 2024

ResNext networks uses Grouped Convolutions e.g. from fx graph python:

convolution_2 = torch.ops.aten.convolution.default(relu_1, arg6_1, None, [1, 1], [1, 1], [1, 1], False, [0, 0], 32);  relu_1 = arg6_1 = None

Last parameter is amount of groups. It splits weights into amount of groups, so in shape and out shape

%57 = torch.aten.convolution %56, %arg6, %none, %3, %3, %3, %false, %4, %int32 : !torch.vtensor<[1,128,56,56],f32>, !torch.vtensor<[128,4,3,3],f32>, !torch.none, !torch.list<int>, !torch.list<int>, !torch.list<int>, !torch.bool, !torch.list<int>, !torch.int -> !torch.vtensor<[1,128,56,56],f32>

It uses smaller weights !torch.vtensor<[128,4,3,3],f32> that originally is 128 x 4 * 32 x 3 x 3 = 128 x 128 x 3 x 3 so maybe passed not all of existing weights.
Tests that exists in torch mlir currently are not passing:

FAIL - "Conv2dWithPaddingDilationStrideStaticModule_grouped"
FAIL - "Conv2dWithPaddingDilationStrideStaticModule_grouped_multiplier"
FAIL - "ConvolutionModule2DGroups_basic"

So this failure requires further investigation to figure out the reason of incorrect computation:

****** Failed tests - 1 tests
    FAIL - "ConvolutionModule2DGroups_basic"
        @ trace item #0 - call to "forward"
        @ output of call to "forward"
        ERROR: value 
            (Tensor with shape=[1, 32, 2, 2], dtype=torch.float32, min=+0.0, max=+21.19, mean=+3.934) is not close to golden value 
            (Tensor with shape=[1, 32, 2, 2], dtype=torch.float32, min=+0.7049, max=+20.61, mean=+7.846)
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

No branches or pull requests

1 participant