pytorch/c10/util
Edward Z. Yang de3ae93e9b Include rank of default PG in C++ log messages (#110623)
I tested by adding some warning logs in C++, run a distributed program and show that they now had `[rank0]:` in the messages. There is no existing test infra for C++ logging so I couldn't easily add a unit test.

The implementation strategy is to setup a global variable in C++, and then poke it when we initialize a process group. This was the simplest thing I could think of that would work.

This PR only works for non-glog logging. Probably need to come up with some other strategy for glog, e.g., a custom prefix, but need to make sure this doesn't conflict with fbcode. I can't easily test this from OSS, will leave as follow up work.

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110623
Approved by: https://github.com/voznesenskym, https://github.com/wanchaol, https://github.com/fduwjj
2023-10-10 00:26:52 +00:00
..
accumulate.h Clang-Tidy: use modern for each loops and transparent functors (#91449) 2022-12-29 23:37:51 +00:00
AlignOf.h Add missing clang-tidy fixes for modernize-use-equals-(default|delete) (#91857) 2023-01-11 01:16:05 +00:00
ArrayRef.h [Reland] Elimates c10::guts::to_string (#108748) 2023-09-07 13:35:17 +00:00
Backtrace.cpp [Fix]: remove unnecessary copies in aten, c10, and torch bindings (#90629) 2022-12-12 17:05:52 +00:00
Backtrace.h Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
BFloat16-inl.h migrate PyTorch to c10::bit_cast (#98418) 2023-04-06 19:38:06 +00:00
BFloat16-math.h [cpu] vectorize atanh (#107786) 2023-09-26 20:20:46 +00:00
BFloat16.h Add bf16 and change header file include path (#91838) 2023-01-11 15:18:56 +00:00
bit_cast.h migrate PyTorch to c10::bit_cast (#98418) 2023-04-06 19:38:06 +00:00
bits.h Add various uninterpreted bit tensor data types (try 2) (#95860) 2023-03-04 03:35:59 +00:00
Bitset.h More tidy fixes (#93069) 2023-01-27 06:40:50 +00:00
BUILD.bazel
build.bzl migrate PyTorch to c10::bit_cast (#98418) 2023-04-06 19:38:06 +00:00
C++17.cpp
C++17.h Revert "Eliminate c10::guts::make_unique_base (#109429)" 2023-09-19 15:47:00 +00:00
CallOnce.h [RELAND] [ATen] Update pre-compiled header (#108149) 2023-09-20 20:38:30 +00:00
complex_math.cpp
complex_math.h Don't use thrust::log(complex) in CUDA as it takes a FOREVER to compile (#107559) 2023-08-21 05:47:49 +00:00
complex_utils.h Logcumsumexp for CPU (#93153) 2023-01-27 22:29:33 +00:00
complex.h Fix complex variable notation for division operator to be consistent. (#98057) 2023-04-05 12:06:20 +00:00
ConstexprCrc.h
copysign.h
DeadlockDetection.cpp
DeadlockDetection.h
Deprecated.h
DimVector.h Store SymInt out of line (#84390) 2022-09-06 20:24:39 +00:00
either.h Revert "Remove c10::either (#109299)" 2023-09-17 22:05:47 +00:00
env.h Not explicitly set the manifest filename in Windows (#91988) 2023-01-11 22:28:08 +00:00
Exception.cpp Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
Exception.h [2/N] Move c10::variant to std::variant (#109723) 2023-09-24 02:47:43 +00:00
ExclusivelyOwned.h
ExclusivelyOwnedTensorTraits.h
FbcodeMaps.h [PyTorch] add c10/util/FbcodeMaps.h (#96359) 2023-03-10 02:18:16 +00:00
flags_use_gflags.cpp adjust header inclusions in C10 as sugguested by IWYU (#102467) 2023-05-31 19:19:10 +00:00
flags_use_no_gflags.cpp More tidy fixes (#93069) 2023-01-27 06:40:50 +00:00
Flags.h Fix typos under c10 directory (#98079) 2023-03-31 18:31:11 +00:00
flat_hash_map.h [pytorch] Suppress C4624 warnings on Windows (#106348) 2023-08-02 01:57:21 +00:00
Float8_e4m3fn-inl.h Add torch.float8_e5m2 and torch.float8_e4m3 data types (#104242) 2023-07-20 16:09:11 +00:00
Float8_e4m3fn.cpp Add torch.float8_e5m2 and torch.float8_e4m3 data types (#104242) 2023-07-20 16:09:11 +00:00
Float8_e4m3fn.h add path for DPC++ SYCL device code in Float8_e4m3fn (#109911) 2023-09-23 07:07:22 +00:00
Float8_e5m2-inl.h Add torch.float8_e5m2 and torch.float8_e4m3 data types (#104242) 2023-07-20 16:09:11 +00:00
Float8_e5m2.cpp Add torch.float8_e5m2 and torch.float8_e4m3 data types (#104242) 2023-07-20 16:09:11 +00:00
Float8_e5m2.h Add torch.float8_e5m2 and torch.float8_e4m3 data types (#104242) 2023-07-20 16:09:11 +00:00
floating_point_utils.h Add torch.float8_e5m2 and torch.float8_e4m3 data types (#104242) 2023-07-20 16:09:11 +00:00
FunctionRef.h [BE] Get rid of std::result_of in c10 (#85977) 2022-09-30 23:13:42 +00:00
Half-inl.h Add scalar conversion using avx instructions for half (#102140) 2023-08-30 13:26:53 +00:00
Half.cpp
Half.h [BE] Use C10_CLANG_DIAGNOSTIC macros (#106084) 2023-07-27 16:53:50 +00:00
hash.h Clang-Tidy: use modern for each loops and transparent functors (#91449) 2022-12-29 23:37:51 +00:00
IdWrapper.h Fix missing include for size_t (#84088) 2022-08-26 03:11:46 +00:00
in_place.h
int128.cpp increase clang-tidy coverage to more c10 source files (#102902) 2023-06-04 06:33:01 +00:00
int128.h
intrusive_ptr.cpp
intrusive_ptr.h [Reland] Add -Wdeprecated and related fixes (#110019) 2023-09-28 03:34:29 +00:00
irange.h Fix spurious "missing return" error in irange.h (#102785) 2023-06-02 09:23:29 +00:00
LeftRight.cpp
LeftRight.h [T153220354] Fix header inclusions in c10 (#1541) (#101846) 2023-05-20 19:35:14 +00:00
llvmMathExtras.h migrate PyTorch to c10::bit_cast (#98418) 2023-04-06 19:38:06 +00:00
Load.h
logging_is_google_glog.h Fix TORCH_CHECK macros when glog is used (#83216) 2022-08-11 15:27:45 +00:00
logging_is_not_google_glog.h [RELAND] Remove some unnecessary <iostream> includes from headers (#108150) 2023-09-20 21:55:15 +00:00
Logging.cpp Include rank of default PG in C++ log messages (#110623) 2023-10-10 00:26:52 +00:00
Logging.h Include rank of default PG in C++ log messages (#110623) 2023-10-10 00:26:52 +00:00
math_compat.h
MathConstants.cpp Use c10 math constants consistently in Math.h (#91967) 2023-01-12 11:53:52 +00:00
MathConstants.h Use c10 math constants consistently in Math.h (#91967) 2023-01-12 11:53:52 +00:00
MaybeOwned.h [Reland] Add -Wdeprecated and related fixes (#110019) 2023-09-28 03:34:29 +00:00
Metaprogramming.cpp
Metaprogramming.h Eliminates c10::guts::array (#109423) 2023-09-16 09:18:03 +00:00
numa.cpp Enable misc clang-tidy checks (#110283) 2023-09-30 10:39:52 +00:00
numa.h [T153220354] Fix header inclusions in c10 (#1541) (#101846) 2023-05-20 19:35:14 +00:00
Optional.cpp
Optional.h [Reland] Add -Wdeprecated and related fixes (#110019) 2023-09-28 03:34:29 +00:00
OptionalArrayRef.h [Reland] increase clang-tidy coverage in torch/csrc (#108875) 2023-09-12 00:54:53 +00:00
order_preserving_flat_hash_map.h Fix typos under c10 directory (#98079) 2023-03-31 18:31:11 +00:00
overloaded.h
python_stub.h
qint8.h
qint32.h
quint2x4.h
quint4x2.h
quint8.h
Registry.h add missing include on <stdexcept> from Registry.h (#100036) 2023-04-26 03:59:20 +00:00
safe_numerics.h Add overflow check for stride calculation (#94900) 2023-04-09 01:30:55 +00:00
ScopeExit.h
signal_handler.cpp increase clang-tidy coverage to more c10 source files (#102902) 2023-06-04 06:33:01 +00:00
signal_handler.h adjust header inclusions in C10 as sugguested by IWYU (#102467) 2023-05-31 19:19:10 +00:00
SmallBuffer.h Fix typos under c10 directory (#98079) 2023-03-31 18:31:11 +00:00
SmallVector.cpp increase clang-tidy coverage to more c10 source files (#102902) 2023-06-04 06:33:01 +00:00
SmallVector.h [Reland] Add -Wdeprecated and related fixes (#110019) 2023-09-28 03:34:29 +00:00
sparse_bitset.h
ssize.h backport std::ssize to c10 (#97442) 2023-03-24 17:56:05 +00:00
static_tracepoint_elfx86.h [caffe2] Replace CAFFE_ prefixes in static_tracepoint.h macros with TORCH_ (#106380) 2023-08-03 21:51:36 +00:00
static_tracepoint.h [caffe2][SDT] Check whether TORCH_DISABLE_SDT macro is defined before referencing it (#107149) 2023-08-16 19:52:12 +00:00
strides.h Fix typos under c10 directory (#98079) 2023-03-31 18:31:11 +00:00
string_utils.h Revert "Eliminate c10::stoi,c10::stod,c10::stoull,c10::stoll (#109179)" 2023-09-18 18:41:12 +00:00
string_view.h fix typo (#109965) 2023-09-27 03:32:04 +00:00
StringUtil.cpp Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
StringUtil.h
strong_type.h Consistent compute numel/contiguous strategy with SymInts (#85858) 2022-09-30 21:26:34 +00:00
Synchronized.h Fix typos under c10 directory (#98079) 2023-03-31 18:31:11 +00:00
tempfile.cpp [Reland] fix c10:TempFile APIs on Windows (#108508) 2023-09-10 16:58:41 +00:00
tempfile.h [Reland] fix c10:TempFile APIs on Windows (#108508) 2023-09-10 16:58:41 +00:00
thread_name.cpp
thread_name.h
ThreadLocal.h
ThreadLocalDebugInfo.cpp cleanup unused include (#93359) 2023-02-04 02:15:50 +00:00
ThreadLocalDebugInfo.h cleanup unused include (#93359) 2023-02-04 02:15:50 +00:00
Type_demangle.cpp Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
Type_no_demangle.cpp Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
Type.h [T153220354] Fix header inclusions in c10 (#1541) (#101846) 2023-05-20 19:35:14 +00:00
TypeCast.cpp
TypeCast.h Add torch.float8_e5m2 and torch.float8_e4m3 data types (#104242) 2023-07-20 16:09:11 +00:00
typeid.cpp [PyTorch] Further reduce cost of TypeMeta::_typeMetaData (by 10x!) (#98105) 2023-04-12 17:44:48 +00:00
typeid.h [T153220354] Fix header inclusions in c10 (#1541) (#101846) 2023-05-20 19:35:14 +00:00
TypeIndex.h Intel compiler support in c10/util/TypeIndex.h (#89610) 2022-12-02 05:32:21 +00:00
TypeList.cpp
TypeList.h remove c10::guts::{max,min} (#102952) 2023-06-06 05:40:30 +00:00
TypeSafeSignMath.h
TypeTraits.cpp
TypeTraits.h [T153220354] Fix header inclusions in c10 (#1541) (#101846) 2023-05-20 19:35:14 +00:00
Unicode.cpp
Unicode.h
UniqueVoidPtr.cpp
UniqueVoidPtr.h Revert "Reland: implement a function to convert a storage to copy-on-write (#110022)" 2023-09-27 15:05:41 +00:00
Unroll.h Fix typos under c10 directory (#98079) 2023-03-31 18:31:11 +00:00
variant.h Remove unnecessary copy constructor (#83030) 2022-08-09 01:07:13 +00:00
win32-headers.h