Skip to content

Commit 8f31e38

Browse files
committed
update tuning.md and test file
Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
1 parent e5350b7 commit 8f31e38

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir

+10-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ module @foo_module attributes { transform.with_named_sequence } {
5454

5555
// -----
5656

57-
// expected-error @+1{{The default tuning specification must include an operation with the symbol name '__kernel_config'}}
57+
// expected-error @+1{{The tuning specification must include a named sequence with the symbol name '__kernel_config'}}
5858
module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
5959
}
60+
61+
// -----
62+
63+
// expected-error @+1{{The tuning specification must include a named sequence with the symbol name '__kernel_config'}}
64+
module @iree_default_tuning_spec attributes { iree_codegen.tuning_spec_with_default_entrypoint } {
65+
func.func @__kernel_config(%arg0: i32) -> () {
66+
return
67+
}
68+
}

compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace mlir::iree_compiler {
4545
// Constant names.
4646
//===----------------------------------------------------------------------===//
4747
constexpr StringLiteral kConfigAttrName = "lowering_config";
48-
constexpr StringLiteral kTuningDefaultSpecAttrName =
48+
constexpr StringLiteral kTuningSpecDefaultEntrypointAttrName =
4949
"iree_codegen.tuning_spec_with_default_entrypoint";
5050
constexpr StringLiteral kTuningSpecEntrypointAttrName =
5151
"iree_codegen.tuning_spec_entrypoint";

compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ IREECodegenDialect::verifyOperationAttribute(Operation *op,
6464
// b. It must have exactly one argument type, and the argument must be
6565
// of type `transform::AnyOpType`.
6666

67-
if (symbol == kTuningDefaultSpecAttrName) {
67+
if (symbol == kTuningSpecDefaultEntrypointAttrName) {
6868
if (auto moduleOp = dyn_cast<ModuleOp>(op)) {
6969
if (!llvm::any_of(moduleOp.getOps(), [](auto &op) {
7070
if (auto namedSeqOp = dyn_cast<transform::NamedSequenceOp>(&op)) {
@@ -75,8 +75,8 @@ IREECodegenDialect::verifyOperationAttribute(Operation *op,
7575
return false;
7676
})) {
7777
return moduleOp.emitError()
78-
<< "The default tuning specification must include an "
79-
"operation with the symbol name '"
78+
<< "The tuning specification must include a named "
79+
"sequence with the symbol name '"
8080
<< kKernelConfigSpecName << "'.";
8181
}
8282
}

docs/website/docs/reference/tuning.md

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ that conform to the following format:
123123
`!transform.any_op`.
124124
* All entry points in the final tuning specs must either read
125125
(`transform.readonly`) or consume (`transform.consumed`) the argument.
126+
* The `iree_codegen.tuning_spec_with_default_entrypoint` attribute ensures that
127+
the tuning spec includes a named sequence op marked with `__kernel_config`.
126128

127129
The tuning spec above attempts to match `linalg.generic` ops that correspond to the
128130
matmul operation with the RHS operand transposed (a.k.a. mmt) of shape

0 commit comments

Comments
 (0)