From a405c6993fc99c62e2af2579dcc44c290b5a8e99 Mon Sep 17 00:00:00 2001 From: cyy Date: Wed, 8 Feb 2023 17:21:35 +0000 Subject: [PATCH] [submodule] update libfmt to tag 9.1.0 (#93219) Pull Request resolved: https://github.com/pytorch/pytorch/pull/93219 Approved by: https://github.com/malfet, https://github.com/Skylion007, https://github.com/albanD --- WORKSPACE | 5 +++++ third_party/fmt | 2 +- third_party/kineto | 2 +- torch/csrc/Exceptions.cpp | 12 ++++-------- torch/csrc/distributed/rpc/utils.cpp | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 9ecb83b746ef..29badf579543 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -258,6 +258,11 @@ local_repository( path = "third_party/fbgemm", ) +local_repository( + name = "unused_ftm_bazel", + path = "third_party/fmt/support/bazel", +) + local_repository( name = "unused_kineto_dynolog_googletest", path = "third_party/kineto/libkineto/third_party/dynolog/third_party/googletest", diff --git a/third_party/fmt b/third_party/fmt index 7bdf0628b127..a33701196adf 160000 --- a/third_party/fmt +++ b/third_party/fmt @@ -1 +1 @@ -Subproject commit 7bdf0628b1276379886c7f6dda2cef2b3b374f0b +Subproject commit a33701196adfad74917046096bf5a2aa0ab0bb50 diff --git a/third_party/kineto b/third_party/kineto index a2d16d5f3874..2da532c91dee 160000 --- a/third_party/kineto +++ b/third_party/kineto @@ -1 +1 @@ -Subproject commit a2d16d5f3874910be4b500379258ce9b32b1c44f +Subproject commit 2da532c91dee9dc36cccc6088206daa1b69e3966 diff --git a/torch/csrc/Exceptions.cpp b/torch/csrc/Exceptions.cpp index 7de3126fcdde..788f67827300 100644 --- a/torch/csrc/Exceptions.cpp +++ b/torch/csrc/Exceptions.cpp @@ -1,11 +1,10 @@ #include #include +#include #include #include -#include #include -#include #include #include @@ -281,16 +280,13 @@ PyWarningHandler::~PyWarningHandler() noexcept(false) { } else { // Lets Python set the source location and puts the C++ warning // location into the message. - fmt::memory_buffer buf; - fmt::format_to( - buf, - FMT_STRING("{} (Triggered internally at {}:{}.)"), + auto buf = fmt::format( + "{} (Triggered internally at {}:{}.)", msg, source_location.file, source_location.line); - buf.push_back('\0'); result = - PyErr_WarnEx(map_warning_to_python_type(warning), buf.data(), 1); + PyErr_WarnEx(map_warning_to_python_type(warning), buf.c_str(), 1); } if (result < 0) { if (in_exception_) { diff --git a/torch/csrc/distributed/rpc/utils.cpp b/torch/csrc/distributed/rpc/utils.cpp index 0b76e64e1392..418c7bb5d17a 100644 --- a/torch/csrc/distributed/rpc/utils.cpp +++ b/torch/csrc/distributed/rpc/utils.cpp @@ -92,7 +92,7 @@ std::string makeRPCError( return fmt::format( "{}:{}:{}", torch::distributed::rpc::kRPCErrorPrefix, - errorType, + static_cast(errorType), rpcErrorStr); }