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

Dont convert squeeze/unsqueeze to reshape when fusing mlir #3533

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

pfultz2
Copy link
Collaborator

@pfultz2 pfultz2 commented Oct 16, 2024

Unsqueeze/squeeze/lazy_reshape perserve the layout whereas reshape doesnt. The mlir_op uses this to compute the output shape which could be different after we fuse with mlir. Instead, just convert them to reshape when we are converting to mlir.

@pfultz2 pfultz2 requested a review from causten as a code owner October 16, 2024 18:02
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.17%. Comparing base (ddc4c0c) to head (370c90c).
Report is 8 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3533   +/-   ##
========================================
  Coverage    92.17%   92.17%           
========================================
  Files          512      512           
  Lines        21387    21391    +4     
========================================
+ Hits         19714    19718    +4     
  Misses        1673     1673           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@shivadbhavsar shivadbhavsar left a comment

Choose a reason for hiding this comment

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

lgtm

@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
370c90
Rate old
275f85
Diff Compare
torchvision-resnet50 64 3,261.33 3,260.33 0.03%
torchvision-resnet50_fp16 64 6,987.49 6,996.93 -0.13%
torchvision-densenet121 32 2,435.13 2,436.13 -0.04%
torchvision-densenet121_fp16 32 4,074.51 4,080.65 -0.15%
torchvision-inceptionv3 32 1,638.32 1,639.01 -0.04%
torchvision-inceptionv3_fp16 32 2,762.86 2,759.60 0.12%
cadene-inceptionv4 16 776.86 775.88 0.13%
cadene-resnext64x4 16 811.70 811.11 0.07%
slim-mobilenet 64 7,537.22 7,539.27 -0.03%
slim-nasnetalarge 64 211.56 211.54 0.01%
slim-resnet50v2 64 3,505.47 3,505.47 0.00%
bert-mrpc-onnx 8 1,150.33 1,151.85 -0.13%
bert-mrpc-tf 1 469.67 463.50 1.33%
pytorch-examples-wlang-gru 1 429.74 411.56 4.42% 🔆
pytorch-examples-wlang-lstm 1 381.25 388.27 -1.81%
torchvision-resnet50_1 1 782.26 764.51 2.32%
cadene-dpn92_1 1 401.39 402.09 -0.17%
cadene-resnext101_1 1 382.19 381.69 0.13%
onnx-taau-downsample 1 342.76 342.54 0.06%
dlrm-criteoterabyte 1 33.34 33.35 -0.03%
dlrm-criteoterabyte_fp16 1 52.71 52.74 -0.06%
agentmodel 1 8,304.61 8,186.92 1.44%
unet_fp16 2 58.82 58.82 0.01%
resnet50v1_fp16 1 964.49 953.22 1.18%
resnet50v1_int8 1 1,017.22 1,003.11 1.41%
bert_base_cased_fp16 64 1,170.93 1,170.57 0.03%
bert_large_uncased_fp16 32 363.75 363.63 0.03%
bert_large_fp16 1 198.99 201.70 -1.35%
distilgpt2_fp16 16 2,203.35 2,202.28 0.05%
yolov5s 1 549.54 537.82 2.18%
tinyllama 1 43.42 43.44 -0.04%
vicuna-fastchat 1 173.56 173.47 0.05%
whisper-tiny-encoder 1 418.02 418.26 -0.06%
whisper-tiny-decoder 1 426.43 436.61 -2.33%

Check results before 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

@causten causten merged commit 797aaf5 into develop Oct 21, 2024
38 of 43 checks passed
@causten causten deleted the mlir-reshape-ops branch October 21, 2024 13:59
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.

4 participants