Skip to content
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

Update to spdlog 1.12 and fmt 10.1.1 #473

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

kkraus14
Copy link
Contributor

@kkraus14 kkraus14 commented Oct 16, 2023

Description

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • The cmake-format.json is up to date with these changes.
  • I have added new files under rapids-cmake/
    • I have added include guards (include_guard(GLOBAL))
    • I have added the associated docs/ rst file and update the api.rst

There's an ongoing migration in conda-forge in moving all packages to using spdlog v1.12 and fmt v10. This will eventually cause issues solving environments unless rapids libraries support these versions as well.

Probably need to test downstream libraries especially for the fmt upgrade before we can merge this.

Related RMM issue: rapidsai/rmm#1356
Related conda-forge PR to bring the spdlog patch for nvcc into the 1.12 builds: conda-forge/spdlog-feedstock#59

@copy-pr-bot
Copy link

copy-pr-bot bot commented Oct 16, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@robertmaynard robertmaynard added feature request New feature or request non-breaking Introduces a non-breaking change labels Oct 16, 2023
@robertmaynard
Copy link
Contributor

/ok to test

@bdice
Copy link
Contributor

bdice commented Oct 16, 2023

@robertmaynard I'll open PRs to test these versions on RAPIDS repos soon. @kkraus14 Thanks for the upstream fix and the backport for conda-forge packages. That helps a lot.

@kkraus14
Copy link
Contributor Author

FYI -- RMM 23.10 had its tests built successfully in conda-forge: conda-forge/librmm-feedstock#58

@bdice
Copy link
Contributor

bdice commented Nov 3, 2023

Testing PRs (edited):

I think these are all the repos that use spdlog/fmt.

The only downstream user I'm not sure about is nvbench. Do we need to test it too? https://github.com/NVIDIA/nvbench/blob/57c4d42ba505d525a1a3815d2b2560450a4f83dd/cmake/NVBenchDependencies.cmake#L10

@robertmaynard
Copy link
Contributor

robertmaynard commented Nov 3, 2023 via email

@bdice bdice changed the base branch from branch-23.12 to branch-24.02 November 16, 2023 05:26
@bdice
Copy link
Contributor

bdice commented Nov 22, 2023

Update: conda C++ builds with fmt 10 / spdlog 1.12 are failing for cudf. rapidsai/cudf#14355

I've updated the fmt/spdlog pinnings in rapids-cmake and in cudf, and it's using RMM artifacts with the correct pinnings as well. The conda environment is pulling spdlog 1.12 and fmt 10, so we're getting the build environment that we want. The C++ build shows this failure in the logs:

sccache $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++ -DCUFILE_FOUND -DFMT_HEADER_ONLY=1 -DJITIFY_PRINT_LOG=0 -DKVIKIO_CUFILE_BATCH_API_FOUND -DKVIKIO_CUFILE_FOUND -DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE -DRMM_LOGGING_LEVEL=LIBCUDF_LOGGING_LEVEL -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO -DSPDLOG_FMT_EXTERNAL -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -Dcudf_EXPORTS -I$SRC_DIR/cpp/build/_deps/dlpack-src/include -I$SRC_DIR/cpp/build/_deps/jitify-src -I$SRC_DIR/cpp/include -I$SRC_DIR/cpp/build/include -I$SRC_DIR/cpp/src -I$PREFIX/include/rapids/libcudacxx -I$SRC_DIR/cpp/build/_deps/thrust-src -I$SRC_DIR/cpp/build/_deps/thrust-src/dependencies/cub -I$SRC_DIR/cpp/build/_deps/cuco-src/include -I$BUILD_PREFIX/include -isystem $PREFIX/include/gdeflate -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/libcudf-split- -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -I$PREFIX/targets/x86_64-linux/include -I$BUILD_PREFIX/targets/x86_64-linux/include  -L$PREFIX/targets/x86_64-linux/lib -L$PREFIX/targets/x86_64-linux/lib/stubs -L$BUILD_PREFIX/targets/x86_64-linux/lib -L$BUILD_PREFIX/targets/x86_64-linux/lib/stubs -O3 -DNDEBUG -std=gnu++17 -fPIC -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations -Wno-deprecated-declarations -pthread -MD -MT CMakeFiles/cudf.dir/src/io/utilities/datasource.cpp.o -MF CMakeFiles/cudf.dir/src/io/utilities/datasource.cpp.o.d -o CMakeFiles/cudf.dir/src/io/utilities/datasource.cpp.o -c $SRC_DIR/cpp/src/io/utilities/datasource.cpp
In file included from $PREFIX/include/spdlog/fmt/fmt.h:31,
                 from $PREFIX/include/spdlog/common.h:50,
                 from $PREFIX/include/spdlog/spdlog.h:12,
                 from $SRC_DIR/cpp/include/cudf/utilities/logger.hpp:19,
                 from $SRC_DIR/cpp/include/cudf/detail/utilities/logger.hpp:19,
                 from $SRC_DIR/cpp/src/io/utilities/config_utils.hpp:18,
                 from $SRC_DIR/cpp/src/io/utilities/datasource.cpp:24:
