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 16, 2025
1 parent ab768c6 commit c508342
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ verifyLoweringConfiguration(FunctionOpInterface funcOp,
auto codegenLoweringConfig =
getLoweringConfig<IREE::Codegen::LoweringConfigAttr>(op);
auto gpuLoweringConfig =
getLoweringConfig<IREE::GPU::LoweringConfigAttr>(op);
dyn_cast_or_null<IREE::GPU::LoweringConfigAttr>(getLoweringConfig(op));
if (!codegenLoweringConfig && !gpuLoweringConfig)
return WalkResult::advance();
return verificationFn(op, codegenLoweringConfig, translationInfo,
Expand Down
66 changes: 34 additions & 32 deletions compiler/src/iree/compiler/Codegen/LLVMGPU/Verifiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<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();

size_t size = numLoops;
numLoops = reduction;
size = size + 0;
SmallVector<int64_t> 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<linalg::LinalgOp>(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<linalg::LinalgOp>(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();

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();
}
// SmallVector<int64_t> workgroupTileSizes =
// gpuLoweringConfig.getWorkgroupTileSizes();
// size = workgroupTileSizes.size();
// if (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");
// }

// 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 c508342

Please sign in to comment.