[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
This commit is contained in:
cyy
2023-02-08 17:21:35 +00:00
committed by PyTorch MergeBot
parent 8ba87fa525
commit a405c6993f
5 changed files with 12 additions and 11 deletions

View File

@ -258,6 +258,11 @@ local_repository(
path = "third_party/fbgemm", path = "third_party/fbgemm",
) )
local_repository(
name = "unused_ftm_bazel",
path = "third_party/fmt/support/bazel",
)
local_repository( local_repository(
name = "unused_kineto_dynolog_googletest", name = "unused_kineto_dynolog_googletest",
path = "third_party/kineto/libkineto/third_party/dynolog/third_party/googletest", path = "third_party/kineto/libkineto/third_party/dynolog/third_party/googletest",

View File

@ -1,11 +1,10 @@
#include <torch/csrc/Exceptions.h> #include <torch/csrc/Exceptions.h>
#include <torch/csrc/python_headers.h> #include <torch/csrc/python_headers.h>
#include <array>
#include <cstdarg> #include <cstdarg>
#include <exception> #include <exception>
#include <sstream>
#include <utility> #include <utility>
#include <vector>
#include <fmt/format.h> #include <fmt/format.h>
#include <torch/csrc/THP.h> #include <torch/csrc/THP.h>
@ -281,16 +280,13 @@ PyWarningHandler::~PyWarningHandler() noexcept(false) {
} else { } else {
// Lets Python set the source location and puts the C++ warning // Lets Python set the source location and puts the C++ warning
// location into the message. // location into the message.
fmt::memory_buffer buf; auto buf = fmt::format(
fmt::format_to( "{} (Triggered internally at {}:{}.)",
buf,
FMT_STRING("{} (Triggered internally at {}:{}.)"),
msg, msg,
source_location.file, source_location.file,
source_location.line); source_location.line);
buf.push_back('\0');
result = 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 (result < 0) {
if (in_exception_) { if (in_exception_) {

View File

@ -92,7 +92,7 @@ std::string makeRPCError(
return fmt::format( return fmt::format(
"{}:{}:{}", "{}:{}:{}",
torch::distributed::rpc::kRPCErrorPrefix, torch::distributed::rpc::kRPCErrorPrefix,
errorType, static_cast<int>(errorType),
rpcErrorStr); rpcErrorStr);
} }