tenstorrent / tt-metal

:metal: TT-NN operator library, and TT-Metalium low level kernel programming model.
https://docs.tenstorrent.com/ttnn/latest/index.html
Apache License 2.0
501 stars 83 forks source link

I2S output buffer sizing and CB sizing do not always match #15670

Open mywoodstock opened 14 hours ago

mywoodstock commented 14 hours ago

For TILE inputs + HEIGHT_SHARDING, I2S op does the following currently:

  1. Sets the output buffer size equal to input shape (legacy shape) and is unaware of sharding.
  2. Calculates CB size for output based on number of tiles per shard. When the input shape is not a multiple of TILE height * number of shards, the two sizes are different, and leads to assertion with the CB allocation.

I think the solution should be that the size calculation for the output buffer should match CB size calculation.

Example Branch: main Compile in debug mode to enable the above assertion. Test: pytest "tests/ttnn/unit_tests/operations/test_maxpool2d.py::test_run_max_pool[dtype=DataType.BFLOAT8_B-dilation=(1, 1)-stride=(2, 2)-padding=(0, 0)-kernel_size=(2, 2)-act_shape=[1, 256, 56, 56]-device_params={'l1_small_size': 24576}]"

mywoodstock commented 14 hours ago

cc: @wransom-TT @tt-aho