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

Layout convolution as NHWC or NCHW only #3729

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

pfultz2
Copy link
Collaborator

@pfultz2 pfultz2 commented Dec 20, 2024

No description provided.

@pfultz2 pfultz2 requested a review from causten as a code owner December 20, 2024 18:46
@TedThemistokleous TedThemistokleous added the roadmap Tasks to finish for a release label Dec 20, 2024
Copy link
Collaborator

@TedThemistokleous TedThemistokleous left a comment

Choose a reason for hiding this comment

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

Changes look simple and I get the point here.

I think you need to update auto convolution though


[2024-12-20T21:46:54.569Z] [   RUN    ] auto_conv_nchw

[2024-12-20T21:46:54.569Z] [ COMPLETE ] auto_conv_nchw (33.3551ms)

[2024-12-20T21:46:54.569Z] [   RUN    ] auto_conv_nhwc

[2024-12-20T21:46:54.569Z] void auto_conv_nhwc()

[2024-12-20T21:46:54.569Z] /var/jenkins/workspace/AMDMIGraphX_PR-3729/test/layout_convolution.cpp:90:

[2024-12-20T21:46:54.569Z]     FAILED: m1.sort() == m2.sort() [ @0 = @literal{ ... } -> float_type, {16, 3, 3, 8}, {72, 24, 8, 1}

[2024-12-20T21:46:54.569Z] @1 = transpose[permutation={0, 3, 1, 2}](@0) -> float_type, {16, 8, 3, 3}, {72, 1, 24, 8}

[2024-12-20T21:46:54.569Z] @2 = layout[permutation={0, 1, 2, 3}](@1) -> float_type, {16, 8, 3, 3}, {72, 9, 3, 1}

[2024-12-20T21:46:54.570Z] x = @param:x -> float_type, {1, 16, 16, 8}, {2048, 128, 8, 1}

[2024-12-20T21:46:54.570Z] @4 = transpose[permutation={0, 3, 1, 2}](x) -> float_type, {1, 8, 16, 16}, {2048, 1, 128, 8}

[2024-12-20T21:46:54.570Z] @5 = layout[permutation={0, 1, 2, 3}](@4) -> float_type, {1, 8, 16, 16}, {2048, 256, 16, 1}

[2024-12-20T21:46:54.570Z] @6 = convolution[padding={1, 1},stride={2, 2},dilation={1, 1},group=1,padding_mode=0](@5,@2) -> float_type, {1, 16, 8, 8}, {1024, 64, 8, 1}

[2024-12-20T21:46:54.570Z] @7 = relu(@6) -> float_type, {1, 16, 8, 8}, {1024, 64, 8, 1}

[2024-12-20T21:46:54.570Z] @8 = layout[permutation={0, 2, 3, 1}](@7) -> float_type, {1, 16, 8, 8}, {1024, 1, 128, 16}

[2024-12-20T21:46:54.570Z] @9 = @return(@8)

[2024-12-20T21:46:54.570Z]  == @0 = @literal{ ... } -> float_type, {16, 3, 3, 8}, {72, 24, 8, 1}

[2024-12-20T21:46:54.570Z] @1 = transpose[permutation={0, 3, 1, 2}](@0) -> float_type, {16, 8, 3, 3}, {72, 1, 24, 8}

[2024-12-20T21:46:54.570Z] x = @param:x -> float_type, {1, 16, 16, 8}, {2048, 128, 8, 1}

[2024-12-20T21:46:54.570Z] @3 = transpose[permutation={0, 3, 1, 2}](x) -> float_type, {1, 8, 16, 16}, {2048, 1, 128, 8}

[2024-12-20T21:46:54.570Z] @4 = convolution[padding={1, 1},stride={2, 2},dilation={1, 1},group=1,padding_mode=0](@3,@1) -> float_type, {1, 16, 8, 8}, {1024, 1, 128, 16}

[2024-12-20T21:46:54.570Z] @5 = relu(@4) -> float_type, {1, 16, 8, 8}, {1024, 1, 128, 16}

[2024-12-20T21:46:54.570Z] @6 = @return(@5)

[2024-12-20T21:46:54.570Z]  ]

@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
59e5f0
Rate old
23ac3a
Diff Compare
torchvision-resnet50 64 3,235.59 3,237.23 -0.05%
torchvision-resnet50_fp16 64 6,874.33 6,866.95 0.11%
torchvision-densenet121 32 2,439.60 2,437.09 0.10%
torchvision-densenet121_fp16 32 4,185.99 4,197.72 -0.28%
torchvision-inceptionv3 32 1,613.72 1,613.72 0.00%
torchvision-inceptionv3_fp16 32 2,677.82 2,675.59 0.08%
cadene-inceptionv4 16 750.82 750.82 0.00%
cadene-resnext64x4 16 810.13 810.13 0.00%
slim-mobilenet 64 6,663.41 6,661.70 0.03%
slim-nasnetalarge 64 196.91 196.87 0.02%
slim-resnet50v2 64 3,433.94 3,431.78 0.06%
bert-mrpc-onnx 8 1,136.36 1,134.75 0.14%
bert-mrpc-tf 1 500.00 495.05 1.00%
pytorch-examples-wlang-gru 1 470.41 469.71 0.15%
pytorch-examples-wlang-lstm 1 444.98 443.98 0.23%
torchvision-resnet50_1 1 800.00 800.00 0.00%
cadene-dpn92_1 1 429.88 431.70 -0.42%
cadene-resnext101_1 1 390.62 389.11 0.39%
onnx-taau-downsample 1 396.72 371.30 6.85% 🔆
dlrm-criteoterabyte 1 31.79 31.80 -0.02%
dlrm-criteoterabyte_fp16 1 51.06 50.95 0.21%
agentmodel 1 8,840.40 8,751.74 1.01%
unet_fp16 2 58.36 58.29 0.12%
resnet50v1_fp16 1 1,052.63 1,052.63 0.00%
resnet50v1_int8 1 787.40 800.00 -1.57%
bert_base_cased_fp16 64 1,159.63 1,159.63 0.00%
bert_large_uncased_fp16 32 360.20 360.16 0.01%
bert_large_fp16 1 215.98 216.92 -0.43%
distilgpt2_fp16 16 2,188.78 2,188.78 0.00%
yolov5s 1 521.33 537.05 -2.93%
tinyllama 1 49.09 49.09 0.00%
vicuna-fastchat 1 43.61 43.61 0.02%
whisper-tiny-encoder 1 436.68 436.68 0.00%
whisper-tiny-decoder 1 448.43 450.45 -0.45%

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap Tasks to finish for a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants