Create logger wrapper around spdlog that can be easily reused in other libraries#1722
Merged
rapids-bot[bot] merged 122 commits intorapidsai:branch-25.02from Nov 26, 2024
Merged
Create logger wrapper around spdlog that can be easily reused in other libraries#1722rapids-bot[bot] merged 122 commits intorapidsai:branch-25.02from
rapids-bot[bot] merged 122 commits intorapidsai:branch-25.02from
Conversation
harrism
reviewed
Nov 7, 2024
harrism
reviewed
Nov 7, 2024
harrism
reviewed
Nov 7, 2024
robertmaynard
requested changes
Nov 7, 2024
robertmaynard
requested changes
Nov 7, 2024
Contributor
Author
|
I should note that a lot of the complexity here is from supporting the backwards compatibility modes. I wanted to get this ready now so that we could easily test all cases and flip the switch as needed, but if it becomes too cumbersome we could just wait for 25.02 and delete the compatibility paths before merging anything. |
robertmaynard
approved these changes
Nov 26, 2024
AyodeAwe
approved these changes
Nov 26, 2024
This was referenced Nov 26, 2024
Contributor
Author
|
/merge |
3 tasks
rapids-bot Bot
pushed a commit
that referenced
this pull request
Nov 26, 2024
It looks like while #1722 introduced usage of the modern target_link_libraries syntax it did not adjust all other calls because I wasn't setting up coverage usage locally or anywhere else in CI. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Kyle Edwards (https://github.com/KyleFromNVIDIA) - Robert Maynard (https://github.com/robertmaynard) URL: #1738
rapids-bot Bot
pushed a commit
that referenced
this pull request
Nov 27, 2024
This fixes a handful of issues uncovered in downstream CI after #1722. The following are bugs introduced in #1722: - When using rmm from the build directory rather than an installation, the namespaced targets are not present so we must generate aliases. - The `RMM_LOGGING_ASSERT` macro is never used in rmm itself, so we didn't catch that it was still using the old version of the logger. While fixing the above, I also uncovered that building fmt in this environment unearths a gcc bug. The following are underlying issues uncovered by #1722: - spdlog's fmt CMake linkage is determined at build time. As a result, the conda package for spdlog is hardcoded to use fmt as a library (static or shared depends on what the `fmt::fmt` target winds up being when a consumer using spdlog finds fmt in CMake), which means that is propagated to all consumers of the librmm package via its CMake. This means that we often wind up with both fmt_header_only and fmt as link targets for many RAPIDS libraries. For now, this PR makes it so that if `rapids_cpm_find(spdlog)` does not find a copy of spdlog locally, the cloned version will use an external header-only fmt via rapids-cmake's logic, which ensures that packages like wheels do not export a libfmt or libspdlog dependency. However, in environments where `rapids_cpm_find(spdlog)` does find a preexisting package, we allow that package's fmt linkage to propagate. In conda environments, we know that this fmt linkage is to the library, so we keep fmt as part of rmm's runtime dependencies (by placing it in host and relying on the run export) so that libfmt is always available in environments using rmm. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) URL: #1739
rapids-bot Bot
pushed a commit
to rapidsai/ucxx
that referenced
this pull request
Nov 27, 2024
This PR adapts to breaking changes in rmm in rapidsai/rmm#1722. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Kyle Edwards (https://github.com/KyleFromNVIDIA) URL: #336
rapids-bot Bot
pushed a commit
to rapidsai/cudf
that referenced
this pull request
Nov 27, 2024
This PR adapts to breaking changes in rmm in rapidsai/rmm#1722. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Mark Harris (https://github.com/harrism) - Nghia Truong (https://github.com/ttnghia) URL: #17451
jameslamb
reviewed
Nov 27, 2024
| if grep -E 'spdlog\:\:' < "${symbol_file}" \ | ||
| | grep -v 'std\:\:_Destroy_aux' | ||
| then | ||
| if grep -E 'spdlog\:\:' < "${symbol_file}"; then |
Member
There was a problem hiding this comment.
(reviewing after merge just to be sure I understand what's happening)
Love that hiding these symbols also reduced the complexity of these checks! 🎉
rapids-bot Bot
pushed a commit
to rapidsai/raft
that referenced
this pull request
Nov 27, 2024
This PR adapts to breaking changes in rmm in rapidsai/rmm#1722. This PR is a breaking change because consumers of raft that use any functionality that touches rmm logging will need to link to the rmm::rmm_logger_impl target as well now. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) URL: #2513
rapids-bot Bot
pushed a commit
to rapidsai/cuvs
that referenced
this pull request
Nov 30, 2024
This PR adapts to breaking changes in rmm in rapidsai/rmm#1722. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) - Ben Frederickson (https://github.com/benfred) URL: #499
raydouglass
pushed a commit
to rapidsai/cuml
that referenced
this pull request
Dec 2, 2024
This PR adapts to breaking changes in rmm in rapidsai/rmm#1722. --------- Co-authored-by: Bradley Dice <[email protected]>
rapids-bot Bot
pushed a commit
to rapidsai/cugraph
that referenced
this pull request
Dec 2, 2024
This PR adapts to breaking changes in rmm in rapidsai/rmm#1722. Authors: - Vyas Ramasubramani (https://github.com/vyasr) - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) - James Lamb (https://github.com/jameslamb) - Kyle Edwards (https://github.com/KyleFromNVIDIA) - Don Acosta (https://github.com/acostadon) URL: #4794
7 tasks
rapids-bot Bot
pushed a commit
to rapidsai/rapids-cmake
that referenced
this pull request
Dec 16, 2024
As of rapidsai/rmm#1722, rmm no longer depends on spdlog. However, some tests were depending on spdlog transitively through rmm. This PR adds spdlog as an explicit dependency to correct those failures. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) - Vyas Ramasubramani (https://github.com/vyasr) URL: #733
7 tasks
rapids-bot Bot
pushed a commit
to rapidsai/rapids-cmake
that referenced
this pull request
Jan 7, 2025
These targets were added in rapidsai/rmm#1722 and must be propagated. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) - Robert Maynard (https://github.com/robertmaynard) URL: #739
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR defines a new way to produce a logger wrapping spdlog. The logger's interface is declared in a template header file that can be processed by CMake to produce an interface that may be customized for placement into any project. The new implementation uses the PImpl idiom to isolate the spdlog (and transitively, fmt) dependency from the public API of the logger. The implementation is defined in an impl header. A corresponding source template file is provided that simply includes this header. All of these files are wrapped in some CMake logic for producing a custom target for a given project.
rmm leverages this new logger by requesting the creation of a logger target and a corresponding implementation. This is a breaking change because consumers of rmm will need to link the new
rmm_logger_impltarget into their own libraries to get logging support. Once this gets merged, the plan is to move this implementation out of rmm into its own repository. At that point, the logger may also be used to completely replace logger implementations in cudf, raft, and cuml (as well as any other RAPIDS libraries that are aiming to provide their own logging implementation). Once everything in RAPIDS is migrated to using the new logger, we will update the way that it uses spdlog to completely hide all spdlog symbols, which solves a half dozen different problems for us when it comes to packaging (symbol collision issues, ABI compatibility, conda environment conflicts, bundling of headers into conda packages, etc).Resolves #1709
Checklist