Skip to content
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

[intel] Remove RewriteTensorPointer pass #2359

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
8 changes: 6 additions & 2 deletions python/test/unit/language/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4284,8 +4284,12 @@ def kernel(in_base_ptr, out_base_ptr, IN_SHAPE0: tl.constexpr, IN_SHAPE1: tl.con
actual = torch.zeros(expected.shape, dtype=torch.int32, device=device)

k = kernel[(1, )](input, actual, shape[0], shape[1])
assert k.asm['ttgir'].count(
'triton_gpu.convert_layout') == 1, "Expected exactly one convert_layout op in the TTGIR after optimization"
if is_xpu():
assert k.asm['ttgir'].count(
'triton_gpu.convert_layout') == 0, "Expected no convert_layout op in the TTGIR after optimization"
else:
assert k.asm['ttgir'].count(
'triton_gpu.convert_layout') == 1, "Expected exactly one convert_layout op in the TTGIR after optimization"

np.testing.assert_equal(to_numpy(expected), to_numpy(actual))

Expand Down
276 changes: 0 additions & 276 deletions test/TritonIntelGPU/rewrite-tensor-pointer.mlir

This file was deleted.

1 change: 0 additions & 1 deletion third_party/intel/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ def make_ttgir(mod, metadata, opt, properties):
intel.passes.ttgpuir.add_accelerate_matmul(pm)
intel.passes.ttgpuir.add_remove_layout_conversions(pm)
intel.passes.ttgpuir.add_materialize_block_pointer(pm)
intel.passes.ttgpuir.add_rewrite_tensor_pointer(pm)
intel.passes.ttgpuir.add_pipeline(pm, opt.num_stages, False)

passes.ttgpuir.add_coalesce(pm)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,6 @@ def TritonIntelGPURemoveLayoutConversions : Pass<"tritonintelgpu-remove-layout-c

}

def TritonIntelGPURewriteTensorPointer : Pass<"tritonintelgpu-rewrite-tensor-pointer", "mlir::ModuleOp"> {
let summary = "Rewrite load/store operations using tensor pointers that cannot be lowered to 2D Block Load/Store intrinsics";
let description = [{
This pass determines whether a load/store operation can be lowered to 2D
Block Load/Store intrinsic. If it cannot, it replaces the load/store
operation with a legacy pointer and removes the Triton operations that
create and advance the block pointer (that is `tt.make_tensor_tr` and
`tt.advance`).
}];

let dependentDialects = ["mlir::triton::TritonDialect"];
}

def TritonIntelGPUPrefetchBlock : Pass<"tritonintelgpu-prefetch-block", "mlir::ModuleOp"> {
let summary = "Prefetch a tensor block around loop";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_triton_library(TritonIntelGPUTransforms
PrefetchBlock.cpp
ReduceDataDuplication.cpp
RemoveLayoutConversions.cpp
RewriteTensorPointer.cpp
ScheduleLoad.cpp
Utility.cpp

Expand Down
Loading