tenstorrent / tt-metal

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

DPRINT on eth core #4632

Closed aliuTT closed 8 months ago

aliuTT commented 8 months ago

Likely that if context switching is done properly in eth FW this should be functional.

aliuTT commented 8 months ago

@tt-dma This tests all ethernet links in your system:

- export TT_METAL_ENV=dev && export TT_METAL_HOME=$PWD && export ARCH_NAME=wormhole_b0 && export PYTHONPATH=$TT_METAL_HOME && make build
- make tests
- TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/unit_tests --gtest_filter="DeviceFixture.EthKernelsDirectSendAllConnectedChips"

The test is run using slow dispatch and multi threaded runtime, one thread per Device. The user kernels are here:

I have a similar FW structure to the ncrisc or brisc kernels. There is a base FW tt_metal/hw/firmware/src/erisc.cc that launches the user kernel FW tt_metal/hw/firmware/src/erisck.cc. Ethernet physical cores can be accessed with these apis:

for (const auto& eth_core : device_0->get_active_ethernet_cores()) {
    const auto& physical_core = device_0->ethernet_core_from_logical_core(eth_core);
}

Try to DPRINT from the local chip ethernet core and remote chip ethernet core. Let me know if you encounter any issues!

tt-dma commented 8 months ago

PR: https://github.com/tenstorrent-metal/tt-metal/pull/4709 implements this. We should have support + a gtest for printing from ethernet cores now.

aliuTT commented 8 months ago

Thanks David!