Skip to content

Commit

Permalink
added missing namespace tt::tt_metal:: in all reduce PR
Browse files Browse the repository at this point in the history
  • Loading branch information
kpaigwar committed Mar 6, 2025
1 parent f3d8fac commit 57140de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct AllReduceAsync {
MemoryConfig output_mem_config,
ccl::Topology topology,
GlobalSemaphore semaphore,
std::optional<SubDeviceId>& sub_device_id,
std::optional<tt::tt_metal::SubDeviceId>& sub_device_id,
bool enable_persistent_fabric_mode) :
forward_device(forward_device),
backward_device(backward_device),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ tt::tt_metal::operation::ProgramWithCallbacks all_reduce_async_minimal_multi_cor
tt::tt_metal::CircularBufferConfig cb_src0_config =
tt::tt_metal::CircularBufferConfig(cb_num_pages * l1_scratch_cb_page_size_bytes, {{src0_cb_index, df}})
.set_page_size(src0_cb_index, l1_scratch_cb_page_size_bytes);
CBHandle cb_src0_workers = CreateCircularBuffer(program, sender_worker_core_range, cb_src0_config);
tt::tt_metal::CBHandle cb_src0_workers =
tt::tt_metal::CreateCircularBuffer(program, sender_worker_core_range, cb_src0_config);
// Set aside a buffer we can use for storing packet headers in (particularly for atomic incs)
const auto reserved_packet_header_CB_index = tt::CBIndex::c_3;
static constexpr auto num_packet_headers_storable = 8;
Expand All @@ -132,7 +133,7 @@ tt::tt_metal::operation::ProgramWithCallbacks all_reduce_async_minimal_multi_cor
{{reserved_packet_header_CB_index, tt::DataFormat::RawUInt32}})
.set_page_size(reserved_packet_header_CB_index, packet_header_size_bytes);
auto reserved_packet_header_CB_handle =
CreateCircularBuffer(program, sender_worker_core_range, cb_reserved_packet_header_config);
tt::tt_metal::CreateCircularBuffer(program, sender_worker_core_range, cb_reserved_packet_header_config);

// Reduction kernel setup
auto all_cores = output_tensor_cores.merge(sender_worker_core_range);
Expand Down Expand Up @@ -282,8 +283,8 @@ tt::tt_metal::operation::ProgramWithCallbacks all_reduce_async_minimal_multi_cor
tt::tt_metal::SetRuntimeArgs(program, reduction_kernel_id, output_tensor_cores, reduction_kernel_rt_args);

// KERNEL CREATION
tt::tt_metal::NOC reader_noc = NOC::NOC_1;
tt::tt_metal::NOC writer_noc = NOC::NOC_0;
tt::tt_metal::NOC reader_noc = tt::tt_metal::NOC::NOC_1;
tt::tt_metal::NOC writer_noc = tt::tt_metal::NOC::NOC_0;
// Reader
std::vector<uint32_t> reader_compile_args = {
ring_index, // my_chip_id
Expand All @@ -296,7 +297,7 @@ tt::tt_metal::operation::ProgramWithCallbacks all_reduce_async_minimal_multi_cor
"ttnn/cpp/ttnn/operations/experimental/ccl/all_reduce_async/device/kernels/dataflow/"
"worker_reader.cpp",
sender_worker_core_range,
DataMovementConfig{
tt::tt_metal::DataMovementConfig{
.processor = DataMovementProcessor::RISCV_1, .noc = reader_noc, .compile_args = reader_compile_args});

// Writer
Expand All @@ -316,7 +317,7 @@ tt::tt_metal::operation::ProgramWithCallbacks all_reduce_async_minimal_multi_cor
"ttnn/cpp/ttnn/operations/experimental/ccl/all_reduce_async/device/kernels/dataflow/"
"worker_writer.cpp",
sender_worker_core_range,
DataMovementConfig{
tt::tt_metal::DataMovementConfig{
.processor = DataMovementProcessor::RISCV_0, .noc = writer_noc, .compile_args = writer_compile_args});

// Kernel Runtime Args
Expand Down Expand Up @@ -388,7 +389,7 @@ tt::tt_metal::operation::ProgramWithCallbacks all_reduce_async_minimal_multi_cor
if (mcast_range_contains_self) {
num_mcast_cores -= 1;
}
if (writer_noc == NOC::NOC_1) {
if (writer_noc == tt::tt_metal::NOC::NOC_1) {
std::swap(start_core, end_core);
}
mcast_start_x.push_back(start_core.x);
Expand Down

0 comments on commit 57140de

Please sign in to comment.