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

Rewrite 1x1 convolutions to gemm #3568

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open

Rewrite 1x1 convolutions to gemm #3568

wants to merge 13 commits into from

Conversation

pfultz2
Copy link
Collaborator

@pfultz2 pfultz2 commented Oct 29, 2024

This allows us to use rocblas for some gemms.

@pfultz2 pfultz2 requested a review from causten as a code owner October 29, 2024 14:31
@pfultz2 pfultz2 requested review from kahmed10, shivadbhavsar and CharlieL7 and removed request for causten October 29, 2024 14:31
if(not all_of(v.at("dilation"), [](const value& x) { return x.to<std::size_t>() == 1; }))
return false;
auto w = ins->inputs().at(1)->get_shape();
return std::all_of(w.lens().begin() + 2, w.lens().end(), [](std::size_t i) { return i == 1; });
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worthwhile to have a 1x1x1 test case too since its allowed here to make sure it generalizes to the 3D case

@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
84a941
Rate old
71fd27
Diff Compare
torchvision-resnet50 64 3,124.05 3,258.47 -4.13% 🔴
torchvision-resnet50_fp16 64 6,649.81 6,989.35 -4.86% 🔴
torchvision-densenet121 32 2,428.73 2,437.00 -0.34%
torchvision-densenet121_fp16 32 4,077.64 4,070.38 0.18%
torchvision-inceptionv3 32 1,630.56 1,639.85 -0.57%
torchvision-inceptionv3_fp16 32 2,730.00 2,763.41 -1.21%
cadene-inceptionv4 16 759.80 776.50 -2.15%
cadene-resnext64x4 16 678.47 808.24 -16.06% 🔴
slim-mobilenet 64 7,488.79 7,538.65 -0.66%
slim-nasnetalarge 64 nan 211.54 nan%
slim-resnet50v2 64 3,284.27 3,507.21 -6.36% 🔴
bert-mrpc-onnx 8 1,148.87 1,150.51 -0.14%
bert-mrpc-tf 1 464.17 475.19 -2.32%
pytorch-examples-wlang-gru 1 515.53 426.61 20.84% 🔆
pytorch-examples-wlang-lstm 1 386.85 376.26 2.81%
torchvision-resnet50_1 1 704.37 785.19 -10.29% 🔴
cadene-dpn92_1 1 408.01 399.09 2.24%
cadene-resnext101_1 1 325.51 383.01 -15.01% 🔴
onnx-taau-downsample 1 343.43 343.03 0.12%
dlrm-criteoterabyte 1 33.33 33.33 0.01%
dlrm-criteoterabyte_fp16 1 52.76 52.73 0.06%
agentmodel 1 8,392.57 8,178.96 2.61%
unet_fp16 2 58.68 58.92 -0.41%
resnet50v1_fp16 1 886.30 925.30 -4.22% 🔴
resnet50v1_int8 1 1,022.34 1,011.55 1.07%
bert_base_cased_fp16 64 1,170.96 1,169.93 0.09%
bert_large_uncased_fp16 32 355.40 363.31 -2.18%
bert_large_fp16 1 192.32 200.50 -4.08% 🔴
distilgpt2_fp16 16 2,200.66 2,194.69 0.27%
yolov5s 1 545.09 533.06 2.26%
tinyllama 1 43.47 43.45 0.04%
vicuna-fastchat 1 175.62 172.29 1.94%
whisper-tiny-encoder 1 417.46 417.95 -0.12%
whisper-tiny-decoder 1 428.13 425.65 0.58%

This build is not recommended to merge 🔴

@migraphx-bot
Copy link
Collaborator


     ✅ bert-mrpc-onnx: PASSED: MIGraphX meets tolerance

     ✅ bert-mrpc-tf: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-gru: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-lstm: PASSED: MIGraphX meets tolerance

     ✅ torchvision-resnet50_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-dpn92_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-resnext101_1: PASSED: MIGraphX meets tolerance

     ✅ dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance

     ✅ agentmodel: PASSED: MIGraphX meets tolerance

     ✅ unet: PASSED: MIGraphX meets tolerance

     ✅ resnet50v1: PASSED: MIGraphX meets tolerance

     ✅ bert_base_cased_fp16: PASSED: MIGraphX meets tolerance

🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ bert_large: PASSED: MIGraphX meets tolerance

     ✅ yolov5s: PASSED: MIGraphX meets tolerance

     ✅ tinyllama: PASSED: MIGraphX meets tolerance

     ✅ vicuna-fastchat: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-encoder: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-decoder: PASSED: MIGraphX meets tolerance

     ✅ distilgpt2_fp16: PASSED: MIGraphX meets tolerance

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.

3 participants