Skip to content

Commit ed71f09

Browse files
authored
[TritonGEN]: Use GenISA interface as there is correctness issue with SPV block store signature. (#4709)
[TritonGEN]: Use GenISA interface as there is correctness issue with SPV block store signature. --------- Signed-off-by: Lu,Chengjun <[email protected]>
1 parent ecc2a2d commit ed71f09

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

test/TritonGEN/tritongen-2Dblockstore-to-llvm.mlir

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ llvm.func @triton_gen.2Dblockstore(%ptr : !llvm.ptr<1>, %base_width : i32, %base
105105

106106
// -----
107107

108+
llvm.func @triton_gen.2Dblockstore(%ptr : !llvm.ptr<1>, %base_width : i32, %base_height : i32, %base_pitch : i32, %x : i32, %y : i32, %stored_val : vector<1xi16>) {
109+
// COM: threads-per-warp = 32 case.
110+
// CHECK: [[ELEM_BITS:%.*]] = llvm.mlir.constant(16 : i32) : i32
111+
// CHECK: [[TILE_WIDTH:%.*]] = llvm.mlir.constant(16 : i32) : i32
112+
// CHECK: [[TILE_HEIGHT:%.*]] = llvm.mlir.constant(2 : i32) : i32
113+
// CHECK: [[VBLOCKS:%.*]] = llvm.mlir.constant(1 : i32) : i32
114+
// CHECK: [[TRANSPOSE:%.*]] = llvm.mlir.constant(false) : i1
115+
// CHECK: [[VNNI:%.*]] = llvm.mlir.constant(false) : i1
116+
// CHECK: llvm.call spir_funccc @llvm.genx.GenISA.LSC2DBlockWrite.v1i16({{.*}}, {{.*}}, {{.*}}, {{.*}}, {{.*}}, [[ELEM_BITS]], [[TILE_WIDTH]], [[TILE_HEIGHT]], [[VBLOCKS]], [[TRANSPOSE]], [[VNNI]], {{.*}})
117+
triton_gen.2Dblockstore %ptr, %base_width, %base_height, %base_pitch, %x, %y, %stored_val {elem_size_in_bits=16, tile_width=16, tile_height=2, v_blocks=1, cache_control=Default} : (!llvm.ptr<1>, i32, i32, i32, i32, i32, vector<1xi16>)
118+
llvm.return
119+
}
120+
// -----
121+
108122
llvm.func @triton_gen.2Dblockstore(%ptr : !llvm.ptr<1>, %base_width : i32, %base_height : i32, %base_pitch : i32, %x : i32, %y : i32, %stored_val : vector<8xi16>) {
109123
// CHECK: [[ELEM_BITS:%.*]] = llvm.mlir.constant(16 : i32) : i32
110124
// CHECK: [[TILE_WIDTH:%.*]] = llvm.mlir.constant(8 : i32) : i32

third_party/intel/lib/TritonGENToLLVM/TritonGENToLLVMPass.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,18 @@ static bool isSPVBuiltinAvailable(TritonGEN::Matrix2DBlockStoreOp op) {
181181
op.getTileWidth() == 8 && op.getVBlocks() == 1)
182182
return false;
183183

184-
// FIXME: The following signature has correctness issue
184+
// FIXME: The following signatures have correctness issue with SPV interface.
185+
185186
// intel_sub_group_2d_block_write_8b_1r32x1c
186187
if (op.getElemSizeInBits() == 8 && op.getTileHeight() == 1 &&
187188
op.getTileWidth() == 32 && op.getVBlocks() == 1)
188189
return false;
189190

191+
// intel_sub_group_2d_block_write_16b_2r16x1c
192+
if (op.getElemSizeInBits() == 16 && op.getTileHeight() == 2 &&
193+
op.getTileWidth() == 16 && op.getVBlocks() == 1)
194+
return false;
195+
190196
return true;
191197
}
192198

0 commit comments

Comments
 (0)