tenstorrent / tt-mlir

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

[MNIST] Implement conversion of stablehlo.dot_general OP to TTIR dialect #504

Open mrakitaTT opened 1 month ago

mrakitaTT commented 1 month ago

stablehlo.dot_general OP specification can be found here.

StableHLO has a more powerful version of matmul which can do a dot product of high rank tensors along any target (contracting) dimensions. If the contracting dimensions are corresponding to standard matmul dimensions that TTIR.MatmulOp uses, we can do the simple conversion stablehlo.dot_general -> ttir.matmul. Otherwise we need to convert stablehlo.dot_general to ttir.transpose + ttir.matmul.

uazizTT commented 2 weeks ago

656 Adds conversion for stablehlo.dot_general for cases that can be converted to ttir.matmul