Skip to content

Commit

Permalink
Revert adding string attribute for the transform strategy name. (iree…
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRaoux authored Nov 18, 2022
1 parent 20048f7 commit 8aa999d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 22 deletions.
9 changes: 4 additions & 5 deletions compiler/src/iree/compiler/Codegen/Dialect/LoweringConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ namespace Codegen {

TranslationInfoAttr TranslationInfoAttr::get(
MLIRContext *context, DispatchLoweringPassPipeline passPipeline,
unsigned softwarePipelineDepth, StringAttr strategyName) {
unsigned softwarePipelineDepth) {
auto pipelineAttr =
DispatchLoweringPassPipelineAttr::get(context, passPipeline);
return get(context, pipelineAttr, softwarePipelineDepth, strategyName);
return get(context, pipelineAttr, softwarePipelineDepth);
}

DispatchLoweringPassPipeline
Expand All @@ -89,7 +89,7 @@ TranslationInfoAttr::getDispatchLoweringPassPipeline() {
LogicalResult TranslationInfoAttr::verify(
function_ref<InFlightDiagnostic()> emitError,
IREE::Codegen::DispatchLoweringPassPipelineAttr passPipeline,
unsigned softwarePipelineDepth, StringAttr strategyName) {
unsigned softwarePipelineDepth) {
if (!passPipeline) {
return emitError() << "missing pass pipeline specification";
}
Expand Down Expand Up @@ -212,8 +212,7 @@ LogicalResult CompilationInfoAttr::verify(
}
if (failed(TranslationInfoAttr::verify(
emitError, translationInfo.getPassPipeline(),
translationInfo.getSoftwarePipelineDepth(),
translationInfo.getTransfromStrategyName()))) {
translationInfo.getSoftwarePipelineDepth()))) {
return failure();
}
if (workgroupSize) {
Expand Down
7 changes: 2 additions & 5 deletions compiler/src/iree/compiler/Codegen/Dialect/LoweringConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,12 @@ void setLoweringConfig(Operation *op, IREE::Codegen::LoweringConfigAttr config);
inline LogicalResult setOpConfigAndEntryPointFnTranslation(
func::FuncOp entryPointFn, Operation *op, TileSizesListTypeRef tileSizes,
IREE::Codegen::DispatchLoweringPassPipeline passPipeline,
ArrayRef<int64_t> workgroupSize = {}, unsigned softwarePipelineDepth = 0,
Optional<StringRef> startegyName = llvm::None) {
ArrayRef<int64_t> workgroupSize = {}, unsigned softwarePipelineDepth = 0) {
MLIRContext *context = entryPointFn.getContext();
auto config = IREE::Codegen::LoweringConfigAttr::get(context, tileSizes);
setLoweringConfig(op, config);
auto translationInfo = IREE::Codegen::TranslationInfoAttr::get(
entryPointFn->getContext(), passPipeline, softwarePipelineDepth,
startegyName ? StringAttr::get(op->getContext(), *startegyName)
: StringAttr());
entryPointFn->getContext(), passPipeline, softwarePipelineDepth);
setTranslationInfo(entryPointFn, translationInfo, workgroupSize);
return success();
}
Expand Down
10 changes: 3 additions & 7 deletions compiler/src/iree/compiler/Codegen/Dialect/LoweringConfig.td
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,18 @@ def IREECodegen_TranslationInfoAttr :

let assemblyFormat = [{
`<` `` $passPipeline
(`pipeline_depth` `=` $softwarePipelineDepth^)?
(`transform_name` `=` $transfromStrategyName^)? `>`
(`pipeline_depth` `=` $softwarePipelineDepth^)? `>`
}];

let parameters = (ins
AttrParameter<"IREE::Codegen::DispatchLoweringPassPipelineAttr",
"Name of the pipeline to be invoked on the translation unit.">:$passPipeline,
OptionalParameter<"unsigned",
"The software pipeline depth to be used">:$softwarePipelineDepth,
OptionalParameter<"StringAttr",
"Name of the transform startegy to apply">:$transfromStrategyName
"The software pipeline depth to be used">:$softwarePipelineDepth
);
let builders = [
AttrBuilder<(ins "DispatchLoweringPassPipeline":$passPipeline,
CArg<"unsigned", "0">:$softwarePipelineDepth,
CArg<"StringAttr", "StringAttr()">:$transfromStrategyName)>
CArg<"unsigned", "0">:$softwarePipelineDepth)>
];
let extraClassDeclaration = [{
// Returns the lowering pass pipeline set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#define DEBUG_TYPE "kernel-dispatch"
#define KD_DBGS() (llvm::dbgs() << '[' << DEBUG_TYPE << "] ")

static constexpr llvm::StringLiteral kReductionStrategyName =
"reduction_strategy";
namespace mlir {
namespace iree_compiler {

Expand Down Expand Up @@ -1236,7 +1234,7 @@ static LogicalResult setTransformStrategyRootConfig(
entryPointFn, genericOp, tileSizes,
IREE::Codegen::DispatchLoweringPassPipeline::
TransformDialectJitterCodegen,
workgroupSize, 0, kReductionStrategyName);
workgroupSize);
}

/// Sets the lowering configuration for a generic op implementing a
Expand Down
3 changes: 1 addition & 2 deletions compiler/src/iree/compiler/Codegen/LLVMGPU/KernelConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ using namespace mlir::iree_compiler;

static constexpr unsigned cudaWarpSize = 32;
static constexpr StringLiteral kCudaTarget = "cuda";
static constexpr StringLiteral kReductionStrategyName = "reduction_strategy";
namespace mlir {
namespace iree_compiler {
llvm::cl::opt<std::string> clGPUCodegenTransformDialectFileName(
Expand Down Expand Up @@ -514,7 +513,7 @@ static LogicalResult setReductionTransformJitConfig(func::FuncOp entryPoint,
entryPoint, op, tileSizes,
IREE::Codegen::DispatchLoweringPassPipeline::
TransformDialectJitterCodegen,
workgroupSize, 0, kReductionStrategyName);
workgroupSize);
return success();
}

Expand Down

0 comments on commit 8aa999d

Please sign in to comment.