-
Notifications
You must be signed in to change notification settings - Fork 200
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
Move RMM_LOGGING_ASSERT into separate header #1241
Move RMM_LOGGING_ASSERT into separate header #1241
Conversation
Avoiding the inclusion of rmm/logger.hpp can reduce compile times significantly.
Since this is moving an internal macro from one detail header to another detail header, it should be considered a non-breaking change. In practice, it might break downstream projects that are expecting |
Does this PR only update the RMM headers used by RAFT? It would be better to update all headers, I think. |
So does this replace #1232? |
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.
I agree with Mark, we should update all headers in one PR. Afterwards, we should test that at least the core RAPIDS libraries continue to build successfully against this PR before merging.
If building cudf/cuml/cugraph is difficult for you to do locally, you can also do it fairly easily in CI by opening PRs to each repo that use the build artifacts from this PR rather than pulling the latest librmm nightly. There have been a few examples of this lately, including this commit in this raft PR. I would recommend following that pattern for at least cudf/cuml/cugraph to make sure that they compile successfully. Let me know if you need help with that.
Building locally should be easy with rapids-compose, if not devcontainers. Not sure if all repos have the devcontainers yet, but the cuspatial devcontainer can be used to build RMM, cuDF, and cuSpatial, for example. |
No, this PR updates all headers and makes sure all tests compile and run. I have included the table to show that the impact on one particular downstream library is meaningful. If you want to know for other headers what the impact is, feel free to edit and run this bash snippet:
That really depends on the direction that RMM sets for using logging. If
This PR updates all headers. I will open PRs on cudf/cuml/cugraph and report back.
Thanks for the example! I have opened
As a general question, if moving a single macro in the detail headers requires rerunning CI in downstream libraries, would it make sense to automate it? |
Testing all of RAPIDS in every push to a RMM PR would be a bit of a burden both on our CI systems and costs, and on developer productivity. However I believe this is automated in nightly tests. |
Status update:
I had a typo in the python channel, so all python builds have failed. How do you suggest I proceed? |
I have filed rapidsai/cudf#13066 to fix the missing include and pushed to the cuml, cudf, and cugraph PR a fix to the typo in the Python RMM channel. |
All test PRs are passing CI in cuml, cugraph, and cudf. I fixed two includes in cudf. One for algorithm and one for cstring. I think we should be good to go. 👍 |
I mainly requested this because in the specific case of macros we have had many issues before where dependencies were using macros that were never intended to be public. In general, I don't think this level of testing is required. That said, there are many cases where we do want certain changes to a library to trigger tests of the dependencies. I know that you see this all the time with raft->cuml/cugraph, and any rmm or rapids-cmake change will affect all of RAPIDS. We are interested in automating at least the dispatch process, but there are many tasks ahead of that in the queue. Running all of RAPIDS CI on every rmm PR is definitely overkill though. |
I agree that it is good to test the change on downstream libraries and I am happy that this was able to catch some missing includes in cudf.
Great! Good to know that automating the dispatch process is in the queue. I have tested this PR on a current branch of RAFT that I am working on. It reduced build times of libraft + tests by 10% (29 min to 26 min) and reduced build times per translation unit by 11s (median) and 8.5s (mean). There are still some big 'chunks' in the RAFT process that limit the overall impact. For incremental compilation, the impact can be quite large: most test files go from 20s to 10s compile time. At the suggestion of @teju85, I have also checked with github code search for uses of |
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.
I think this is a nice improvement.
@vyasr : is there anything holding up this PR? |
Nope sorry I've just been on vacation and hadn't had a chance to review again. Looking now. |
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.
For the record, could you update the table in the PR description? I'm not sure that it is up-to-date, there are a number of files that now include both logging_assert.hpp
and logger.hpp
. Was the goal of the table to only capture transitive includes, or to generally list all files where the state of logger.hpp
inclusion has changed? Examples like fixed_size_memory_resource.hpp
or pool_memory_resource.hpp
added an include, but I suppose the end result is the same in terms of what symbols end up defined, so perhaps that's what you were aiming for?
Aside from that the change looks great, thanks!
I have updated the table. It now contains all non-detail headers. Indeed it lists per header if it transitively includes spdlog. It was not the intention to list all files where the inclusion of logger.hpp has changed. |
Awesome thanks for that @ahendriksen, looks great! |
/merge |
The inclusion of
rmm/logger.hpp
can increase compile times significantly. Before this PR,rmm/logger.hpp
was included inrmm/error.hpp
which by necessity was included almost everywhere. This PR movesRMM_LOGGING_ASSERT
into its own header, thereby drastically cutting down on the headers which transitively includermm/logger.hpp
.This PR will make it possible to reduce compile times of RAFT by ~10 seconds per translation unit.
Description
Related to issue #1222 and also PR #1232. Compared to #1232, this PR might make it able to also have fast builds without precompiling spdlog.
I include a table below showing which headers transitively include
rmm/logger.hpp
before and after PR (in debug and release builds). These are the rmm headers used by RAFT.Checklist