Skip to content

Commit

Permalink
basic solution
Browse files Browse the repository at this point in the history
  • Loading branch information
newling committed Aug 22, 2024
1 parent 57cd0bc commit 65c1b84
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ void AMDAIETileAndFusePass::runOnOperation() {
options.setLoopType(scf::SCFTilingOptions::LoopType::ForallOp);
// Here we assume there are always two levels of parallel (scf.forall)
// loops, and the first level of tiling is always using scf.forall and
// mapped to blocks. Currently we are not using mapping attributes for
// Conv2d ops, because there could be four parallel tiling dimensions.
// TODO (vivian): create AIE specific mapping attributes.
// mapped to blocks. TODO (vivian): create AIE specific mapping attributes.
if (!isa<linalg::ConvolutionOpInterface>(consumerOp.getOperation())) {
if (tilingLevel == 0) {
options.setMapping(
Expand All @@ -177,7 +175,22 @@ void AMDAIETileAndFusePass::runOnOperation() {
{gpu::GPUThreadMappingAttr::get(context, gpu::MappingId::DimY),
gpu::GPUThreadMappingAttr::get(context, gpu::MappingId::DimX)});
}
} else {
if (tilingLevel == 1) {
options.setMapping({
gpu::GPUThreadMappingAttr::get(context, gpu::MappingId::DimY),
gpu::GPUThreadMappingAttr::get(context, gpu::MappingId::DimX),
gpu::GPUThreadMappingAttr::get(context, gpu::MappingId::DimZ),
gpu::GPUThreadMappingAttr::get(context, gpu::MappingId::LinearDim0),
});
} else {
// TODO(newling) GPU block mapping attribute for convolution.
// AT the moment, this mapping isn't used, just gets temporally
// unrolled anyway.
}
}
// TODO(vivan/newling) More sustainable way of partitioning ops...
// "ConvolutionOpInterface" vs "everything else" doesn't seem good!
}

IRRewriter rewriter(context);
Expand Down

0 comments on commit 65c1b84

Please sign in to comment.