-
Notifications
You must be signed in to change notification settings - Fork 224
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
[Test][gtest] Sl/test solver #1877
Conversation
8700896
to
87dafc0
Compare
test/test.hpp
Outdated
// Conflicts with GoogleTest FAIL() | ||
#ifdef FAIL | ||
#undef FAIL |
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.
How it could be so that test/test.hpp is used in gtest?
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.
@atamazov test.hpp isn't used in GTest, however, there's a warning from compiler about FAIL() being already defined in GoogleTest. This change probably shouldn't go to develop
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.
Perhaps we can refactor these defs out into their own header, so that they are only included when they are needed
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.
Perhaps we can refactor these defs out into their own header, so that they are only included when they are needed
@JehandadKhan separated Macros defined in test.hpp to a separate header test_macro.hpp and updated affected code.
This can't be merged in due to Navi21 issues. I recommend converting this into draft. |
@junliume @JehandadKhan I highly recommend pausing with new GoogleTests until #1843 (comment) is resolved. |
@atamazov ConvAsm3x3 doesn't support Navi21, only supports gfx8* and gfx9*. |
@xinlipn That is why this test won't pass on Navi21. If this PR is merged in, CI will always fail. Which means that this PR, in its current state, shouldn't be merged. |
If we are writing tests for solvers then there should be unit tests for |
test/gtest/solver_convasm3x3u.cpp
Outdated
if(!solv.IsApplicable(ctx)) | ||
{ | ||
test_skipped = true; | ||
GTEST_FAIL() << solv.SolverDbId() << "ConvAsm3x3U Not Applicable for this problem" |
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.
GTEST_FAIL() << solv.SolverDbId() << "ConvAsm3x3U Not Applicable for this problem" | |
GTEST_SKIP() << solv.SolverDbId() << "ConvAsm3x3U Not Applicable for this problem" |
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.
@JehandadKhan replaced with GTEST_SKIP()
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.
Good. This change resolves #1877 (comment).
That is a false issue, if the solver is not applicable on Navi, then the test should skip instead of failing, since there is nothing to test! Please see my suggestion here
I dont agree with that, since that would mean a new test which would enhance test coverage in MIOpen would be withering in our PR section. Since we wish to get to a place where we test each solver individually.
I agree, however, that is not the intent of this PR. The purpose of this PR to increase numerical accuracy coverage to a new solver, which previously does not exists. The current testing infra uses the API to test numerical accuracy on the API level where individual solvers might get skipped since they were not fast enough. Once we have numerical coverage over all the solvers, we can start the work on unit testing each solver as you propose. cc @xinlipn |
…oid conflicts in GTest
test/test_macro.hpp
Outdated
|
||
#include "test.hpp" | ||
|
||
#define CHECK(...) \ |
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.
Why this is copied from test.hpp?
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.
Why this is copied from test.hpp?
@atamazov this idea is to separate FAIL() out in a separate header which conflicts with the same definition in GoogleTest. It seems to be strange if just move FAIL() out, that's I put all Macros in the new header file
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.
@xinlipn But then why test.hpp (that contains the same CHECK) is included here?
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.
@xinlipn But then why test.hpp (that contains the same CHECK) is included here?
@atamazov separate out only one Macro FAIL() from the rest and just create a header file for it seems to be a temp workaround and looks weird logically, at least to me.
FAIL() isn't used anywhere and I removed it for now to minimize the impact to other code.
Consequently test_macro.hpp is removed and changes in other headers anyway are reverted.
test/test_macro.hpp
Outdated
\ | ||
} while(false) | ||
|
||
#define EXPECT(...) \ |
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.
Ditto
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.
Please see comments above
test/test_macro.hpp
Outdated
\ | ||
} while(false) | ||
|
||
#define EXPECT_OP(LEFT, OP, RIGHT) \ |
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.
Ditto
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.
Please see comments above
test/handle_test.cpp
Outdated
@@ -39,7 +39,7 @@ | |||
#include "get_handle.hpp" | |||
#include <vector> | |||
#include <thread> | |||
#include "test.hpp" | |||
#include "test_macro.hpp" |
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.
Any way to resolve the "FAIL" problem without touching existing tests?
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.
@atamazov another way is only separate FAIL in to a new header file or remove this definition for now if no code is currently using it.
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.
The PR can be simplified, if we just remove the FAIL macro if its not being used anywhere
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.
The PR can be simplified, if we just remove the FAIL macro if its not being used anywhere
@JehandadKhan done
cc @atamazov
test/gtest/solver.hpp
Outdated
miopenDestroyConvolutionDescriptor(conv_desc); | ||
} | ||
ConvTestCase conv_config; | ||
miopenConvolutionDescriptor_t conv_desc; |
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.
If we use the MIOpen C++ objects instead, then you would not need to manage the lifetime of these objects.
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.
If we use the MIOpen C++ objects instead, then you would not need to manage the lifetime of these objects.
@JehandadKhan , done
…rs, Init desc using Object
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.
No objections!
ConvAsm3x3 solver test. Passed CI after disabling Navi21 which is not supported by this solver.