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

[Golden] TTRT segfault when trying to copy tensor data #1665

Open
mtopalovicTT opened this issue Dec 25, 2024 · 0 comments
Open

[Golden] TTRT segfault when trying to copy tensor data #1665

mtopalovicTT opened this issue Dec 25, 2024 · 0 comments
Assignees
Labels
MLIR Ops Issues related to MLIR dialect ops and their implementations

Comments

@mtopalovicTT
Copy link
Contributor

I'm working on bug which has this as input IR:

module @jit_convolution attributes {} {
  func.func @forward(%arg0: tensor<1x2048x7x7xf32> {ttir.name = "x"}) -> (tensor<1x2048x1x1xf32> {ttir.name = "AvgPool2d.output_avg_pool2d_0"}) {
    %0 = tensor.empty() : tensor<1x1x2048x49xf32>
    %1 = "ttir.reshape"(%arg0, %0) <{shape = [1 : i32, 1 : i32, 2048 : i32, 49 : i32]}> : (tensor<1x2048x7x7xf32>, tensor<1x1x2048x49xf32>) -> tensor<1x1x2048x49xf32>
    %2 = tensor.empty() : tensor<1x1x49x2048xf32>
    %3 = "ttir.transpose"(%1, %2) <{dim0 = -2 : si32, dim1 = -1 : si32}> : (tensor<1x1x2048x49xf32>, tensor<1x1x49x2048xf32>) -> tensor<1x1x49x2048xf32>
    %4 = tensor.empty() : tensor<1x1x1x2048xf32>
    %5 = "ttir.mean"(%3, %4) <{keep_dim = true}> {dim = -2 : si32} : (tensor<1x1x49x2048xf32>, tensor<1x1x1x2048xf32>) -> tensor<1x1x1x2048xf32>
    %6 = tensor.empty() : tensor<1x2048x1x1xf32>
    %7 = "ttir.reshape"(%5, %6) <{shape = [1 : i32, 2048 : i32, 1 : i32, 1 : i32]}> : (tensor<1x1x1x2048xf32>, tensor<1x2048x1x1xf32>) -> tensor<1x2048x1x1xf32>
    return %7 : tensor<1x2048x1x1xf32>
  }
}

When I run ttrt on silicon I get segfault when trying to get output tensor of to_layout operation. Below is log tail:

2024-12-25 21:59:48,810 - DEBUG - evaluating program=0 for binary=avg.ttnn
                 Always |  WARNING | Golden information not found
2024-12-25 21:59:48,811 - DEBUG - generating inputs/outputs for loop=1/1 for binary=avg.ttnn
2024-12-25 21:59:48,812 - DEBUG - starting loop=1/1 for binary=avg.ttnn
            RuntimeTTNN |    DEBUG | Executing operation: %0 = "ttnn.get_device"() <{mesh_shape = #ttnn<mesh_shape 1x1>}> : () -> !tt.device<<workerGrid = #tt.grid<8x8, (d0, d1) -> (0, d0, d1)>, l1Map = (d0, d1)[s0, s1] -> (0, d0 floordiv s0, d1 floordiv s1, (d0 mod s0) * s1 + d1 mod s1), dramMap = (d0, d1)[s0, s1] -> (0, 0, ((((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 8192) mod 12, (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) floordiv 98304 + (((d0 floordiv s0) * 8 + d1 floordiv s1) * (s1 * s0) + (d0 mod s0) * s1 + d1 mod s1) mod 8192), meshShape = , chipIds = [0]>> loc("avg.ttnn.mlir":14:10)
2024-12-25 21:59:48,812 - DEBUG - executing golden comparison
                 Always |  WARNING | Golden information not found
                 Always |  WARNING | Output tensor not found in tensor pool
2024-12-25 21:59:48,812 - DEBUG - Golden tensor is None - skipping golden comparison
            RuntimeTTNN |    DEBUG | Executing operation: %1 = "ttnn.to_layout"(%arg0) <{layout = #ttnn.layout<tile>}> : (tensor<1x2048x7x7xf32, #ttnn.ttnn_layout<(d0, d1, d2, d3) -> (d0 * 14336 + d1 * 7 + d2, d3), <1x1>, memref<14336x7xf32, #ttnn.buffer_type<system_memory>>>>) -> tensor<1x2048x7x7xf32, #ttnn.ttnn_layout<(d0, d1, d2, d3) -> (d0 * 14336 + d1 * 7 + d2, d3), <1x1>, memref<448x1x!tt.tile<32x32, f32>, #ttnn.buffer_type<dram>>, <interleaved>>> loc("avg.ttnn.mlir":15:10)
2024-12-25 21:59:48,864 - DEBUG - executing golden comparison
                 Always |  WARNING | Golden information not found
Segmentation fault

I'm running mlir in debug build on commit 109d917. If any information is missing please reach out.

@mtopalovicTT mtopalovicTT added the MLIR Ops Issues related to MLIR dialect ops and their implementations label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MLIR Ops Issues related to MLIR dialect ops and their implementations
Projects
None yet
Development

No branches or pull requests

2 participants