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
485 stars 79 forks source link

#15263: Fix incorrect calculation for needed sub_cmds for rtas #15314

Closed tt-aho closed 4 days ago

tt-aho commented 4 days ago

Ticket

https://github.com/tenstorrent/tt-metal/issues/15263

Problem description

We reserve the wrong size for the rtas cmd cache vector. Since we cache the addresses of rtas as we populate the vector, this results in the vector getting resized/reallocated, invalidating our cached addresses.

What's changed

Calculate the actual size needed for the cached vector instead of approximating. Add a TT_ASSERT to make sure we have a clear error message if this ever happens again instead of segfaulting.

Checklist