Skip to content

Conversation

@lifflander
Copy link
Collaborator

Fixes #2397

@lifflander lifflander linked an issue Feb 7, 2025 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Feb 7, 2025

Pipelines results

PR tests (gcc-10, ubuntu, openmpi, no LB)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (clang-13, alpine, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (clang-9, ubuntu, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (clang-12, ubuntu, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (clang-13, ubuntu, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (clang-11, ubuntu, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (gcc-11, ubuntu, mpich, trace runtime, coverage)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (gcc-12, ubuntu, mpich, verbose, kokkos)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (intel icpx, ubuntu, mpich, verbose)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (intel icpc, ubuntu, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (nvidia cuda 11.2, gcc-9, ubuntu, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

FAILED: src/CMakeFiles/vt.dir/Unity/unity_19_cxx.cxx.o 
/usr/bin/ccache /nvcc_wrapper/build/nvcc_wrapper -DFMT_LOCALE -DJSON_USE_IMPLICIT_CONVERSIONS=1 -DVT_NO_COLOR_ENABLED -I/vt/lib/CLI -I/build/vt/release -I/vt/src -I/vt/lib/json/include -I/vt/lib/brotli/c/include -isystem /vt/lib/EngFormat-Cpp/include -isystem /build/checkpoint/install/include -isystem /vt/lib/yaml-cpp/include -Wno-deprecated-gpu-targets -O3 -DNDEBUG -Wall -Wextra -Wno-unknown-pragmas -Wnon-virtual-dtor -Wshadow -Wsign-compare -Wsuggest-override -pedantic -ftemplate-backtrace-limit=100 -Werror -std=c++17 -MD -MT src/CMakeFiles/vt.dir/Unity/unity_19_cxx.cxx.o -MF src/CMakeFiles/vt.dir/Unity/unity_19_cxx.cxx.o.d -o src/CMakeFiles/vt.dir/Unity/unity_19_cxx.cxx.o -c /build/vt/src/CMakeFiles/vt.dir/Unity/unity_19_cxx.cxx
In file included from /vt/src/vt/epoch/epoch_type.h:50,
                 from /vt/src/vt/configs/types/types_headers.h:52,
                 from /vt/src/vt/configs/debug/debug_print.h:47,
                 from /vt/src/vt/configs/debug/debug_masterconfig.h:55,
                 from /vt/src/vt/config.h:47,
                 from /vt/src/vt/context/context.h:50,
                 from /vt/src/vt/context/context.cc:44,
                 from /build/vt/src/CMakeFiles/vt.dir/Unity/unity_19_cxx.cxx:3:
/build/vt/release/vt/cmake_config.h:101:28: fatal error: fmt/base.h: No such file or directory
  101 |   #define INCLUDE_FMT_BASE <fmt/base.h>
      |                            ^
compilation terminated.
FAILED: src/CMakeFiles/vt-trace.dir/vt/trace/trace_lite.cc.o 
/usr/bin/ccache /nvcc_wrapper/build/nvcc_wrapper -DFMT_LOCALE -I/vt/src -I/build/vt/release/vt-trace -isystem /vt/lib/EngFormat-Cpp/include -isystem /vt/lib/yaml-cpp/include -Wno-deprecated-gpu-targets -O3 -DNDEBUG -fdiagnostics-color=always -std=c++17 -MD -MT src/CMakeFiles/vt-trace.dir/vt/trace/trace_lite.cc.o -MF src/CMakeFiles/vt-trace.dir/vt/trace/trace_lite.cc.o.d -o src/CMakeFiles/vt-trace.dir/vt/trace/trace_lite.cc.o -c /vt/src/vt/trace/trace_lite.cc
In file included from /vt/src/vt/epoch/epoch_type.h:50,
                 from /vt/src/vt/configs/types/types_headers.h:52,
                 from /vt/src/vt/configs/debug/debug_print.h:47,
                 from /vt/src/vt/configs/debug/debug_masterconfig.h:55,
                 from /vt/src/vt/config.h:47,
                 from /vt/src/vt/trace/trace_log.h:47,
                 from /vt/src/vt/trace/trace_lite.h:49,
                 from /vt/src/vt/trace/trace_lite.cc:44:
/build/vt/release/vt-trace/vt/cmake_config.h:101:28: fatal error: fmt/base.h: No such file or directory
  101 |   #define INCLUDE_FMT_BASE <fmt/base.h>
      |                            ^
compilation terminated.
FAILED: src/CMakeFiles/vt.dir/Unity/unity_20_cxx.cxx.o 
/usr/bin/ccache /nvcc_wrapper/build/nvcc_wrapper -DFMT_LOCA%0D%0A%0D%0A%0D%0A ==> And there is more. Read log. <==

Build log


PR tests (nvidia cuda 12.2.0, gcc-9, ubuntu, mpich, verbose)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (clang-14, ubuntu, mpich, verbose)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (gcc-9, ubuntu, mpich, zoltan)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


PR tests (clang-10, ubuntu, mpich)

Build for 9ab5ec3 (2025-02-14 00:39:06 UTC)

Build failed for unknown reason. Check build logs


Build log


};

inline auto format_as(TimeTypeWrapper t) {
return to_engineering_string(t.seconds(), 5, eng_exponential, "s");
Copy link
Contributor

Choose a reason for hiding this comment

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

We could avoid including EngFormat-Cpp/eng_format.hpp in the header by moving the implementation to .cpp.

Copy link
Contributor

@cz4rs cz4rs left a comment

Choose a reason for hiding this comment

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

Looks good to me! Nice +/- ratio for vt code 👍

Git check complains:

 lib/fmt/CMakeLists.txt:411: new blank line at EOF.
tests/unit/lb/test_lbargs_enum_conv.nompi.cc:166: new blank line at EOF.

@lifflander lifflander force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch from 9ab5ec3 to 46f7d98 Compare March 3, 2025 23:27
@lifflander lifflander force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch 2 times, most recently from 8832c36 to 48b829a Compare March 11, 2025 18:04
@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch from 48b829a to 2255888 Compare March 24, 2025 16:41
@cz4rs
Copy link
Contributor

cz4rs commented Mar 24, 2025

Rebased to get fresh logs.

edit:
gcc-12 build is failing on vt-tv code. Reproduced with clang-18 locally:

/code/vt/lib/fmt/include/fmt-vt/base.h:2235:45: error: implicit instantiation of undefined template 'fmt::detail::type_is_unformattable_for<BrotliDecoderErrorCode, char>'
[build]  2235 |     type_is_unformattable_for<T, char_type> _;

@cz4rs
Copy link
Contributor

cz4rs commented Mar 25, 2025

Rebased to get fresh logs.

edit: gcc-12 build is failing on vt-tv code. Reproduced with clang-18 locally:

/code/vt/lib/fmt/include/fmt-vt/base.h:2235:45: error: implicit instantiation of undefined template 'fmt::detail::type_is_unformattable_for<BrotliDecoderErrorCode, char>'
[build]  2235 |     type_is_unformattable_for<T, char_type> _;

Reduced reproducer:

#include <brotli/decode.h>
#include <fmt-vt/format.h>

int main(int, char**) {
  BrotliDecoderState* dec_ = nullptr;
  // (...)
  auto error_code = BrotliDecoderGetErrorCode(dec_);
  auto error_str = fmt::format("code={}", error_code);

  return 0;
}
/home/cz4rs/code/vt/lib/fmt/include/fmt-vt/base.h:2235:45: error: implicit instantiation of undefined template 'fmt::detail::type_is_unformattable_for<BrotliDecoderErrorCode, char>'
 2235 |     type_is_unformattable_for<T, char_type> _;
      |                                             ^
/home/cz4rs/code/vt/lib/fmt/include/fmt-vt/base.h:2208:44: note: in instantiation of function template specialization 'fmt::detail::value<fmt::context>::value<BrotliDecoderErrorCode, 0>' requested here
 2208 |   FMT_CONSTEXPR20 FMT_INLINE value(T& x) : value(x, custom_tag()) {}
      |       

@lifflander
Copy link
Collaborator Author

BrotliDecoderGetErrorCode

Ok, for this we just need to cast the enum to the underlying type. I think the gcc-10 failure is the one I was looking at related to Werror.

@lifflander
Copy link
Collaborator Author

Here's the vt-tv fix: DARMA-tasking/vt-tv#145

@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch from 740dcfd to 3ed309c Compare March 26, 2025 15:37
@github-actions
Copy link

github-actions bot commented Mar 26, 2025

clang-format output for this changeset:

diff --git a/src/vt/epoch/epoch_type.h b/src/vt/epoch/epoch_type.h
index b5bd1c0e7..8c4792189 100644
--- a/src/vt/epoch/epoch_type.h
+++ b/src/vt/epoch/epoch_type.h
@@ -96,7 +96,9 @@ constexpr inline EpochType makeEpochZero() {
   return EpochType{static_cast<EpochType::ImplType>(0ull)};
 }
 
-inline auto format_as(EpochType e) { return *e; }
+inline auto format_as(EpochType e) {
+  return *e;
+}
 
 }} /* end namespace vt::epoch */
 
diff --git a/src/vt/topos/index/dense/dense_array.h b/src/vt/topos/index/dense/dense_array.h
index 7df7faec0..5e9af0833 100644
--- a/src/vt/topos/index/dense/dense_array.h
+++ b/src/vt/topos/index/dense/dense_array.h
@@ -175,7 +175,7 @@ auto format_as(DenseIndexArray<T, nd> d) {
   return d.toString();
 }
 
-}}  // end namespace vt::index
+}} // end namespace vt::index
 
 #include "vt/topos/index/dense/dense_array.impl.h"
 
diff --git a/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h b/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h
index cf9682b93..eb1d23826 100644
--- a/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h
+++ b/src/vt/vrt/collection/balance/temperedlb/tempered_msgs.h
@@ -102,8 +102,8 @@ using RankSummaryType = std::tuple<BytesType, ClusterSummaryType>;
 inline auto format_as(ClusterInfo const& e) {
   auto fmt_str = "(load={},bytes={},intra=({},{})),home={},edge={}";
   return fmt::format(
-    fmt_str, e.load, e.bytes, e.intra_send_vol, e.intra_recv_vol,
-    e.home_node, e.edge_weight
+    fmt_str, e.load, e.bytes, e.intra_send_vol, e.intra_recv_vol, e.home_node,
+    e.edge_weight
   );
 }
 

@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch from 3ed309c to 0204739 Compare March 26, 2025 15:40
@cz4rs
Copy link
Contributor

cz4rs commented Mar 31, 2025

More issues in vt-tv code:

/vt/lib/vt-tv/tests/unit/render/test_render.cc:265:14: error: 'join' is not a member of 'fmt'
  265 |         fmt::join(cmd_vars, " "),
      |              ^~~~

I'll check if there are more and post a PR.

Remaining errors: cuda 11.2

/build/vt/release/vt/cmake_config.h:101:28: fatal error: fmt/base.h: No such file or directory
  101 |   #define INCLUDE_FMT_BASE <fmt/base.h>
      |     

intel icpc

/vt/lib/fmt/include/fmt-vt/base.h(437): error #186: pointless comparison of unsigned integer with zero
    FMT_ASSERT(std::is_unsigned<Int>::value || value >= 0, "negative value");
    ^
          detected during:
            instantiation of "auto fmt::v11::detail::to_unsigned(Int)->fmt::v11::make_unsigned_t<Int> [with Int=size_t={unsigned long}]" at line 528 of "/vt/lib/fmt/include/fmt-vt/format.h"
            instantiation of "auto fmt::v11::detail::fill_n(T *, Size, char)->T * [with T=char, Size=size_t={unsigned long}]" at line 823 of "/vt/lib/fmt/include/fmt-vt/format.h"
            instantiation of "fmt::v11::basic_memory_buffer<T, SIZE, Allocator>::basic_memory_buffer(const Allocator &) [with T=char, SIZE=500UL, Allocator=fmt::v11::detail::allocator<char>]" at line 117 of "/vt/lib/fmt/include/fmt-vt/ostream.h"

TODO:

  • re-enable -Werror for gcc-10 openmpi build and fix the root cause or use #pragma GCC diagnostic push
  • make vt-tv code work with latest fmt
  • icpc build is getting removed in Location manager should use objgroups #2209, no need to fix that warning

@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch 3 times, most recently from ec6d389 to 02c5cdc Compare April 1, 2025 19:53
Comment on lines 2034 to 2041
#if defined(__GNUC__) && !(defined(__clang__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
while (begin != end) *out++ = static_cast<T>(*begin++);
#if defined(__GNUC__) && !(defined(__clang__))
#pragma GCC diagnostic pop
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like something along the lines of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94335. Let's just stick with #pragma GCC diagnostic ignored for this specific line 🤷

@cz4rs
Copy link
Contributor

cz4rs commented Apr 1, 2025

After disabling external fmt in cuda-11.2 build (02c5cdc) we are now facing another error:

FAILED: lib/fmt/CMakeFiles/fmt.dir/src/format.cc.o 
/usr/bin/ccache /nvcc_wrapper/build/nvcc_wrapper -DFMT_OS=0 -I/vt/lib/fmt/include -Wno-deprecated-gpu-targets -O3 -DNDEBUG -std=c++17 -MD -MT lib/fmt/CMakeFiles/fmt.dir/src/format.cc.o -MF lib/fmt/CMakeFiles/fmt.dir/src/format.cc.o.d -o lib/fmt/CMakeFiles/fmt.dir/src/format.cc.o -c /vt/lib/fmt/src/format.cc
/vt/lib/fmt/include/fmt-vt/base.h(472): warning: loop is not reachable
          detected during:
            instantiation of "auto fmt::v11::detail::compare(const Char *, const Char *, std::size_t)->int [with Char=char]" 
(591): here
            instantiation of "auto fmt::v11::basic_string_view<Char>::compare(fmt::v11::basic_string_view<Char>) const->int [with Char=char]" 
(598): here
            instantiation of class "fmt::v11::basic_string_view<Char> [with Char=char]" 
(2621): here
            instantiation of "auto fmt::v11::basic_format_args<Context>::get_id(fmt::v11::basic_string_view<Char>) const->int [with Context=fmt::v11::context, Char=char]" 
(2664): here

/vt/lib/fmt/include/fmt-vt/format.h(2596): error: constexpr constructor calls non-constexpr function "fmt::v11::basic_memory_buffer<T, SIZE, Allocator>::basic_memory_buffer(const Allocator &) [with T=fmt::v11::detail::bigint::bigit, SIZE=32UL, Allocator=fmt::v11::detail::allocator<fmt::v11::detail::bigint::bigit>]"

Note for later: we still need to make sure that we test external fmt configuration in some build.

@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch from 02c5cdc to a15def4 Compare April 2, 2025 14:10
@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch 3 times, most recently from 1faad0d to 688d4a3 Compare April 8, 2025 11:46
@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch from 688d4a3 to 5f71f00 Compare April 8, 2025 12:50
@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch from 13a2066 to 63858da Compare April 9, 2025 16:21
@cz4rs cz4rs force-pushed the 2397-make-vt-work-with-fmt-11-and-integrate-it-if-possible branch 2 times, most recently from 33ee397 to c9a8c9a Compare April 11, 2025 12:27
@cz4rs
Copy link
Contributor

cz4rs commented Apr 11, 2025

Cuda 11.2 currently fails with:

/usr/local/include/fmt/format.h(2596): error: constexpr constructor calls non-constexpr function "fmt::v11::basic_memory_buffer<T, SIZE, Allocator>::basic_memory_buffer(const Allocator &) [with T=fmt::v11::detail::bigint::bigit, SIZE=32UL, Allocator=fmt::v11::detail::allocator<fmt::v11::detail::bigint::bigit>]"

This can be helped by setting FMT_USE_CONSTEXPR to 0 when Cuda is detected:

  list(APPEND TARGET_PRIVATE_CXX_FLAGS -DFMT_USE_CONSTEXPR=0)

Note: detecting nvcc in CMake is somewhat tricky, as CMAKE_CXX_COMPILER will report as GNU. See Kokkos' cmake/kokkos_compiler_id.cmake for a solution.

This gets us a bit closer, but the build is still failing with:

/usr/local/include/fmt/base.h(2235): error: incomplete type is not allowed
          detected during:
            instantiation of "fmt::v11::detail::value<Context>::value(const T &, fmt::v11::detail::custom_tag) [with Context=fmt::v11::context, T=vt::Index1D, <unnamed>=0]" 
(2208): here
            instantiation of "fmt::v11::detail::value<Context>::value(T &) [with Context=fmt::v11::context, T=const vt::Index1D, <unnamed>=0]" 
/usr/local/include/fmt/format.h(4190): here
            instantiation of "auto fmt::v11::format(fmt::v11::format_string<T...>, T &&...)->std::string [with T=<const vt::NodeType &, const vt::Index1D &>]" 
/vt/src/vt/configs/debug/debug_print.h(291): here
            instantiation of "void vt::config::debugPrintImpl<cat,mod,Arg,Args...>(vt::NodeType, Arg &&, Args &&...) [with cat=vt::config::vrt_coll, mod=vt::config::terse, Arg=const char (&)[40], Args=<const vt::NodeType &, const vt::Index1D &>]" 
/vt/src/vt/configs/debug/debug_print.h(325): here
            instantiation of "void vt::config::DebugPrintOp<cat, vt::config::node, mod>::operator()(__nv_bool, Arg &&, Args &&...) [with cat=vt::config::vrt_coll, mod=vt::config::terse, Arg=const char (&)[40], Args=<const vt::NodeType &, const vt::Index1D &>]" 
/vt/src/vt/configs/debug/debug_print.h(351): here
            [ 9 instantiation contexts not shown ]
            implicit generation of "vt::vrt::collection::Collection<ColT, IndexT>::Collection() [with ColT=vt::tests::unit::TestCol, IndexT=vt::Index1D]" 
/usr/include/c++/9/bits/unique_ptr.h(857): here
            instantiation of class "vt::vrt::collection::Collection<ColT, IndexT> [with ColT=vt::tests::unit::TestCol, IndexT=vt::Index1D]" 
/usr/include/c++/9/bits/unique_ptr.h(857): here
            implicit generation of "vt::tests::unit::TestCol::TestCol()" 
/usr/include/c++/9/bits/unique_ptr.h(857): here
            instantiation of "std::_MakeUniq<_Tp>::__single_object std::make_unique<_Tp,_Args...>(_Args &&...) [with _Tp=vt::tests::unit::TestCol, _Args=<>]" 
/vt/src/vt/vrt/collection/manager.impl.h(1254): here
            instantiation of "vt::vrt::collection::CollectionManager::IsDefaultConstructableType<ColT, ColT::IndexType> vt::vrt::collection::CollectionManager::constructCollective<ColT>(ColT::IndexType, const std::string &) [with ColT=vt::tests::unit::TestCol]" 
/vt/tests/unit/collection/test_collection_manager.cc(71): here

To be continued 🤷

Another thing to take care of: bump the required version of fmt which is currently set to 7.1.0 (we need this after removing custom formatters):

  find_package(fmt 7.1.0 REQUIRED)

@cz4rs
Copy link
Contributor

cz4rs commented Apr 16, 2025

Cuda 11.2 currently fails with (...)

Upgrading Cuda to 11.4.3 solves the issue without any additional modifications. If we can afford this upgrade, I think this is the preferred way to handle this.

@cz4rs cz4rs requested review from nlslatt and pierrepebay April 16, 2025 12:35
@cz4rs
Copy link
Contributor

cz4rs commented Apr 16, 2025

We currently require fmt 7.1.0, but this will no longer work after removing of custom formatters:

cmake/load_bundled_libraries.cmake:33:  find_package(fmt 7.1.0 REQUIRED)

We need to pick a higher version, but it doesn't have to be 11.1.3. distBVH uses 10.2.1 and I have been using that successfully on my local machine as well.

Copy link
Contributor

@cwschilly cwschilly left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple questions about includes

Comment on lines +51 to +53
#include <string>

#include INCLUDE_FMT_FORMAT
Copy link
Contributor

Choose a reason for hiding this comment

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

Is <string> included as part of fmt/format.h>?

@lifflander lifflander merged commit 3134643 into develop Apr 17, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make VT work with fmt 11 and integrate it if possible

4 participants