ROCm / ROCm/AMDMIGraphX

MIGraphX is generating deadcode while compiling BERT model

Open
#3,149 0 comments 0 reactions 1 assignee View on GitHub

@ahsan-ca is already working on this.

Since Jun 5, 2024.

Perf Improve
Dominant language
C++
Stars
333
Forks
150
Avg merge
4d 19h
Merged PRs (30d)
54

Description

module: "mlir_main:pointwise157"
mlir_main:pointwise157:@0 = @literal{0.125} -> half_type, {1}, {0}
mlir_main:pointwise157:y1 = @param:y1 -> half_type, {1, 1, 2304}, {2304, 2304, 1}
mlir_main:pointwise157:y0 = @param:y0 -> half_type, {1, 1, 2304}, {2304, 2304, 1}
mlir_main:pointwise157:@3 = slice[axes={2},starts={0},ends={768}](mlir_main:pointwise157:y0) -> half_type, {1, 1, 768}, {2304, 2304, 1}
mlir_main:pointwise157:@4 = reshape[dims={1, 1, 12, 64}](mlir_main:pointwise157:@3) -> half_type, {1, 1, 12, 64}, {768, 768, 64, 1}
mlir_main:pointwise157:@5 = transpose[permutation={0, 2, 1, 3}](mlir_main:pointwise157:@4) -> half_type, {1, 12, 1, 64}, {768, 64, 768, 1}
mlir_main:pointwise157:@6 = contiguous(mlir_main:pointwise157:@5) -> half_type, {1, 12, 1, 64}, {768, 64, 64, 1}
mlir_main:pointwise157:@7 = slice[axes={2},starts={768},ends={1536}](mlir_main:pointwise157:y1) -> half_type, {1, 1, 768}, {2304, 2304, 1}
mlir_main:pointwise157:@8 = reshape[dims={1, 1, 12, 64}](mlir_main:pointwise157:@7) -> half_type, {1, 1, 12, 64}, {768, 768, 64, 1}
mlir_main:pointwise157:@9 = transpose[permutation={0, 2, 3, 1}](mlir_main:pointwise157:@8) -> half_type, {1, 12, 64, 1}, {768, 64, 1, 768}
mlir_main:pointwise157:@10 = contiguous(mlir_main:pointwise157:@9) -> half_type, {1, 12, 64, 1}, {768, 64, 1, 1}
mlir_main:pointwise157:@11 = dot(mlir_main:pointwise157:@6,mlir_main:pointwise157:@10) -> half_type, {1, 12, 1, 1}, {12, 1, 1, 1}
mlir_main:pointwise157:@12 = multibroadcast[out_lens={1, 12, 1, 1},out_dyn_dims={}](mlir_main:pointwise157:@0) -> half_type, {1, 12, 1, 1}, {0, 0, 0, 0}
mlir_main:pointwise157:@13 = mul(mlir_main:pointwise157:@11,mlir_main:pointwise157:@12) -> half_type, {1, 12, 1, 1}, {12, 1, 1, 1}
mlir_main:pointwise157:@14 = sub(mlir_main:pointwise157:@13,mlir_main:pointwise157:@13) -> half_type, {1, 12, 1, 1}, {12, 1, 1, 1}
mlir_main:pointwise157:@15 = exp(mlir_main:pointwise157:@14) -> half_type, {1, 12, 1, 1}, {12, 1, 1, 1}
mlir_main:pointwise157:@16 = div(mlir_main:pointwise157:@15,mlir_main:pointwise157:@15) -> half_type, {1, 12, 1, 1}, {12, 1, 1, 1}
mlir_main:pointwise157:@17 = @return(mlir_main:pointwise157:@16)

Notice mlir_main:pointwise157:@14 = sub(mlir_main:pointwise157:@13,mlir_main:pointwise157:@13) is computing zero.

Need to figure out why this is happening.

this can be reproduced by running :

./build/bin/driver perf /models/ORT/bert_base_cased_1.onnx --fill1 input_ids --fp16 --exhaustive-tune

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.