From 17175cdbc70660595fa4ef9b66cb8466cdfd09ca Mon Sep 17 00:00:00 2001 From: Sahdev Zala Date: Thu, 21 Mar 2024 17:00:43 +0000 Subject: [PATCH] [Docs] Add extended debugging options for troubleshooting (#122028) Fixes #120889 Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/122028 Approved by: https://github.com/ezyang, https://github.com/malfet --- docs/source/torch.compiler_troubleshooting.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/source/torch.compiler_troubleshooting.rst b/docs/source/torch.compiler_troubleshooting.rst index 3c5c24d9ff8..0614946340d 100644 --- a/docs/source/torch.compiler_troubleshooting.rst +++ b/docs/source/torch.compiler_troubleshooting.rst @@ -707,3 +707,18 @@ to detect bugs in our codegen or with a backend compiler. If you'd like to ensure that random number generation is the same across both torch and triton then you can enable ``torch._inductor.config.fallback_random = True`` + +Extended Debugging +~~~~~~~~~~~~~~~~~~ + +Extended debugging can be enabled by using the following experimental flags. + +``TORCHDYNAMO_EXTENDED_DEBUG_GUARD_ADDED`` - provides extended debug information if the +string representation of a guard matches this flag value. For example, set it to +"Ne(s0, 10)" to generate full Python and C++ backtrace whenever guard was issued. +``TORCHDYNAMO_EXTENDED_DEBUG_CREATE_SYMBOL`` - provides extended debug information when +a particular symbol is allocated. For example, set this to "u2" to generate full Python +and C++ backtrace whenever this symbol was created. +``TORCHDYNAMO_EXTENDED_DEBUG_CPP`` - provides extended debug information (C++ backtrace) +for all extended debug settings as well as errors. For example, set this to "1". The C++ +backtrace is slow and very spammy so it is not included by default with extended debugging.