Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions flash_attn/cute/tile_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,11 @@ def __new_from_mlir_values__(self, values):
for obj, n_items in zip([self.params, self._blk_coord], self._values_pos):
obj_list.append(cutlass.new_from_mlir_values(obj, values[:n_items]))
values = values[n_items:]
return SingleTileScheduler(*(tuple(obj_list)), loc=self._loc)
scheduler = SingleTileScheduler(*(tuple(obj_list)), loc=self._loc)
# Note: _is_first_block is a Python-only attribute omitted from MLIR values,
# so it must be restored explicitly after reconstruction.
scheduler._is_first_block = self._is_first_block
return scheduler


class StaticPersistentTileScheduler:
Expand Down Expand Up @@ -1385,7 +1389,10 @@ def __new_from_mlir_values__(self, values):
for obj, n_items in zip(objs, self._values_pos):
obj_list.append(cutlass.new_from_mlir_values(obj, values[:n_items]))
values = values[n_items:]
return self.__class__(*obj_list, loc=self._loc)
scheduler = self.__class__(*obj_list, loc=self._loc)
# See the note on Python-only attributes in SingleTileScheduler.
scheduler._is_first_block = self._is_first_block
return scheduler


class DynamicPersistentVarlenScheduler:
Expand Down Expand Up @@ -1827,9 +1834,12 @@ def __new_from_mlir_values__(self, values):
)
new_blk_coord = new_from_mlir_values(self._blk_coord, values[4:7])
new_grid_shape = new_from_mlir_values(self._grid_shape, values[7:])
return Sm100FmhaStaticTileScheduler(
scheduler = Sm100FmhaStaticTileScheduler(
new_params, new_current_work_linear_idx, new_blk_coord, new_grid_shape
)
# See the note on Python-only attributes in SingleTileScheduler.
scheduler._is_first_block = self._is_first_block
return scheduler


def compute_sm100_fmha_grid(
Expand Down