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

Only fuse pointwise with layernorm on the first argument #3679

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

pfultz2
Copy link
Collaborator

@pfultz2 pfultz2 commented Dec 4, 2024

The kernel always assumes the first argument is the layernorm so we can't fuse it if its not the first argument. This undoes #2189 which didnt have a verification test in the first place.

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.23%. Comparing base (64fe0c5) to head (22259a2).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3679   +/-   ##
========================================
  Coverage    92.23%   92.23%           
========================================
  Files          514      514           
  Lines        21746    21746           
========================================
  Hits         20057    20057           
  Misses        1689     1689           

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

@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
22259a
Rate old
a30b25
Diff Compare
torchvision-resnet50 64 3,257.63 3,254.31 0.10%
torchvision-resnet50_fp16 64 6,986.95 6,986.93 0.00%
torchvision-densenet121 32 2,433.09 2,432.26 0.03%
torchvision-densenet121_fp16 32 4,070.33 4,102.15 -0.78%
torchvision-inceptionv3 32 1,628.57 1,627.22 0.08%
torchvision-inceptionv3_fp16 32 2,748.08 2,744.59 0.13%
cadene-inceptionv4 16 764.68 764.44 0.03%
cadene-resnext64x4 16 813.64 812.75 0.11%
slim-mobilenet 64 7,458.17 7,463.39 -0.07%
slim-nasnetalarge 64 209.14 208.94 0.09%
slim-resnet50v2 64 3,438.62 3,440.19 -0.05%
bert-mrpc-onnx 8 1,151.96 1,143.08 0.78%
bert-mrpc-tf 1 473.73 469.87 0.82%
pytorch-examples-wlang-gru 1 419.85 513.89 -18.30% 🔴
pytorch-examples-wlang-lstm 1 393.31 386.92 1.65%
torchvision-resnet50_1 1 816.53 776.87 5.10% 🔆
cadene-dpn92_1 1 398.12 395.29 0.72%
cadene-resnext101_1 1 382.70 373.27 2.53%
onnx-taau-downsample 1 345.54 345.34 0.06%
dlrm-criteoterabyte 1 33.33 33.31 0.08%
dlrm-criteoterabyte_fp16 1 52.51 52.72 -0.40%
agentmodel 1 8,270.00 8,185.78 1.03%
unet_fp16 2 58.84 58.75 0.16%
resnet50v1_fp16 1 954.45 945.03 1.00%
resnet50v1_int8 1 1,005.01 987.38 1.78%
bert_base_cased_fp16 64 1,169.79 1,169.56 0.02%
bert_large_uncased_fp16 32 363.63 363.05 0.16%
bert_large_fp16 1 200.55 198.54 1.01%
distilgpt2_fp16 16 2,197.94 2,199.18 -0.06%
yolov5s 1 525.57 534.87 -1.74%
tinyllama 1 43.36 43.39 -0.07%
vicuna-fastchat 1 172.84 175.67 -1.61%
whisper-tiny-encoder 1 416.57 417.72 -0.28%
whisper-tiny-decoder 1 426.25 428.36 -0.49%

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 2e59073 into develop Dec 11, 2024
43 of 45 checks passed
@causten causten deleted the layernorm-pointwise-fuse branch December 11, 2024 00:44
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