-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Codegen][Tuner] verifier for the default tuning spec #19525
Conversation
Signed-off-by: Bangtian Liu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what are the alternatives you considered and why you decided on this way of verifying the default specs? IIRC, we first discussed a dedicated verification pass.
Also, please update the documentation in https://iree.dev/reference/tuning/
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
There are test failures. |
During our discussion, you proposed two approaches: 1) use one separate pass to verify the default spec; 2) add one attribute and update the |
This is something that should be explained in the PR description for all the other folks who did not join the same meeting |
Ok, will add it in the PR description. |
Yeah, will work on fixing it. |
Signed-off-by: Bangtian Liu <[email protected]>
In cases where both a user-provided tuning specification (tuning_spec_mmt_tile_and_fuse.mlir) and the default specification (iree_default_tuning_spec_gfx942.mlir) are used, the default spec part, after linking the two MLIR files, contains a named sequence operation with the symbol name __kernel_config_1 instead of __kernel_config. This behavior is due to the logic implemented here: LinkTuningSpecsPass.cpp, Line 110. To address this which causes the ci errors, I updated the code from
to
|
8f31e38
to
b2d4cd2
Compare
Signed-off-by: Bangtian Liu <[email protected]>
Good observation, this needs to be handled.
This fix is incorrect. It no longer verifies the there's the exact entry point with the default name. If the outermost entrypoint is anything |
Signed-off-by: Bangtian Liu <[email protected]>
compiler/plugins/target/ROCM/test/default_tuning_specs_amdgpu.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/LinkTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Bangtian Liu <[email protected]>
f6280a1
to
20d858b
Compare
compiler/src/iree/compiler/Codegen/Common/LinkTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Bangtian Liu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds the unit attribute
iree_codegen.tuning_spec_with_default_entrypoint
to indicate the default tuning spec (typically or user-provided tuning spec but can work in the same manner) must contain one named sequence operation marked with__kernel_config
, also add the corresponding verification inverifyOperationAttribute
function.This PR is relevant to task in #19214: add a discardable attr verifier for entry points iree_codegen.tuning_spec_entrypoint
Context:
Jakub proposed two approaches for verifying the default tuning specification:
After careful consideration, we agreed on the second approach to avoid introducing an additional pass, ensuring a simple implementation.