tenstorrent / tt-metal

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

Allowing support for initializing multiple nocs and customizing command buffer configuration when creating kernels #13184

Open tt-aho opened 10 hours ago

tt-aho commented 10 hours ago

Currently, user can specify a single noc to KernelConfig, which is used to initialize the default noc_index used in kernels. Our command buffers are defined in noc_nonblocking_api.h, and the specific ones used are hardcoded in dataflow_api.h.

There are use cases for both fast dispatch and user kernels where we want customized implementations for this.

Ex. brisc (use noc 0 and 1): use cmd_buf 0 and 1 ncrisc (use noc 0 and 1): use cmd_buf 2 and 3 where for a risc, one command buffer is for reads, the rest is for regular, small, and atomic writes.

@pgkeller @yugaoTT

yugaoTT commented 10 hours ago

@tt-aho I added the support in yugao/noc Basically I replaced one of the pad field with noc_mode. Please let me know if the impl is okay or not

tt-aho commented 9 hours ago

@tt-aho I added the support in yugao/noc Basically I replaced one of the pad field with noc_mode. Please let me know if the impl is okay or not

We're planning for more generic support where we have the current default config or user can manually configure the cmd buf distribution themselves, as for example our configuration for FD is not the same as what's in yugao/noc.