Skip to content

Conversation

CharlieL7
Copy link
Collaborator

Change find_mul_conv to work with multibroadcast also. Checks the strides instead of the broadcast axis.

@migraphx-bot
Copy link
Collaborator

migraphx-bot commented Sep 14, 2022

Test Rate new
31de42
Rate old
1b00c6
Diff Compare
torchvision-resnet50 2,222.99 2,224.65 -0.07% 🔴
torchvision-resnet50_fp16 4,813.98 4,813.66 0.01%
torchvision-alexnet 4,964.78 4,970.95 -0.12% 🔴
torchvision-alexnet_fp16 26,176.94 26,187.97 -0.04%
torchvision-densenet121 1,804.55 1,807.40 -0.16% 🔴
torchvision-densenet121_fp16 3,263.81 3,203.02 1.90% 🔆
torchvision-inceptionv3 1,104.74 1,094.97 0.89% 🔆
torchvision-inceptionv3_fp16 2,037.23 2,040.60 -0.16%
torchvision-vgg16 894.34 894.65 -0.03% 🔴
torchvision-vgg16_fp16 1,724.31 1,724.83 -0.03%
cadene-inceptionv4 535.01 534.01 0.19% 🔆
cadene-resnext64x4 575.66 574.74 0.16% 🔆
slim-mobilenet 6,384.04 6,255.07 2.06% 🔆
slim-nasnetalarge 207.90 206.97 0.45% 🔆
slim-resnet50v2 nan nan nan%
bert-mrpc-onnx 893.07 889.39 0.41%
bert-mrpc-tf 313.21 308.01 1.69% 🔆
pytorch-examples-wlang-gru 437.84 424.34 3.18% 🔆
pytorch-examples-wlang-lstm 332.69 331.48 0.37%
torchvision-resnet50_1 517.61 514.73 0.56% 🔆
torchvision-inceptionv3_1 305.44 302.88 0.85% 🔆
torchvision-vgg16_1 462.93 460.86 0.45% 🔆
cadene-dpn92_1 330.69 324.36 1.95% 🔆
cadene-resnext101_1 234.90 210.63 11.52% 🔆
slim-vgg16_1 64.00 63.90 0.16% 🔆
slim-mobilenet_1 1,986.74 1,998.77 -0.60%
slim-inceptionv4_1 193.16 198.23 -2.56% 🔴
onnx-taau-downsample 259.09 257.81 0.50% 🔆

This build is not recommended to merge 🔴

{
if(invalid_sl(i))
invalid_case = true;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be simpler to write this as:

auto is_broadcasted_axis = [](auto len, auto stride) {
    return len == 1 or stride == 0;
};

if (not is_broadcasted_axis(a_lens.front(), a_strides.front()))
    return;

if (not std::equal(a_lens.begin()+2, a_lens.end(), a_strides.begin()+2, a_strides.end(), is_broadcasted_axis))
    return;


// check broadcasted along channels
auto a_lens = a_ins->get_shape().lens();
auto a_strides = a_ins->get_shape().strides();
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should be const auto&.

invalid_case = true;
}

if(invalid_sl(0) or a_strides.at(1) != 1 or invalid_case)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should check a_strides.at(1) != 1 before checking the broadcasted axis. Also, we should probably check the rank as well(ie a_lens.size() > 2) before we start checking everything else.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Shouldn't rank >= 4 to be a valid convolution output?

@causten causten merged commit 9a70050 into develop Sep 21, 2022
@causten causten deleted the multib_mul_conv branch September 21, 2022 12:56
@CharlieL7 CharlieL7 restored the multib_mul_conv branch September 22, 2022 17:59
@CharlieL7 CharlieL7 deleted the multib_mul_conv branch September 22, 2022 18:13
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.

5 participants