Skip to content

Commit

Permalink
#15221: Post completion messages to dispatch_s
Browse files Browse the repository at this point in the history
We never wait on the acks from these completion messages, so make them posted
to avoid contention from a lot of replies being sent at once. In the case where
every worker is sending them at the same time, this can halve the latency from
500ns to 250ns (on wormhole).
  • Loading branch information
jbaumanTT committed Dec 19, 2024
1 parent 485a18d commit 3f54011
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tt_metal/hw/firmware/src/brisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ int main() {
NOC_UNICAST_WRITE_VC,
1,
31 /*wrap*/,
false /*linked*/);
false /*linked*/,
true /*posted*/);
}
}

Expand Down Expand Up @@ -529,7 +530,8 @@ int main() {
NOC_UNICAST_WRITE_VC,
1,
31 /*wrap*/,
false /*linked*/);
false /*linked*/,
true /*posted*/);
mailboxes->launch_msg_rd_ptr = (launch_msg_rd_ptr + 1) & (launch_msg_buffer_num_entries - 1);
}
}
Expand Down
10 changes: 9 additions & 1 deletion tt_metal/hw/firmware/src/idle_erisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,15 @@ int main() {
DISPATCH_MESSAGE_ADDR + mailboxes->go_message.dispatch_message_offset);
DEBUG_SANITIZE_NOC_ADDR(noc_index, dispatch_addr, 4);
CLEAR_PREVIOUS_LAUNCH_MESSAGE_ENTRY_FOR_WATCHER();
noc_fast_atomic_increment(noc_index, NCRISC_AT_CMD_BUF, dispatch_addr, NOC_UNICAST_WRITE_VC, 1, 31 /*wrap*/, false /*linked*/);
noc_fast_atomic_increment(
noc_index,
NCRISC_AT_CMD_BUF,
dispatch_addr,
NOC_UNICAST_WRITE_VC,
1,
31 /*wrap*/,
false /*linked*/,
true /*posted*/);
mailboxes->launch_msg_rd_ptr = (launch_msg_rd_ptr + 1) & (launch_msg_buffer_num_entries - 1);
}

Expand Down
9 changes: 8 additions & 1 deletion tt_metal/hw/inc/ethernet/tunneling.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ void notify_dispatch_core_done(uint64_t dispatch_addr) {
}
DEBUG_SANITIZE_NOC_ADDR(noc_index, dispatch_addr, 4);
noc_fast_atomic_increment(
noc_index, NCRISC_AT_CMD_BUF, dispatch_addr, NOC_UNICAST_WRITE_VC, 1, 31 /*wrap*/, false /*linked*/);
noc_index,
NCRISC_AT_CMD_BUF,
dispatch_addr,
NOC_UNICAST_WRITE_VC,
1,
31 /*wrap*/,
false /*linked*/,
true /*posted*/);
}

} // namespace internal_
Expand Down

0 comments on commit 3f54011

Please sign in to comment.