tenstorrent / tt-mlir

Tenstorrent MLIR compiler
https://tenstorrent.github.io/tt-mlir/
Apache License 2.0
75 stars 11 forks source link

Support ttrt reading inf/-inf numbers #838

Open tapspatel opened 1 month ago

tapspatel commented 1 month ago
// RUN: ttmlir-opt --ttir-to-ttnn-backend-pipeline="system-desc-path=%system_desc_path%" %s > %t.mlir
// RUN: ttmlir-translate --ttnn-to-flatbuffer %t.mlir > %t.ttnn

module attributes {} {
  func.func @forward() -> tensor<1xf32> {
    %0 = "ttir.constant"() <{value = dense<0xFF800000> : tensor<1xf32>}> : () -> tensor<1xf32>
    return %0 : tensor<1xf32>
  }
}

following snippet is not getting converted correctly when reading flatbuffer

mrakitaTT commented 1 month ago

Nice, I had a TODO to open you a bug for this, wasted so much time last week trying to figure out why ttrt is giving me json errors for certain mlir graphs and bisecting them until I realized that 0xFF800000 was the problem 😅