@@ -789,15 +789,15 @@ with `pip install ninja`. If PyTorch was already built, you will need
789789to run ` python setup.py clean ` once after installing ninja for builds to
790790succeed.
791791
792- Note: Make sure to use a machine with a larger number of CPU cores, this will significantly reduce your build times.
792+ Note: Make sure to use a machine with a larger number of CPU cores; this will significantly reduce your build times.
793793
794794#### Use CCache
795795
796796Even when dependencies are tracked with file modification, there are many
797797situations where files get rebuilt when a previous compilation was exactly the
798798same. Using ccache in a situation like this is a real time-saver.
799799
800- Before building pytorch , install ccache from your package manager of choice:
800+ Before building PyTorch , install ccache from your package manager of choice:
801801
802802``` bash
803803sudo apt install ccache
@@ -816,7 +816,7 @@ ccache -M 25Gi # -M 0 for unlimited
816816ccache -F 0
817817```
818818
819- To check this is working, do two clean builds of pytorch in a row. The second
819+ To check this is working, do two clean builds of PyTorch in a row. The second
820820build should be substantially and noticeably faster than the first build. If
821821this doesn't seem to be the case, check the ` CMAKE_<LANG>_COMPILER_LAUNCHER `
822822rules in ` build/CMakeCache.txt ` , where ` <LANG> ` is ` C ` , ` CXX ` and ` CUDA ` .
@@ -865,8 +865,8 @@ This adds a build step where the compiler takes `<ATen/ATen.h>` and essentially
865865dumps its internal AST to a file so the compiler can avoid repeating itself for
866866every ` .cpp ` file.
867867
868- One caveat is that when enabled, this header gets included in every file by default.
869- Which may change what code is legal, for example:
868+ One caveat is that when enabled, this header gets included in every file by default,
869+ which may change what code is legal, for example:
870870- internal functions can never alias existing names in ` <ATen/ATen.h> `
871871- names in ` <ATen/ATen.h> ` will work even if you don't explicitly include it.
872872
@@ -886,11 +886,11 @@ python -m pip install --no-build-isolation -v -e .
886886
887887### Rebuild few files with debug information
888888
889- While debugging a problem one often had to maintain a debug build in a separate folder.
890- But often only a few files needs to be rebuild with debug info to get a symbolicated backtrace or enable source debugging
889+ While debugging a problem, one often has to maintain a debug build in a separate folder.
890+ But often only a few files need to be rebuilt with debug info to get a symbolicated backtrace or enable source debugging.
891891One can easily solve this with the help of ` tools/build_with_debinfo.py `
892892
893- For example, suppose one wants to debug what is going on while tensor index is selected, which can be achieved by setting a breakpoint at ` applySelect ` function:
893+ For example, suppose one wants to debug what is going on while a tensor index is selected, which can be achieved by setting a breakpoint at ` applySelect ` function:
894894```
895895% lldb -o "b applySelect" -o "process launch" -- python3 -c "import torch;print(torch.rand(5)[3])"
896896(lldb) target create "python"
@@ -912,7 +912,7 @@ libtorch_python.dylib`at::indexing::impl::applySelect:
912912Target 0: (python) stopped.
913913Process 87729 launched: '/usr/bin/python' (arm64)
914914```
915- Which is not very informative, but can be easily remedied by rebuilding ` python_variable_indexing.cpp ` with debug information
915+ This is not very informative, but can be easily remedied by rebuilding ` python_variable_indexing.cpp ` with debug information.
916916```
917917% ./tools/build_with_debinfo.py torch/csrc/autograd/python_variable_indexing.cpp
918918[1 / 2] Building caffe2/torch/CMakeFiles/torch_python.dir/csrc/autograd/python_variable_indexing.cpp.o
@@ -942,7 +942,7 @@ Process 87741 stopped
942942Target 0: (python) stopped.
943943Process 87741 launched: '/usr/bin/python3' (arm64)
944944```
945- Which is much more useful, isn't it?
945+ This is much more useful, isn't it?
946946
947947### C++ frontend development tips
948948
@@ -956,10 +956,10 @@ Please follow the lead of the other tests to see how to write a new test case.
956956
957957### GDB integration
958958
959- If you are debugging pytorch inside GDB, you might be interested in
959+ If you are debugging PyTorch inside GDB, you might be interested in
960960[ pytorch-gdb] ( tools/gdb/pytorch-gdb.py ) . This script introduces some
961- pytorch -specific commands which you can use from the GDB prompt. In
962- particular, ` torch-tensor-repr ` prints a human-readable repr of an at::Tensor
961+ PyTorch -specific commands which you can use from the GDB prompt. In
962+ particular, ` torch-tensor-repr ` prints a human-readable representation of an at::Tensor
963963object. Example of usage:
964964
965965```
@@ -993,7 +993,7 @@ tensor([1., 2., 3., 4.], dtype=torch.float64)
993993```
994994
995995GDB tries to automatically load ` pytorch-gdb ` thanks to the
996- [ .gdbinit] ( .gdbinit ) at the root of the pytorch repo . However, auto-loadings is disabled by default, because of security reasons:
996+ [ .gdbinit] ( .gdbinit ) at the root of the PyTorch repository . However, auto-loading is disabled by default, because of security reasons:
997997
998998``` bash
999999$ gdb
@@ -1034,7 +1034,7 @@ If you are working on the CUDA code, here are some useful CUDA debugging tips:
10341034 `std::tuple` etc. in device code. Many of such features are possible because of the
10351035 [--expt-relaxed-constexpr](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#constexpr-functions)
10361036 nvcc flag. There is a known [issue](https://github.com/ROCm/hip/issues/374)
1037- that ROCm errors out on device code, which uses such stl functions.
1037+ that ROCm errors out on device code, which uses such STL functions.
103810384. A good performance metric for a CUDA kernel is the
10391039 [Effective Memory Bandwidth](https://devblogs.nvidia.com/how-implement-performance-metrics-cuda-cc/).
10401040 It is useful for you to measure this metric whenever you are writing/optimizing a CUDA
@@ -1289,7 +1289,7 @@ More information can be found
12891289
12901290We need `LD_PRELOAD` because there is a cmake check that ensures that a
12911291simple program builds and runs. If we are building with ASAN as a shared
1292- library, we need to `LD_PRELOAD` the runtime library, otherwise there will
1292+ library, we need to use `LD_PRELOAD` to load the runtime library, otherwise there will be
12931293dynamic linker errors and the check will fail.
12941294
12951295We don’t actually need either of these if we fix the cmake checks.
@@ -1361,7 +1361,7 @@ There are two possible choices for which commit to use:
13611361For all practical purposes, most people can think of the commit being used as
13621362commit `B` (choice **1**).
13631363
1364- However, if workflow files (which govern CI behavior) were modified (either by your PR or since dev branch were created ) there' s
1364+ However, if workflow files (which govern CI behavior) were modified (either by your PR or since dev branch was created) there' s
13651365a nuance to know about:
13661366The workflow files themselves get taken from checkpoint ` C` , the merger of your
13671367PR and the ` main` branch. But only the workflow files get taken from that merged
0 commit comments