-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MLIR][TosaValidation] Enable float element-types on default #114376
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-mlir @llvm/pr-subscribers-mlir-tosa Author: None (miritb) ChangesAfter change in tosa-validation profiles to list-option, float element types where no more allowed in default (where profile is/contains undefined enumeration value). This change allows floats when undefined value is contained in the profile. Full diff: https://github.com/llvm/llvm-project/pull/114376.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
index e390a613b58077..e836c383557f03 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
@@ -521,7 +521,7 @@ LogicalResult TosaValidation::applyVariableCheck(Operation *op) {
bool TosaValidation::isValidElementType(Type type) {
if (isa<FloatType>(type)) {
- if (!isEnabledProfile(TosaProfileEnum::MainInference))
+ if (!isEnabledProfile(TosaProfileEnum::Undefined) && !isEnabledProfile(TosaProfileEnum::MainInference))
return false;
return type.isF32() || type.isF16() || type.isBF16();
}
|
@tatwaichong can you please review? |
✅ With the latest revision this PR passed the C/C++ code formatter. |
@miritb thanks for you patch. It looks good on my side but before proceeding am really curious why there is an option for |
34eae8c
to
1777df3
Compare
After change in tosa-validation profiles to list-option, float element types where no more allowed in default (where profile is/contains undefined enumeration value). This change allows floats when undefined value is contained in the profile.
1777df3
to
486ca71
Compare
hi @miritb, is there any lit or regresssion test failure related to this in MLIR? Profile validation should be default off, and should be explicitly turned on for specific profile requirements. Since
@GeorgeARM Can you try to use --tosa-validate="profile=mi" to pass the float types? |
@tatwaichong trying to reason if having |
One of our teams uses 'addTosaToLinalgPasses', w/o providing an explicit value for 'validationOptions' argument. Since the change in '[mlir][tosa] Change the type of profile option to ListOption ([#111214]' this caused the code not to accept tensors with float element-type. In current change we only want to return the behavior back to what it was before #111214 |
Thanks for your sharing. Sorry for inconvenience. As mentioned, TOSA profiles and extensions are now optional implemented, thus the validation should to be enabled explicitly. Hope you can understand. :) The team is managing to upstream PRs to fill the gap between MLIR TOSA implementation and TOSA specification. |
Hello @tatwaichong what is the status with helping unblocking this? |
After change in tosa-validation profiles to list-option, float element types where no more allowed in default (where profile is/contains undefined enumeration value). This change allows floats when undefined value is contained in the profile.