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

Visualize ttir graph in tt-explorer #1719

Open
Tracked by #1705
tapspatel opened this issue Jan 7, 2025 · 2 comments
Open
Tracked by #1705

Visualize ttir graph in tt-explorer #1719

tapspatel opened this issue Jan 7, 2025 · 2 comments
Assignees
Labels
bug Something isn't working explorer Issues related to Explorer Visualization tool

Comments

@tapspatel
Copy link
Contributor

The following ttir graph gives the error in tt-explorer

AttributeError: 'ttmlir._mlir_libs._mlir.ir.ArrayAttr' object has no attribute 'value'
module {
  func.func @main(%arg0: tensor<1x784xf32>, %arg1: tensor<784x128xf32>, %arg2: tensor<128xf32>, %arg3: tensor<1xi32>) -> tensor<1x128xf32> {
    %0 = tensor.empty() : tensor<1x128xf32>
    %1 = "ttir.matmul"(%arg0, %arg1, %0) : (tensor<1x784xf32>, tensor<784x128xf32>, tensor<1x128xf32>) -> tensor<1x128xf32>
    %2 = tensor.empty() : tensor<1xf32>
    %3 = "ttir.typecast"(%arg3, %2) <{operandSegmentSizes = array<i32: 1, 1>}> : (tensor<1xi32>, tensor<1xf32>) -> tensor<1xf32>
    %4 = tensor.empty() : tensor<1x128xf32>
    %5 = "ttir.broadcast"(%1, %4) <{dimension = [0, 1]}> : (tensor<1x128xf32>, tensor<1x128xf32>) -> tensor<1x128xf32>
    %6 = tensor.empty() : tensor<1x128xf32>
    %7 = "ttir.broadcast"(%3, %6) <{dimension = []}> : (tensor<1xf32>, tensor<1x128xf32>) -> tensor<1x128xf32>
    %8 = tensor.empty() : tensor<1x128xf32>
    %9 = "ttir.multiply"(%5, %7, %8) <{operandSegmentSizes = array<i32: 2, 1>}> : (tensor<1x128xf32>, tensor<1x128xf32>, tensor<1x128xf32>) -> tensor<1x128xf32>
    %10 = tensor.empty() : tensor<1x128xf32>
    %11 = "ttir.broadcast"(%9, %10) <{dimension = [0, 1]}> : (tensor<1x128xf32>, tensor<1x128xf32>) -> tensor<1x128xf32>
    %12 = tensor.empty() : tensor<1x128xf32>
    %13 = "ttir.broadcast"(%arg2, %12) <{dimension = [1]}> : (tensor<128xf32>, tensor<1x128xf32>) -> tensor<1x128xf32>
    %14 = tensor.empty() : tensor<1x128xf32>
    %15 = "ttir.add"(%11, %13, %14) <{operandSegmentSizes = array<i32: 2, 1>}> : (tensor<1x128xf32>, tensor<1x128xf32>, tensor<1x128xf32>) -> tensor<1x128xf32>
    return %15 : tensor<1x128xf32>
  }
}
@odjuricicTT
Copy link
Contributor

@tapspatel Thanks for filing this! Sorry for the late reply i've been OOO. In the future feel free to add @vprajapati-tt to new issues as well.

@odjuricicTT
Copy link
Contributor

@vprajapati-tt Can you take a look at what is causing this and add a test for this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working explorer Issues related to Explorer Visualization tool
Projects
None yet
Development

No branches or pull requests

3 participants