Skip to content

Commit

Permalink
upsize EDM fabric channel buffer slots to be able to fit 4 bfp8 tiles…
Browse files Browse the repository at this point in the history
… per packet (#18000)

The current default EDM buffer slot size is 4096 which can only store 3
bfp8 tiles. There is enough space in erisc L1 unreserved space such that
all channels can have a power of 2 buffer slot count and also have a
slot size of 4 bfp8 tiles. There is inefficient space for 5 bfp8 tiles
per slot.

This commit bumps up the buffer slot size to fit 4 bfp8 tiles per packet,
which is preferable for workloads with bfp8 tiles sent over fabric.
  • Loading branch information
SeanNijjar authored Feb 19, 2025
1 parent 6dea8e6 commit 22fd7c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ bool RunLoopbackTest(
// EDM Builder Setup
////////////////////////////////////////////////////////////////////////////

static constexpr std::size_t edm_buffer_size = 4096 + PACKET_HEADER_SIZE_BYTES;
static constexpr std::size_t edm_buffer_size =
ttnn::ccl::FabricEriscDatamoverBuilder::default_packet_payload_size_bytes + PACKET_HEADER_SIZE_BYTES;

auto chip0_worker_fabric_connection = chip_0_edm_builder.build_connection_to_worker_channel();
////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -910,7 +911,8 @@ bool RunLineFabricTest(
std::size_t page_plus_header_size = page_size + sizeof(tt::fabric::PacketHeader);
std::size_t tensor_size_bytes = num_pages_total * page_size;

static constexpr std::size_t edm_buffer_size = 4096 + PACKET_HEADER_SIZE_BYTES;
static constexpr std::size_t edm_buffer_size =
ttnn::ccl::FabricEriscDatamoverBuilder::default_packet_payload_size_bytes + PACKET_HEADER_SIZE_BYTES;
const size_t local_chip_id = 0;
const size_t remote_chip_id = 1;
auto program_ptrs = std::vector<Program*>(devices.size());
Expand Down Expand Up @@ -1237,7 +1239,8 @@ int TestLoopbackEntrypoint(
IDevice* sender_device = device_0;
IDevice* receiver_device = device_1;

static constexpr std::size_t edm_buffer_size = 4096 + PACKET_HEADER_SIZE_BYTES;
static constexpr std::size_t edm_buffer_size =
ttnn::ccl::FabricEriscDatamoverBuilder::default_packet_payload_size_bytes + PACKET_HEADER_SIZE_BYTES;
const chip_id_t local_chip_id = 0;
const chip_id_t remote_chip_id = 1;
auto const& edm_config = ttnn::ccl::FabricEriscDatamoverConfig(edm_buffer_size, 1, 2);
Expand Down Expand Up @@ -2988,7 +2991,8 @@ void RunWriteThroughputStabilityTestWithPersistentFabric(
static constexpr uint32_t source_payload_cb_index = tt::CB::c_in1;
static constexpr size_t packet_header_cb_size_in_headers = 4;
static constexpr bool enable_persistent_fabric_mode = true;
static constexpr size_t packet_payload_size_bytes = 4096;
static constexpr size_t packet_payload_size_bytes =
ttnn::ccl::FabricEriscDatamoverBuilder::default_packet_payload_size_bytes;
static constexpr size_t dest_buffer_size = packet_payload_size_bytes * 4;
static constexpr tt::DataFormat cb_df = tt::DataFormat::Bfp8;

Expand Down
2 changes: 1 addition & 1 deletion ttnn/cpp/ttnn/operations/ccl/erisc_datamover_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class FabricEriscDatamoverBuilder {
public:
static constexpr size_t default_firmware_context_switch_interval = 200000;
// payload only, no header
static constexpr size_t default_packet_payload_size_bytes = 4096;
static constexpr size_t default_packet_payload_size_bytes = tt::tile_size(tt::DataFormat::Bfp8_b) * 4;

FabricEriscDatamoverBuilder(
const CoreCoord& my_eth_core_logical,
Expand Down

0 comments on commit 22fd7c5

Please sign in to comment.