ROCm / AMDMIGraphX

AMD's graph optimization engine.
https://rocm.docs.amd.com/projects/AMDMIGraphX/en/latest/
MIT License
185 stars 86 forks source link

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

Closed pfultz2 closed 3 weeks ago

pfultz2 commented 1 month ago

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.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

Check results before merge :high_brightness:

migraphx-bot commented 4 weeks ago


     :white_check_mark: bert-mrpc-onnx: PASSED: MIGraphX meets tolerance
     :white_check_mark: bert-mrpc-tf: PASSED: MIGraphX meets tolerance
     :white_check_mark: pytorch-examples-wlang-gru: PASSED: MIGraphX meets tolerance
     :white_check_mark: pytorch-examples-wlang-lstm: PASSED: MIGraphX meets tolerance
     :white_check_mark: torchvision-resnet50_1: PASSED: MIGraphX meets tolerance
     :white_check_mark: cadene-dpn92_1: PASSED: MIGraphX meets tolerance
     :white_check_mark: cadene-resnext101_1: PASSED: MIGraphX meets tolerance
     :white_check_mark: dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance
     :white_check_mark: agentmodel: PASSED: MIGraphX meets tolerance
     :white_check_mark: unet: PASSED: MIGraphX meets tolerance
     :white_check_mark: resnet50v1: PASSED: MIGraphX meets tolerance
     :white_check_mark: bert_base_cased_fp16: PASSED: MIGraphX meets tolerance
:red_circle:bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output

     :white_check_mark: bert_large: PASSED: MIGraphX meets tolerance
     :white_check_mark: yolov5s: PASSED: MIGraphX meets tolerance
     :white_check_mark: tinyllama: PASSED: MIGraphX meets tolerance
     :white_check_mark: vicuna-fastchat: PASSED: MIGraphX meets tolerance
     :white_check_mark: whisper-tiny-encoder: PASSED: MIGraphX meets tolerance
     :white_check_mark: whisper-tiny-decoder: PASSED: MIGraphX meets tolerance
     :white_check_mark: distilgpt2_fp16: PASSED: MIGraphX meets tolerance