From c5083422cdbc3263af87da9b7a3b95b1c2125321 Mon Sep 17 00:00:00 2001 From: erman-gurses Date: Wed, 5 Feb 2025 14:46:03 -0600 Subject: [PATCH] Debug on CI Signed-off-by: erman-gurses --- .../LLVMGPU/LLVMGPUSelectLoweringStrategy.cpp | 2 +- .../compiler/Codegen/LLVMGPU/Verifiers.cpp | 66 ++++++++++--------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUSelectLoweringStrategy.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUSelectLoweringStrategy.cpp index e4632e64bfa0..5a18c3188c51 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUSelectLoweringStrategy.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUSelectLoweringStrategy.cpp @@ -48,7 +48,7 @@ verifyLoweringConfiguration(FunctionOpInterface funcOp, auto codegenLoweringConfig = getLoweringConfig(op); auto gpuLoweringConfig = - getLoweringConfig(op); + dyn_cast_or_null(getLoweringConfig(op)); if (!codegenLoweringConfig && !gpuLoweringConfig) return WalkResult::advance(); return verificationFn(op, codegenLoweringConfig, translationInfo, diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/Verifiers.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/Verifiers.cpp index 2d776dbeabd6..2dbbf3aac632 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/Verifiers.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/Verifiers.cpp @@ -80,51 +80,53 @@ verifyGPUMatmulPipeline(Operation *op, if (pipeline != CodeGenPipeline::LLVMGPUMatmulTensorCore && pipeline != CodeGenPipeline::LLVMGPUMatmulTensorCoreMmaSync && - pipeline != CodeGenPipeline::LLVMGPUTileAndFuse && pipeline != CodeGenPipeline::LLVMGPUVectorDistribute) { return success(); } + // Only verify batched and unbatched matmul. + if (!isa(op)) { + return success(); + } + uint32_t reduction = static_cast(IREE::GPU::TilingLevel::Reduction); uint numLoops = llvm::cast(op).getNumLoops(); - + size_t size = numLoops; + numLoops = reduction; + size = size + 0; SmallVector reductionTileSizes = gpuLoweringConfig.getStaticTilingLevelSizes(reduction, op); - size_t size = reductionTileSizes.size(); + + if (!reductionTileSizes.empty()) { + size = reductionTileSizes.size(); + } + // if (size > numLoops) { // return op->emitOpError("expected number of reduction tile size is equal - // or " - // "less than number of loops"); + // or less than number of loops"); + // } + // for (size_t i = 0; i < size; ++i) { + // if (reductionTileSizes[i] > 0 && + // llvm::cast(op).getIteratorTypesArray()[i] != + // utils::IteratorType::reduction) { + // return op->emitOpError( + // "expected to non-zero reduction tile has reduction iterator"); + // } // } - for (size_t i = 0; i < size; ++i) { - if (reductionTileSizes[i] > 0 && - llvm::cast(op).getIteratorTypesArray()[i] != - utils::IteratorType::reduction) { - return op->emitOpError( - "expected to non-zero reduction tile has reduction iterator"); - } - } - - SmallVector workgroupTileSizes = - gpuLoweringConfig.getWorkgroupTileSizes(); - size = workgroupTileSizes.size(); - - for (size_t i = 0; i < size; ++i) { - if (workgroupTileSizes[i] > 0 && - llvm::cast(op).getIteratorTypesArray()[i] != - utils::IteratorType::parallel) { - return op->emitOpError( - "expected to non-zero workgroup tile has parallel iterator"); - } - } - if (pipeline == CodeGenPipeline::LLVMGPUTileAndFuse || - pipeline == CodeGenPipeline::LLVMGPUVectorDistribute) { - return success(); - } + // SmallVector workgroupTileSizes = + // gpuLoweringConfig.getWorkgroupTileSizes(); + // size = workgroupTileSizes.size(); + // if (size) { + // for (size_t i = 0; i < size; ++i) { + // if (workgroupTileSizes[i] > 0 && + // llvm::cast(op).getIteratorTypesArray()[i] != + // utils::IteratorType::parallel) { + // return op->emitOpError( + // "expected to non-zero workgroup tile has parallel iterator"); + // } - // Only verify batched and unbatched matmul. - if (!isa(op)) { + if (pipeline == CodeGenPipeline::LLVMGPUVectorDistribute) { return success(); }