Skip to content

Commit

Permalink
#9012: Fix l1_cache size to be correctly sized to l1_cache_elements_r…
Browse files Browse the repository at this point in the history
…ounded

Update process_relay_paged_packed_sub_cmds to set last round value for write_pages_to_dispatcher to 1
  • Loading branch information
tt-aho committed Jun 25, 2024
1 parent 437d4db commit a70b0d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tt_metal/impl/dispatch/kernels/cq_dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ constexpr uint32_t l1_cache_elements_rounded =
((l1_cache_elements + l1_to_local_cache_copy_chunk - 1) / l1_to_local_cache_copy_chunk) *
l1_to_local_cache_copy_chunk;

static uint32_t l1_cache[l1_cache_elements];
static uint32_t l1_cache[l1_cache_elements_rounded];

FORCE_INLINE volatile uint32_t *get_cq_completion_read_ptr() {
return reinterpret_cast<volatile uint32_t *>(CQ_COMPLETION_READ_PTR);
Expand Down
4 changes: 2 additions & 2 deletions tt_metal/impl/dispatch/kernels/cq_prefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ constexpr uint32_t l1_cache_elements_rounded =
((l1_cache_elements + l1_to_local_cache_copy_chunk - 1) / l1_to_local_cache_copy_chunk) *
l1_to_local_cache_copy_chunk;

static uint32_t l1_cache[l1_cache_elements];
static uint32_t l1_cache[l1_cache_elements_rounded];

static struct PrefetchExecBufState {
uint32_t page_id;
Expand Down Expand Up @@ -737,7 +737,7 @@ void process_relay_paged_packed_sub_cmds(uint32_t total_length) {
// Third step - write from DB
scratch_write_addr = scratch_db_top[db_toggle];
uint32_t amt_to_write = amt_read;
uint32_t npages = write_pages_to_dispatcher<CQ_DISPATCH_CMD_SIZE, true>
uint32_t npages = write_pages_to_dispatcher<1, true>
(downstream_data_ptr, scratch_write_addr, amt_to_write);

downstream_data_ptr = round_up_pow2(downstream_data_ptr, downstream_cb_page_size);
Expand Down

0 comments on commit a70b0d5

Please sign in to comment.