-
Notifications
You must be signed in to change notification settings - Fork 304
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
C++ benchmarking for MG PageRank #1755
C++ benchmarking for MG PageRank #1755
Conversation
@rlratzel @ChuckHastings Please review this based on our previous discussion about C++ benchmarking. Once we agree on the methodology, I will apply this to other tests as well (in a separate PR). @kaatish You may also take a look as MG graph primitive tests should follow this. |
Codecov Report
@@ Coverage Diff @@
## branch-21.10 #1755 +/- ##
===============================================
Coverage ? 59.72%
===============================================
Files ? 77
Lines ? 3521
Branches ? 0
===============================================
Hits ? 2103
Misses ? 1418
Partials ? 0 Continue to review full report at Codecov.
|
rerun tests |
auto param = GetParam(); | ||
run_current_test<int32_t, int32_t, float, float>(std::get<0>(param), std::get<1>(param)); | ||
auto param = GetParam(); | ||
auto pagerank_usecase = std::get<0>(param); |
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.
This approach will override all rmat tests, right? In this case we have a small rmat use case that has the correctness test enabled and a large rmat use case that has the correctness disabled. I believe this change would consequently run the test twice for each combination (32/32, 32/64, 64/64) once with and once without validation. Not sure that's what we want.
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 create a separate test to address this. I'm bad at naming things, so imagine better names:
- Create a test suite called Benchmark_MGPageRank_Rmat. Disable validation in that test suite and provide a single rmat test (something small so that when we're doing unit tests in CI it won't take long)
- Add this logic to that unit test, but not the basic unit tests
- When you want to run with these overriding parameters you can run:
mpirun -np 2 tests/MG_PAGERANK_TEST --gtest_filter=Benchmark_MGPageRank_Rmat*
and append whatever overriding parameters are desired
That would allow you to get a clean run without the extra runs.
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.
This approach will override all rmat tests, right?
Yes, without --gtest_filter
, no, with the filter. This was intended to use in the benchmarking mode with something like --gtest_filter=rmat_large_tests/Tests_MGPageRank_Rmat.CheckInt32Int32*
.
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.
See the "Exemplar benchmark scripts" part of this PR description.
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.
With the filter to run only rmat_large_tests, I think the current code can achieve what we can do with Benchmark_MGPageRank_Rmat without actually adding additional code for that (and with minimum interruption in our C++ testing work process).
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.
OK. So I should read all of the description when reviewing the PR, just not jump to the code :-)
It would be nice to encapsulate this logic somehow rather than having to repeat it in every test. Could we create a function that updates the rmat_usecase that can be reusable across all of the tests (SG or MG)? Perhaps it could be a method in the rmat_usecase class?
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.
Also, did we want to allow for specifying other input files (an analog for the file_usecase)? That might require some refactoring of the tests since most of our tests don't have a single file test without validation.
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.
It would be nice to encapsulate this logic somehow rather than having to repeat it in every test.
Agreed, I will push this update in the next commit.
Also, did we want to allow for specifying other input files (an analog for the file_usecase)?
Yeah... eventually, but let's think about this later (I guess we may need to add something like file_large_tests... but let's worry about this when we have a specific usecase).
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.
Approving but I do have some feedback that, if you can address would be nice, but I think it might be out-of-scope for this PR.
@@ -316,7 +311,22 @@ TEST_P(Tests_MGPageRank_File, CheckInt32Int32FloatFloat) | |||
TEST_P(Tests_MGPageRank_Rmat, CheckInt32Int32FloatFloat) | |||
{ | |||
auto param = GetParam(); | |||
run_current_test<int32_t, int32_t, float, float>(std::get<0>(param), std::get<1>(param)); | |||
run_current_test<int32_t, int32_t, float, float>( | |||
std::get<0>(param), override_Rmat_Usecase_with_cmd_line_arguments(std::get<1>(param))); |
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.
A downside to this approach is that gtest doesn't know the override is happening, and as a result it may end up producing redundant combinations of input params (since each param is being overridden the same way), if there are >1 rmat usecase instances in the param list. I'm guessing --gtest_list_tests
may not print the correct list of tests when one of the rmat options are passed either (eg. TestSuite/TestCase/2
will be associated with the default params and not the overridden ones), but that's relatively minor.
Unfortunately I don't have a better suggestion that's in the scope of this PR though.
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.
Yeah... maybe it might be better to rename rmat_larget_tests to something like rmat_benchmarks (@ChuckHastings also mentioned about creating Benchmark_MGPageRank_Rmat) and enforce rmat_benchmarks to have only one Rmat_Usecase (and in the benchmark mode, just select rmat_benchmarks using --gtest_filter).
@gpucibot merge |
Apply the updates in PR #1755 (for MG PageRank) to MG: Katz Centrality, BFS, SSSP, WCC, and primitive tests SG: PageRank, Katz Centrality, BFS, SSSP, and WCC tests @ChuckHastings I will defer Louvain test updates to you :-) once Louvain tests get updated to take R-mat graphs. Authors: - Seunghwa Kang (https://github.com/seunghwak) Approvers: - Rick Ratzel (https://github.com/rlratzel) - Chuck Hastings (https://github.com/ChuckHastings) URL: #1762
Exemplar benchmark scripts