For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
pack_filter_lt
def pack_filter_lt[simd_size: Int, micro_kernel_f_size: Int](filter: LayoutTensor[address_space=filter.address_space, element_layout=filter.element_layout, layout_int_type=filter.layout_int_type, linear_idx_type=filter.linear_idx_type, masked=filter.masked, alignment=filter.alignment], packed_filter: LayoutTensor[address_space=packed_filter.address_space, element_layout=packed_filter.element_layout, layout_int_type=packed_filter.layout_int_type, linear_idx_type=packed_filter.linear_idx_type, masked=packed_filter.masked, alignment=packed_filter.alignment], num_groups: Int)
This packs the filter form RSCF to FRSCf.
F is first broken down to segments of size micro_kernel_f_size, then the remainder is further divided by simd_size. The last residual elements if any is padded with zero to fill simd_size.
Parameters:
- βsimd_size (
Int): Can differ from the simd size of the input type. - βmicro_kernel_f_size (
Int): The size of the last dimension in FRSCf, which is equals the size of the micro kernel's F dimension.
Args:
- βfilter (
LayoutTensor[address_space=filter.address_space, element_layout=filter.element_layout, layout_int_type=filter.layout_int_type, linear_idx_type=filter.linear_idx_type, masked=filter.masked, alignment=filter.alignment]): Filter in RSCF layout (if 2D). - βpacked_filter (
LayoutTensor[address_space=packed_filter.address_space, element_layout=packed_filter.element_layout, layout_int_type=packed_filter.layout_int_type, linear_idx_type=packed_filter.linear_idx_type, masked=packed_filter.masked, alignment=packed_filter.alignment]): Packed filter in FRSCf layout (if 2D). F - the index of continuous segments in micro kernel. R, S, C - original R, S, C. f - the index within a continuous segments. - βnum_groups (
Int): The number of groups in the convolution.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!