-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#13609: Uplift dram and l1 allocators to use dram/l1 specific alignment #13762
base: main
Are you sure you want to change the base?
Conversation
@@ -1653,7 +1653,7 @@ operation::ProgramWithCallbacks pad_rm_sharded_width_only( | |||
|
|||
// FIXME: assumes that this was sharded using DRAM alignment so that gaps are left in the tensor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this comment be udpated as well?
@@ -63,7 +63,7 @@ uint32_t shard_size = shard_height * shard_width; | |||
uint32_t input_unit_size = sizeof(uint32_t); | |||
uint32_t shard_width_bytes = shard_width * data_size; | |||
uint32_t num_units_per_row = shard_width * input_unit_size; | |||
uint32_t padded_offset_bytes = align(input_unit_size, device->get_allocator_alignment()); | |||
uint32_t padded_offset_bytes = align(input_unit_size, device->get_allocator_alignment(BufferType::L1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to add more info about when you need or when the infra uses different alignments and why.
@@ -676,7 +676,7 @@ operation::ProgramWithCallbacks transpose_hc_multi_core( | |||
// TODO: noc_async_write only require 16B alignment for both DRAM and L1 for Blackhole, so instead of reading in | |||
// face-lines from C tiles to form a single tile, we can load a single tile and then write out its face-lines to C | |||
// tiles | |||
uint32_t alignment = dst_buffer->buffer_type() == tt::tt_metal::BufferType::DRAM ? DRAM_ALIGNMENT : L1_ALIGNMENT; | |||
uint32_t alignment = device->get_allocator_alignment(dst_buffer->buffer_type()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use dst_buffer->alignment()
instead
@@ -1653,7 +1653,7 @@ operation::ProgramWithCallbacks pad_rm_sharded_width_only( | |||
|
|||
// FIXME: assumes that this was sharded using DRAM alignment so that gaps are left in the tensor. | |||
// if this changes, we should change the stick step to be 16B (L1 alignment). | |||
auto dram_alignment_bytes = tt::tt_metal::hal.get_alignment(tt::tt_metal::HalMemType::DRAM); | |||
auto dram_alignment_bytes = tt::tt_metal::hal.get_alignment(tt::tt_metal::HalMemType::L1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be renamed to l1_alignment_bytes
?
tt_metal/hw/inc/dataflow_api.h
Outdated
@@ -921,9 +941,10 @@ struct InterleavedPow2AddrGen { | |||
const uint32_t bank_base_address; | |||
const uint32_t log_base_2_of_page_size; // WARNING: This struct is used for optimized get_noc_addr in which case | |||
// you know that bank_unit_size is a power of 2 | |||
const uint32_t aligned_log_base_2_of_page_size = this->log_base_2_of_page_size > LOG_BASE_2_OF_ALLOCATOR_ALIGNMENT | |||
const uint32_t log_base_2_of_allocator_alignment = interleaved_addr_gen::get_log_base2_of_allocator_alignment<DRAM>(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
tt_metal/hw/inc/dataflow_api.h
Outdated
@@ -1019,9 +1040,10 @@ template <bool DRAM> | |||
struct InterleavedPow2AddrGenFast { | |||
uint32_t bank_base_address; // Base address for the whole tensor. | |||
const uint32_t log_base_2_of_page_size; // Num bytes in bank unit. | |||
const uint32_t aligned_log_base_2_of_page_size = this->log_base_2_of_page_size > LOG_BASE_2_OF_ALLOCATOR_ALIGNMENT | |||
const uint32_t log_base_2_of_allocator_alignment = interleaved_addr_gen::get_log_base2_of_allocator_alignment<DRAM>(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Ticket
#13609
Problem description
Using the max of DRAM and L1 alignment for both DRAM and L1 buffers was causing pcc mismatches in i2s and s2i.
What's changed
Use L1/DRAM specific alignment for respective allocations. This will require some ops to be uplifted to handle re-alignment
@yugaoTT and @ntarafdar to add corresponding op changes
Checklist
Below post commits were triggered 12/03