Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions lighthouse/dialects/transform/transform_ext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from .ops.filter_reduction_ops import filter_reduction_ops
from .ops.get_leading_unit_tile_sizes import get_leading_unit_tile_sizes
from .ops.move_offsets_to_subview import move_offsets_to_subview
from .ops.fold_singleton_extract_slice import fold_singleton_extract_slice
from .ops.clear_tile_and_fuse_annotations import clear_tile_and_fuse_annotations
from .ops.get_fusion_roots import get_fusion_roots
from .ops.propagate_tile_sizes import propagate_tile_sizes
Expand All @@ -36,7 +35,6 @@
"filter_elementwise",
"filter_num_loops",
"filter_reduction_ops",
"fold_singleton_extract_slice",
"get_fusion_roots",
"get_leading_unit_tile_sizes",
"get_named_attribute",
Expand Down

This file was deleted.

10 changes: 8 additions & 2 deletions lighthouse/schedule/xegpu/fused_attention_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from mlir import ir
from mlir.dialects import transform
from mlir.dialects.transform import structured, xegpu
from mlir.dialects.transform import structured, xegpu, tensor
import lighthouse.transform as lh_transform
from lighthouse.pipeline.helper import (
apply_registered_pass,
Expand Down Expand Up @@ -152,8 +152,14 @@ def bundle_xegpu_fused_attention_schedule(

# Normalize possible singleton dimensions so tile+fuse logic works.
with ir.InsertionPoint(transform.apply_patterns(func).patterns):
# fold unit dims in linalg.generic op inputs
structured.apply_patterns_linalg_fold_unit_extent_dims_via_slices()
transform_ext.fold_singleton_extract_slice(func)
# fold tensor.extract_slice(tensor.expand_shape(x)) into x
tensor.apply_patterns_tensor_reassociative_reshape_folding()
# swap tensor.extract_slice(linalg.fill(...)) ops
structured.apply_patterns_linalg_swap_extract_slice_with_fill()
# fold tensor.extract_slice(tensor.empty(...)) into tensor.tensor_empty(...)
tensor.apply_patterns_tensor_fold_tensor_empty(fold_single_use_only=True)
lh_transform.cleanup(func)

# Fuse elementwise ops, also removes unused linalg op results (if any).
Expand Down
10 changes: 8 additions & 2 deletions lighthouse/schedule/xegpu/reduction_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from mlir import ir
from mlir.dialects import transform
from mlir.dialects.transform import structured, xegpu
from mlir.dialects.transform import structured, xegpu, tensor
import lighthouse.transform as lh_transform
from .lowering_common import (
get_payload_func,
Expand Down Expand Up @@ -114,8 +114,14 @@ def bundle_xegpu_reduction_schedule(

# Normalize possible singleton dimensions so tile+fuse logic works.
with ir.InsertionPoint(transform.apply_patterns(func).patterns):
# fold unit dims in linalg.generic op inputs
structured.apply_patterns_linalg_fold_unit_extent_dims_via_slices()
transform_ext.fold_singleton_extract_slice(func)
# fold tensor.extract_slice(tensor.expand_shape(x)) into x
tensor.apply_patterns_tensor_reassociative_reshape_folding()
# swap tensor.extract_slice(linalg.fill(...)) ops
structured.apply_patterns_linalg_swap_extract_slice_with_fill()
# fold tensor.extract_slice(tensor.empty(...)) into tensor.tensor_empty(...)
tensor.apply_patterns_tensor_fold_tensor_empty(fold_single_use_only=True)
lh_transform.cleanup(func)

# Fuse elementwise ops, also removes unused linalg op results (if any).
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "lighthouse"
dynamic = ["version"]
requires-python = ">=3.10,<3.13" # Bounds are due to torch-mlir's packaging
dependencies = [
"mlir-python-bindings==20260820+002905df0",
"mlir-python-bindings==20260826+6c81b990d",
"pyyaml>=6.0",
]

Expand Down
Loading