tenstorrent / tt-metal

:metal: TT-NN operator library, and TT-Metalium low level kernel programming model.
Apache License 2.0
478 stars 78 forks source link

Fix CB size validation when passing in a sharded buffer #15337

Open tt-aho opened 20 hours ago

tt-aho commented 20 hours ago

Currently, the CB infra takes the buffer's total size, and uses it as the max size that is checked against the user specified size to make sure it is within the actual specified buffer space. Using the total size is incorrect, and it should use the max size used of a bank for the buffer. This bug allows users to overrun the actual used space of a buffer with their cb, allowing them to corrupt data.

Initial test run with the fixed assertion https://github.com/tenstorrent/tt-metal/actions/runs/11922373133 shows we need to fix a lot of ops to pass a correct size.