-
Notifications
You must be signed in to change notification settings - Fork 653
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] attr verifier for tuning specs #19486
Conversation
f26ec89
to
656d35a
Compare
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
3895b12
to
501644c
Compare
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
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
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Bangtian Liu <[email protected]>
compiler/src/iree/compiler/Codegen/Common/LinkTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
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]>
compiler/src/iree/compiler/Codegen/Common/LinkTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/LinkTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/verify_tuning_specs.mlir
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.
Mostly LGTM now
compiler/src/iree/compiler/Codegen/Common/LinkTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
return (*defaultTransformLibrary).emitError() | ||
<< "Verification failed for default tuning spec"; | ||
<< "Default tuning spec " << defaultTuningSpecName | ||
<< " failed to verify"; |
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.
Have you confirmed that this error gets emitted when the default spec is invalid?
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.
@bangtianliu can you please reply instead of marking this as resolved? I don't know what the outcome of this is.
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.
Yes, I did check it and fixed the crashes.
compiler/src/iree/compiler/Codegen/Common/MaterializeTuningSpecsPass.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp
Outdated
Show resolved
Hide resolved
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 % one nit
Signed-off-by: Bangtian Liu <[email protected]>
d68e16e
to
b8b0183
Compare
Could you explain a little bit more about what this is trying to verify. I am just trying to fit it within my mental model. Thanks in advance for explaining it to me. |
The primary purpose of adding a verifier is to ensure the correctness of all provided tuning specifications, including the default tuning spec, user-provided tuning specs, and the output tuning specs after linking. Currently, this PR is primarily on verifying:
A detailed explanation can be found: https://github.com/iree-org/iree/blob/main/compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.cpp#L55 |
What is the entry point attr name for?
I don't really follow the reason for these constraints |
The current tuning design leverages both default and user-provided tuning specs (specifications) to override compiler heuristics and guide dispatch code generation effectively. The tunning specs are transform dialect libraries and must adhere to a specific format (as outlined in the tuning documentation):
Therefore, the entry point attr (name) For more details, please refer to the tuning documentation: https://iree.dev/reference/tuning/. |
This PR is relevant to task in #19214: add a discardable attr verifier for entry points iree_codegen.tuning_spec_entrypoint