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

[XeTileBlocking] Remove old implementation #985

Merged
merged 1 commit into from
Dec 16, 2024
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
5 changes: 1 addition & 4 deletions include/imex/Dialect/XeTile/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ def XeTileBlocking : Pass<"xetile-blocking", "::mlir::gpu::GPUModuleOp">{
let options = [
Option<"device", "device", "std::string",
/*default=*/"\"pvc\"",
"gpu platform architecture where these ops are running">,
Option<"EnableTransform", "enable-2d-transform", "bool",
/*default=*/"false",
"Using 2D transform or 4D Conversion.">
"gpu platform architecture where these ops are running">
];
}

Expand Down
1,305 changes: 170 additions & 1,135 deletions lib/Dialect/XeTile/Transforms/Blocking.cpp

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions lib/Dialect/XeTile/Transforms/BlockingAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "imex/Dialect/XeTile/Transforms/BlockingAnalysis.h"

extern bool Enable2DBlockingTransform;

namespace llvm {
using imex::Block;
// Implementation of llvm::DenseMapInfo for Block, required for
Expand Down Expand Up @@ -741,7 +739,7 @@ void BlockingAnalysisImpl::visitCreateMaskOp(

auto lattice = results[0]->getValue();

if (Enable2DBlockingTransform && !op->use_empty() && !lattice.isInitialized())
if (!op->use_empty() && !lattice.isInitialized())
return;

BlockingRequests &def = getLatticeElement(op->getResult(0))->getValue();
Expand All @@ -752,11 +750,9 @@ void BlockingAnalysisImpl::visitCreateMaskOp(

// TODO: need to enable the following code after 2D lowering in
// GPUToSPIRV is enabled.
// if (Enable2DBlockingTransform) {
// for (auto &req : lattice.getRequests()) {
// block[0] = std::max(block[0], req[0]);
// block[1] = std::min(block[1], req[1]);
// }
// for (auto &req : lattice.getRequests()) {
// block[0] = std::max(block[0], req[0]);
// block[1] = std::min(block[1], req[1]);
// }
def.updateDefBlock(block);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/gemm_preop.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" --cse \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking --cse \
// RUN: --convert-xetile-to-xegpu --cse %s -verify-diagnostics -o -| FileCheck %s
#map = affine_map<() -> (0)>
#map1 = affine_map<() -> (64)>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" --canonicalize \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking --canonicalize \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -o -| FileCheck %s
// CHECK-LABEL: gpu.module @test_kernel {
gpu.module @test_kernel {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" --canonicalize \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking --canonicalize \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -o -| FileCheck %s


Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/sg_init_tile.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -verify-diagnostics -o -| FileCheck %s

gpu.module @test_kernel {
Expand Down
3 changes: 1 addition & 2 deletions test/Conversion/XeTileToXeGPU/sg_load_tile.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -verify-diagnostics -o -| FileCheck %s

gpu.module @test_kernel {
//CHECK: gpu.func @sg_load_tile(%[[arg0:.*]]: memref<1024x1024xf16>, %[[arg1:.*]]: memref<1024x1024xf16>, %[[arg2:.*]]: memref<1024x1024xf32>) {
gpu.func @sg_load_tile(%a: memref<1024x1024xf16>, %b: memref<1024x1024xf16>, %c: memref<1024x1024xf32>) {
Expand Down
4 changes: 1 addition & 3 deletions test/Conversion/XeTileToXeGPU/sg_mixed_scf.mlir
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse --canonicalize %s -verify-diagnostics -o -| FileCheck %s
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: --cse --convert-xetile-to-xegpu="enable-2d-transform=true" --cse --canonicalize %s -verify-diagnostics -o -| FileCheck %s

//CHECK-LABEL: gpu.module @postop_reduce_m
gpu.module @postop_reduce_m attributes {spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Addresses, Float16Buffer, Int64, Int16, Int8, Bfloat16ConversionINTEL, Kernel, Linkage, Vector16, GenericPointer, Groups, Float16, Float64, AtomicFloat32AddEXT, ExpectAssumeKHR, VectorAnyINTEL], [SPV_INTEL_bfloat16_conversion, SPV_EXT_shader_atomic_float_add, SPV_KHR_expect_assume, SPV_INTEL_vector_compute]>, api=OpenCL, #spirv.resource_limits<>>} {
Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/sg_scattered_ops.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse --canonicalize --cse %s -verify-diagnostics -o -| FileCheck %s

gpu.module @test {
Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/sg_scf_for.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -verify-diagnostics -o -| FileCheck %s
gpu.module @test_kernel {
//CHECK: gpu.func @sglevel_tiled_gemm(%[[arg0:.*]]: memref<1024x1024xf16>, %[[arg1:.*]]: memref<1024x1024xf16>)
Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/sg_softmax.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -verify-diagnostics -o -| FileCheck %s
gpu.module @test_kernel {
//CHECK-LABEL: @sglevel_softmax_dim_0
Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/sg_store_tile.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -verify-diagnostics -o -| FileCheck %s

gpu.module @test_kernel {
Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/sg_tile_mma.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-init-duplicate --xetile-blocking \
// RUN: --convert-xetile-to-xegpu %s -verify-diagnostics -o -| FileCheck %s
gpu.module @test_kernel {
//CHECK: s_tiled_gemm(%[[arg0:.*]]: memref<1024x1024xf16>, %[[arg1:.*]]: memref<1024x1024xf16>)
Expand Down
60 changes: 0 additions & 60 deletions test/Conversion/XeTileToXeGPU/test_blocking.mlir

This file was deleted.

2 changes: 1 addition & 1 deletion test/Conversion/XeTileToXeGPU/test_order.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: imex-opt --split-input-file --xetile-canonicalization --xetile-blocking="enable-2d-transform=true" \
// RUN: imex-opt --split-input-file --xetile-canonicalization --xetile-blocking \
// RUN: --cse --convert-xetile-to-xegpu --cse %s -verify-diagnostics -o -| FileCheck %s

// CHECK-LABEL: @test_func
Expand Down
Loading
Loading