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

Keep output shape from pointwise instruction after fusing with concat #2881

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

umangyadav
Copy link
Member

fuse_ops.cpp pass is running find_contiguous_pointwise first which folds contiguous inside pointwise.

Later, fuse_concat_pointwise runs which is not maintaining the standard output shape while folding pointwise inside concat.

This leads to errors when trying to use reshape_lazy.

Renaming find_contiguous_pointwise to find_pointwise_contiguous. Many of the matchers have names such that operations appear in order they appear in graph.
E.g.
find_concat_pointwise means output of the concat is feeding into pointwise.
find_layernorm_pointwise means output of layernorm is going into pointwise.
Therefore find_pointwise_contiguous makes more sense.

@umangyadav umangyadav requested a review from causten as a code owner March 12, 2024 17:22
@umangyadav umangyadav requested review from shivadbhavsar, pfultz2 and kahmed10 and removed request for causten and shivadbhavsar March 12, 2024 17:22
@umangyadav umangyadav self-assigned this Mar 12, 2024
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (f18b3ae) to head (0cf1444).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2881   +/-   ##
========================================
  Coverage    91.82%   91.82%           
========================================
  Files          477      477           
  Lines        18112    18112           
========================================
  Hits         16631    16631           
  Misses        1481     1481           

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

@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
0cf144
Rate old
f18b3a
Diff Compare
torchvision-resnet50 64 2,852.25 2,852.01 0.01%
torchvision-resnet50_fp16 64 6,516.73 6,516.75 -0.00%
torchvision-densenet121 32 2,102.46 2,101.43 0.05%
torchvision-densenet121_fp16 32 3,708.23 3,687.98 0.55%
torchvision-inceptionv3 32 1,604.04 1,604.91 -0.05%
torchvision-inceptionv3_fp16 32 2,572.53 2,574.13 -0.06%
cadene-inceptionv4 16 724.83 724.85 -0.00%
cadene-resnext64x4 16 682.94 683.17 -0.03%
slim-mobilenet 64 5,948.12 5,935.54 0.21%
slim-nasnetalarge 64 152.86 152.89 -0.02%
slim-resnet50v2 64 2,668.26 nan nan%
bert-mrpc-onnx 8 917.88 919.16 -0.14%
bert-mrpc-tf 1 433.49 436.14 -0.61%
pytorch-examples-wlang-gru 1 430.76 423.38 1.74%
pytorch-examples-wlang-lstm 1 388.35 388.56 -0.05%
torchvision-resnet50_1 1 614.05 602.10 1.98%
cadene-dpn92_1 1 391.92 393.08 -0.29%
cadene-resnext101_1 1 331.37 332.15 -0.24%
onnx-taau-downsample 1 304.18 305.99 -0.59%
dlrm-criteoterabyte 1 28.79 28.74 0.15%
dlrm-criteoterabyte_fp16 1 49.62 49.59 0.05%
agentmodel 1 6,497.56 5,384.71 20.67% 🔆
unet_fp16 2 57.48 57.61 -0.22%
resnet50v1_fp16 1 870.20 884.99 -1.67%
resnet50v1_int8 1 799.18 797.72 0.18%
bert_base_cased_fp16 64 1,055.71 1,055.63 0.01%
bert_large_uncased_fp16 32 311.85 311.88 -0.01%
bert_large_fp16 1 159.38 159.36 0.01%
distilgpt2_fp16 16 1,858.63 1,858.22 0.02%
yolov5s 1 483.42 486.48 -0.63%
tinyllama 1 32.86 32.85 0.01%
vicuna-fastchat 1 159.52 158.00 0.96%
whisper-tiny-encoder 1 350.16 349.19 0.28%
whisper-tiny-decoder 1 401.31 399.52 0.45%

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

@causten causten merged commit 4bedf9e into develop Mar 13, 2024
48 of 49 checks passed
@causten causten deleted the fix_concat_pointwise branch March 13, 2024 02:20
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