From 0d7cdbee3e2a905d1a84c399816dcdae63a3beec Mon Sep 17 00:00:00 2001 From: morrison-turnansky Date: Tue, 26 Aug 2025 09:50:19 -0400 Subject: [PATCH 1/3] updated install command in cpp debugger md --- docs/source/contribute/cpp_debugger.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/contribute/cpp_debugger.md b/docs/source/contribute/cpp_debugger.md index 12d82a61d98..15839dbdf59 100644 --- a/docs/source/contribute/cpp_debugger.md +++ b/docs/source/contribute/cpp_debugger.md @@ -45,11 +45,11 @@ files you want to debug. All other source files are built and optimized as usual We suggest the following steps: 1. Identify the source file you want to debug. -1. Build that file with debug symbols using a command similar to `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp" python setup.py develop`. +1. Build that file with debug symbols using a command similar to `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp" python -m pip install --no-build-isolation -v -e .`. 1. Set a breakpoint and start a debugger session. As you debug you will discover additional files you want to debug. 1. Add those files to the `USE_CUSTOM_DEBINFO` environment variable. -1. Rebuild with a command similar to `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp;newfile.cpp" python setup.py develop`. +1. Rebuild with a command similar to `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp;newfile.cpp" python -m pip install --no-build-isolation -v -e .`. 1. Start your debugger session again. At this point, your PyTorch is built with debugging symbols and ready to debug @@ -62,7 +62,7 @@ For PyTorch, we recommend you do a full clean and rebuild each time. Unfortunately, touching a file to update its timestamp does not reliably cause that file to be rebuilt. -In the output of the `python setup.py develop` command, look for a line that +In the output of the `python -m pip install --no-build-isolation -v -e .` command, look for a line that starts with `Source files with custom debug infos` to make sure your file was built with debug symbols. For example: @@ -188,7 +188,7 @@ settings turns off building CUDA and turns on handling an environment variable to print dispatcher traces. ``` sh -USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp" USE_CUDA=0 LD_LIBRARY_PATH=/home/USERNAME/miniconda3/envs/torch310/lib CFLAGS="-DHAS_TORCH_SHOW_DISPATCH_TRACE" python setup.py develop +USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp" USE_CUDA=0 LD_LIBRARY_PATH=/home/USERNAME/miniconda3/envs/torch310/lib CFLAGS="-DHAS_TORCH_SHOW_DISPATCH_TRACE" python -m pip install --no-build-isolation -v -e . ``` ## Future Work From 2e1584eb28d5a4fdd14d9104e4746027d0a031e7 Mon Sep 17 00:00:00 2001 From: morrison-turnansky Date: Tue, 26 Aug 2025 15:13:38 -0400 Subject: [PATCH 2/3] updating according to reviewer comments --- docs/source/contribute/cpp_debugger.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/contribute/cpp_debugger.md b/docs/source/contribute/cpp_debugger.md index 15839dbdf59..cf5e9c75abc 100644 --- a/docs/source/contribute/cpp_debugger.md +++ b/docs/source/contribute/cpp_debugger.md @@ -45,11 +45,13 @@ files you want to debug. All other source files are built and optimized as usual We suggest the following steps: 1. Identify the source file you want to debug. -1. Build that file with debug symbols using a command similar to `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp" python -m pip install --no-build-isolation -v -e .`. +1. Build that file with debug symbols using a command similar to + `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp" python -m pip install --no-build-isolation -v -e .` 1. Set a breakpoint and start a debugger session. As you debug you will discover additional files you want to debug. 1. Add those files to the `USE_CUSTOM_DEBINFO` environment variable. -1. Rebuild with a command similar to `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp;newfile.cpp" python -m pip install --no-build-isolation -v -e .`. +1. Rebuild with a command similar to + `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp;newfile.cpp" python -m pip install --no-build-isolation -v -e .` 1. Start your debugger session again. At this point, your PyTorch is built with debugging symbols and ready to debug From 8e87b3ec151d654e4c1c38c9ca956c691e065c41 Mon Sep 17 00:00:00 2001 From: morrison-turnansky Date: Tue, 26 Aug 2025 15:14:46 -0400 Subject: [PATCH 3/3] formatting --- docs/source/contribute/cpp_debugger.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/contribute/cpp_debugger.md b/docs/source/contribute/cpp_debugger.md index cf5e9c75abc..899725c8621 100644 --- a/docs/source/contribute/cpp_debugger.md +++ b/docs/source/contribute/cpp_debugger.md @@ -45,12 +45,14 @@ files you want to debug. All other source files are built and optimized as usual We suggest the following steps: 1. Identify the source file you want to debug. -1. Build that file with debug symbols using a command similar to +1. Build that file with debug symbols using a command similar to + `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp" python -m pip install --no-build-isolation -v -e .` 1. Set a breakpoint and start a debugger session. As you debug you will discover additional files you want to debug. 1. Add those files to the `USE_CUSTOM_DEBINFO` environment variable. 1. Rebuild with a command similar to + `USE_CUSTOM_DEBINFO="aten/src/ATen/native/Linear.cpp;newfile.cpp" python -m pip install --no-build-isolation -v -e .` 1. Start your debugger session again.