tilelang.carver.common_schedules¶

Common schedule strategies for TIR.

Functions¶

get_block(sch, blocks, name)

Get the target block from a schedule.

get_output_blocks(sch, blocks)

Get the output blocks of a schedule.

try_inline(sch, blocks)

Try to inline as many blocks as possible, and return the remaining blocks.

try_inline_contiguous_spatial(sch, block_infos)

Try to inline contiguous spatial blocks in a schedule

Module Contents¶

tilelang.carver.common_schedules.get_block(sch, blocks, name)¶

Get the target block from a schedule.

Parameters:
  • sch (tir.Schedule) – The TIR schedule used to get target block.

  • name (str) – The name of the target block.

  • blocks (List[tilelang.carver.analysis.BlockInfo])

Returns:

target_block – The target block.

Return type:

BlockRV

tilelang.carver.common_schedules.get_output_blocks(sch, blocks)¶

Get the output blocks of a schedule.

Parameters:
  • sch (tir.Schedule) – The TIR schedule used to get output blocks.

  • blocks (List[BlockInfo]) – The blocks to be analyzed.

Returns:

output_blocks – The output blocks.

Return type:

List[BlockInfo]

tilelang.carver.common_schedules.try_inline(sch, blocks)¶

Try to inline as many blocks as possible, and return the remaining blocks.

Parameters:
  • sch (tir.Schedule) – The TIR schedule used to inline blocks.

  • blocks (List[BlockInfo]) – The blocks to be inlined.

Returns:

remaining – The remaining blocks that cannot be inlined.

Return type:

List[BlockInfo]

tilelang.carver.common_schedules.try_inline_contiguous_spatial(sch, block_infos)¶

Try to inline contiguous spatial blocks in a schedule

Parameters:
  • sch (tir.Schedule) – The TIR schedule used to inline blocks.

  • block_infos (List[BlockInfo]) – The blocks to be try.

Returns:

remaining – The remaining blocks that cannot be inlined.

Return type:

List[BlockInfo]