Skip to content

Commit

Permalink
Debug on CI
Browse files Browse the repository at this point in the history
Signed-off-by: erman-gurses <[email protected]>
  • Loading branch information
erman-gurses committed Feb 12, 2025
1 parent ab768c6 commit dd410e5
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions compiler/src/iree/compiler/Codegen/LLVMGPU/Verifiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,51 +80,54 @@ 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<linalg::MatmulOp, linalg::BatchMatmulOp>(op)) {
return success();
}

uint32_t reduction = static_cast<uint32_t>(IREE::GPU::TilingLevel::Reduction);
uint numLoops = llvm::cast<linalg::LinalgOp>(op).getNumLoops();
uint numLoops = llvm::cast<linalg::MatmulOp>(op).getNumLoops();
size_t size = 0;

SmallVector<int64_t> reductionTileSizes =
gpuLoweringConfig.getStaticTilingLevelSizes(reduction, op);
size_t size = reductionTileSizes.size();
// if (size > numLoops) {
// return op->emitOpError("expected number of reduction tile size is equal
// or "
// "less than number of loops");
// }

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");
}
for (size_t i = 0; i < size; ++i) {
if (reductionTileSizes[i] > 0 &&
llvm::cast<linalg::LinalgOp>(op).getIteratorTypesArray()[i] !=
llvm::cast<linalg::MatmulOp>(op).getIteratorTypesArray()[i] !=
utils::IteratorType::reduction) {
return op->emitOpError(
"expected to non-zero reduction tile has reduction iterator");
}
}

SmallVector<int64_t> workgroupTileSizes =
gpuLoweringConfig.getWorkgroupTileSizes();
size = workgroupTileSizes.size();
// SmallVector<int64_t> workgroupTileSizes =
// gpuLoweringConfig.getWorkgroupTileSizes();
// size = workgroupTileSizes.size();

for (size_t i = 0; i < size; ++i) {
if (workgroupTileSizes[i] > 0 &&
llvm::cast<linalg::LinalgOp>(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();
}
// for (size_t i = 0; i < size; ++i) {
// if (workgroupTileSizes[i] > 0 &&
// llvm::cast<linalg::MatmulOp>(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<linalg::MatmulOp, linalg::BatchMatmulOp>(op)) {
if (pipeline == CodeGenPipeline::LLVMGPUVectorDistribute) {
return success();
}

Expand Down

0 comments on commit dd410e5

Please sign in to comment.