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

Lazy reshape fixes #2505

Merged
merged 4 commits into from
Dec 13, 2023
Merged

Lazy reshape fixes #2505

merged 4 commits into from
Dec 13, 2023

Conversation

pfultz2
Copy link
Collaborator

@pfultz2 pfultz2 commented Dec 2, 2023

There was many cases where we would do the reshape across the non-packed axis, which would produce incorrect results. This redoes the algorithm to do a fold instead of trying to do a equality comparison.

These cases are broken for reshape copy as well. I plan to address that in another PR.

@migraphx-bot
Copy link
Collaborator

migraphx-bot commented Dec 2, 2023

Test Batch Rate new
93550a
Rate old
22088d
Diff Compare
torchvision-resnet50 64 2,831.80 2,832.21 -0.01%
torchvision-resnet50_fp16 64 6,498.99 6,500.58 -0.02%
torchvision-densenet121 32 2,094.90 2,078.52 0.79%
torchvision-densenet121_fp16 32 3,670.43 3,673.55 -0.08%
torchvision-inceptionv3 32 1,583.92 1,584.30 -0.02%
torchvision-inceptionv3_fp16 32 2,567.95 2,568.14 -0.01%
cadene-inceptionv4 16 704.12 703.89 0.03%
cadene-resnext64x4 16 692.34 692.19 0.02%
slim-mobilenet 64 8,335.54 8,350.41 -0.18%
slim-nasnetalarge 64 225.40 225.75 -0.16%
slim-resnet50v2 64 2,664.61 2,668.79 -0.16%
bert-mrpc-onnx 8 824.31 823.57 0.09%
bert-mrpc-tf 1 386.86 388.25 -0.36%
pytorch-examples-wlang-gru 1 301.42 297.38 1.36%
pytorch-examples-wlang-lstm 1 315.72 310.23 1.77%
torchvision-resnet50_1 1 601.07 605.48 -0.73%
torchvision-inceptionv3_1 1 341.47 342.84 -0.40%
cadene-dpn92_1 1 399.35 399.65 -0.08%
cadene-resnext101_1 1 328.28 326.09 0.67%
slim-vgg16_1 1 459.41 458.73 0.15%
slim-mobilenet_1 1 2,094.25 2,113.99 -0.93%
slim-inceptionv4_1 1 219.83 220.49 -0.30%
onnx-taau-downsample 1 302.89 304.47 -0.52%
dlrm-criteoterabyte 1 21.60 21.60 -0.00%
dlrm-criteoterabyte_fp16 1 40.65 40.66 -0.03%
agentmodel 1 5,922.56 5,937.01 -0.24%
unet_fp16 2 54.73 54.76 -0.05%
resnet50v1_fp16 1 953.84 944.90 0.95%
bert_base_cased_fp16 64 903.56 903.27 0.03%
bert_large_uncased_fp16 32 285.71 285.78 -0.02%
bert_large_fp16 1 166.81 166.93 -0.07%
distilgpt2_fp16 16 1,282.22 1,281.27 0.07%

This build is OK for merge ✅

@migraphx-bot
Copy link
Collaborator

migraphx-bot commented Dec 2, 2023


     ✅ 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

     ✅ torchvision-inceptionv3_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-dpn92_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-resnext101_1: PASSED: MIGraphX meets tolerance

     ✅ slim-vgg16_1: PASSED: MIGraphX meets tolerance

     ✅ slim-mobilenet_1: PASSED: MIGraphX meets tolerance

     ✅ slim-inceptionv4_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: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ bert_large_uncased_fp16: PASSED: MIGraphX meets tolerance

     ✅ bert_large: PASSED: MIGraphX meets tolerance

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

@TedThemistokleous TedThemistokleous added the bugfix Fixes a bug found in the code. label Dec 7, 2023
Copy link
Collaborator

@CharlieL7 CharlieL7 left a comment

Choose a reason for hiding this comment

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

LGTM, errors out several cases of reshape_lazy that we cannot alias for.

@causten causten merged commit a60bdb6 into develop Dec 13, 2023
15 checks passed
@causten causten deleted the lazy-reshape-fixes branch December 13, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a bug found in the code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants