[Mlir-commits] [mlir] c30ea28 - [mlir][nvgpu] Add negative tests for warpgroup MMA accumulator ops (#202516)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jun 9 01:10:46 PDT 2026
Author: Vaisman
Date: 2026-06-09T10:10:41+02:00
New Revision: c30ea28015bf0c2899b485c3bf531d7c7e61f518
URL: https://github.com/llvm/llvm-project/commit/c30ea28015bf0c2899b485c3bf531d7c7e61f518
DIFF: https://github.com/llvm/llvm-project/commit/c30ea28015bf0c2899b485c3bf531d7c7e61f518.diff
LOG: [mlir][nvgpu] Add negative tests for warpgroup MMA accumulator ops (#202516)
Add verifier tests for warpgroup MMA accumulator initialization
and store operations.
The tests cover invalid accumulator shapes, unsupported non-f32
store results, and mismatched store destination shapes.
The verifier logic for these cases exists in
WarpgroupMmaInitAccumulatorOp::verify() and
WarpgroupMmaStoreOp::verify(), but lacked explicit negative test
coverage in invalid.mlir.
Added:
Modified:
mlir/test/Dialect/NVGPU/invalid.mlir
Removed:
################################################################################
diff --git a/mlir/test/Dialect/NVGPU/invalid.mlir b/mlir/test/Dialect/NVGPU/invalid.mlir
index f218d1527d976..0341a08a2c778 100644
--- a/mlir/test/Dialect/NVGPU/invalid.mlir
+++ b/mlir/test/Dialect/NVGPU/invalid.mlir
@@ -423,3 +423,45 @@ func.func @mma_sparse_sync_invalid_shape_4_elements(%arg0: vector<2x2xf16>, %arg
(vector<2x2xf16>, vector<2x2xf16>, vector<2x2xf16>) -> vector<2x2xf16>
return %d : vector<2x2xf16>
}
+
+// -----
+
+func.func @warpgroup_mma_init_accumulator_invalid_m() {
+ // expected-error @+1 {{does not fit into warp-group level}}
+ %acc = nvgpu.warpgroup.mma.init.accumulator
+ -> !nvgpu.warpgroup.accumulator<fragmented = vector<65x128xf32>>
+ return
+}
+
+// -----
+
+func.func @warpgroup_mma_init_accumulator_invalid_n() {
+ // expected-error @+1 {{does not fit into warp-group level}}
+ %acc = nvgpu.warpgroup.mma.init.accumulator
+ -> !nvgpu.warpgroup.accumulator<fragmented = vector<64x121xf32>>
+ return
+}
+
+// -----
+
+func.func @warpgroup_mma_store_non_f32_result(
+ %acc: !nvgpu.warpgroup.accumulator<fragmented = vector<64x128xf16>>,
+ %dst: memref<64x128xf16, 3>) {
+ // expected-error @+1 {{only f32 results for the time being}}
+ nvgpu.warpgroup.mma.store %acc, %dst :
+ !nvgpu.warpgroup.accumulator<fragmented = vector<64x128xf16>>
+ to memref<64x128xf16, 3>
+ return
+}
+
+// -----
+
+func.func @warpgroup_mma_store_mismatched_shape(
+ %acc: !nvgpu.warpgroup.accumulator<fragmented = vector<64x128xf32>>,
+ %dst: memref<64x64xf32, 3>) {
+ // expected-error @+1 {{does not have same size as results}}
+ nvgpu.warpgroup.mma.store %acc, %dst :
+ !nvgpu.warpgroup.accumulator<fragmented = vector<64x128xf32>>
+ to memref<64x64xf32, 3>
+ return
+}
More information about the Mlir-commits
mailing list