tenstorrent / tt-mlir

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

Support multiple op users with different layouts #890

Open svuckovicTT opened 4 hours ago

svuckovicTT commented 4 hours ago

Today, in TTIR -> TTNN conversion path, we don't handle scenarios where a producer op has multiple consumers that expect different layouts (tile vs row_major). This might be true for other layout properties (sharded vs interleaved, device vs cpu, etc.).

Example: https://github.com/tenstorrent/tt-mlir/pull/863#discussion_r1793744974

svuckovicTT commented 3 hours ago

Paging @nobradovictt for optimizer, @nsmithtt for experience with tt metal

Any thoughts on this guys? For generality purposes, we could try with copying tensors for the consumers, but it does seem like a tricky problem even then, in terms of memory usage (e.g. what if multiple consumers require different layout properties, but both need the inputs to be in L1, sharded).