$PREFIX/include/fmt/core.h: In instantiation of 'constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&) [with bool PACKED = true; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; T = const cudaError; typename std::enable_if<PACKED, int>::type <anonymous> = 0]':
$PREFIX/include/fmt/core.h:1808:51:   required from 'constexpr fmt::v10::format_arg_store<Context, Args>::format_arg_store(T& ...) [with T = {const cudaError, const char*}; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; Args = {cudaError, const char*}]'
$PREFIX/include/fmt/core.h:1826:18:   required from 'constexpr fmt::v10::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<T>::type>::type ...> fmt::v10::make_format_args(T& ...) [with Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; T = {const cudaError, const char*}]'
$PREFIX/include/spdlog/logger.h:374:75:   required from 'void spdlog::logger::log_(spdlog::source_loc, spdlog::level::level_enum, spdlog::string_view_t, Args&& ...) [with Args = {const cudaError&, const char*}; spdlog::string_view_t = fmt::v10::basic_string_view<char>]'
$PREFIX/include/spdlog/logger.h:90:13:   required from 'void spdlog::logger::log(spdlog::source_loc, spdlog::level::level_enum, fmt::v10::format_string<T ...>, Args&& ...) [with Args = {const cudaError&, const char*}; fmt::v10::format_string<T ...> = fmt::v10::basic_format_string<char, const cudaError&, const char*>]'
$SRC_DIR/cpp/src/io/utilities/datasource.cpp:197:7:   required from here
$PREFIX/include/fmt/core.h:1576:63: error: 'fmt::v10::detail::type_is_unformattable_for<const cudaError, char> _' has incomplete type
 1576 |     type_is_unformattable_for<T, typename Context::char_type> _;
      |                                                               ^
$PREFIX/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
 1580 |       formattable,
      |       ^~~~~~~~~~~
$PREFIX/include/fmt/core.h:1580:7: note: 'formattable' evaluates to false

It seems like we need some C++ updates to make this code compile, but I haven't been able to identify exactly what is needed yet. I think it's failing to format logging messages involving cudaError at compile time? I'll pick up this investigation again soon, but more eyes would be welcome if someone has time.

edit: This was resolved by rapidsai/cudf@bd5077e

@bdice
Copy link
Contributor

bdice commented Nov 28, 2023

CPM was having trouble finding fmt because the version was reported incorrectly (10.1.0 instead of 10.1.1). I fixed it with this PR: conda-forge/fmt-feedstock#38.

@bdice
Copy link
Contributor

bdice commented Nov 28, 2023

/ok to test

@bdice
Copy link
Contributor

bdice commented Nov 29, 2023

CPM is now correctly picking up the fmt package with the version fix. I'm rerunning CI (rmm is complete, now cudf and raft, ...). I'm also attempting to rebuild all of RAPIDS locally with devcontainers.

@bdice
Copy link
Contributor

bdice commented Nov 30, 2023

We're making progress! cudf passes CI now. I am rerunning the last few repos. I am hoping to merge this by the end of the week, ideally tomorrow.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertmaynard @kkraus14 I think we can merge this tomorrow. I'm going to do it during work hours because I'm going to request some admin merges on the changes we need to keep from the testing PRs (to conserve CI resources and accelerate the rollout process).

@bdice
Copy link
Contributor

bdice commented Nov 30, 2023

All builds succeeded. Reviews have been requested. Merging soon.

@bdice
Copy link
Contributor

bdice commented Nov 30, 2023

/merge

@rapids-bot rapids-bot bot merged commit 28a3062 into rapidsai:branch-24.02 Nov 30, 2023
16 checks passed
rapids-bot bot pushed a commit to rapidsai/rmm that referenced this pull request Nov 30, 2023
This PR updates to fmt 10.1.1 and spdlog 1.12.

Depends on rapidsai/rapids-cmake#473.

Closes #1356

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Jake Awe (https://github.com/AyodeAwe)

URL: #1374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants