Hotspots
Files that are both large and changed often are where bugs tend to cluster and where refactoring pays off first. Each file of code in the current tree, tests included, is placed by its size and by the number of commits that changed it, under this name or one it had before; its hotspot score is changes × √lines. Documentation, vendored and generated files, and files without counted lines, such as binary files, are left out.
- Files Analyzed
- 12,121
- of 22,374 in the current tree
- Top 10 Files
- 16.0%
- of the total hotspot score
- Median File Size
- 124 lines
- half of the files are at least this large
- Median Changes
- 10 commits
- half of the files changed at least this often
Change frequency by file size
Each dot is a file; a bigger dot is a higher score. The dashed lines mark the median file size and the median number of changes: the large files that change often, in the top right, are in color. The 5 highest scores are numbered as in the list. Both axes are logarithmic. Showing the 2,000 highest-scoring of 12,121 files.
Chart not shown: it is drawn with JavaScript, which is turned off or blocked on this page, as it is on Jenkins by default. How to show the charts
Highest scores
- 1torch/testing/_internal/common_methods_invocations.py27,076 lines · 2,882 changes
- 2aten/src/ATen/native/native_functions.yaml16,309 lines · 3,380 changes
- 3test/inductor/test_torchinductor.py25,374 lines · 1,856 changes
- 4test/test_torch.py12,422 lines · 2,366 changes
- 5test/test_nn.py19,254 lines · 1,841 changes
- 6test/test_autograd.py19,453 lines · 1,267 changes
- 7test/dynamo/test_misc.py22,327 lines · 1,155 changes
- 8test/test_cuda.py17,717 lines · 1,226 changes
Top hotspots
The files ranked by hotspot score: the larger a file is and the more often it changes, the higher it ranks. Authors is how many people have changed the file, bots aside, as on the Code Ownership page: a hotspot only one person has changed is also a bus-factor risk.
| File | Lines | Changes | Authors | Score | Bar |
|---|---|---|---|---|---|
| torch/testing/_internal/common_methods_invocations.py | 27,076 | 2,882 | 366 | 474,226.9 | |
| aten/src/ATen/native/native_functions.yaml | 16,309 | 3,380 | 415 | 431,648.6 | |
| test/inductor/test_torchinductor.py | 25,374 | 1,856 | 302 | 295,646.3 | |
| test/test_torch.py | 12,422 | 2,366 | 375 | 263,700.2 | |
| test/test_nn.py | 19,254 | 1,841 | 446 | 255,454.9 | |
| test/test_autograd.py | 19,453 | 1,267 | 221 | 176,713.6 | |
| test/dynamo/test_misc.py | 22,327 | 1,155 | 155 | 172,582.7 | |
| test/test_cuda.py | 17,717 | 1,226 | 252 | 163,187.0 | |
| torch/_inductor/ir.py | 13,058 | 1,355 | 177 | 154,838.0 | |
| test/export/test_export.py | 20,137 | 1,009 | 104 | 143,182.0 |
Table: the 100 highest-scoring of 12,121 files
| File | Lines | Changes | Authors | Score | Bar |
|---|---|---|---|---|---|
| torch/testing/_internal/common_methods_invocations.py | 27,076 | 2,882 | 366 | 474,226.9 | |
| aten/src/ATen/native/native_functions.yaml | 16,309 | 3,380 | 415 | 431,648.6 | |
| test/inductor/test_torchinductor.py | 25,374 | 1,856 | 302 | 295,646.3 | |
| test/test_torch.py | 12,422 | 2,366 | 375 | 263,700.2 | |
| test/test_nn.py | 19,254 | 1,841 | 446 | 255,454.9 | |
| test/test_autograd.py | 19,453 | 1,267 | 221 | 176,713.6 | |
| test/dynamo/test_misc.py | 22,327 | 1,155 | 155 | 172,582.7 | |
| test/test_cuda.py | 17,717 | 1,226 | 252 | 163,187.0 | |
| torch/_inductor/ir.py | 13,058 | 1,355 | 177 | 154,838.0 | |
| test/export/test_export.py | 20,137 | 1,009 | 104 | 143,182.0 | |
| test/test_mps.py | 16,395 | 1,075 | 138 | 137,646.2 | |
| torch/_torch_docs.py | 15,091 | 1,091 | 320 | 134,024.4 | |
| torch/_inductor/lowering.py | 10,406 | 1,210 | 201 | 123,431.9 | |
| torch/_inductor/codegen/triton.py | 9,852 | 1,047 | 165 | 103,922.3 | |
| test/functorch/test_aotdispatch.py | 13,851 | 843 | 121 | 99,212.9 | |
| torch/_inductor/scheduler.py | 13,848 | 812 | 141 | 95,554.2 | |
| torch/fx/experimental/symbolic_shapes.py | 9,801 | 926 | 93 | 91,674.0 | |
| torch/testing/_internal/common_utils.py | 7,223 | 1,074 | 249 | 91,277.4 | |
| test/inductor/test_aot_inductor.py | 13,911 | 769 | 160 | 90,699.6 | |
| torch/_meta_registrations.py | 9,840 | 874 | 202 | 86,698.0 | |
| torch/_dynamo/variables/builder.py | 6,241 | 1,091 | 129 | 86,189.0 | |
| test/test_linalg.py | 13,270 | 726 | 191 | 83,631.9 | |
| torch/_dynamo/symbolic_convert.py | 6,851 | 951 | 111 | 78,715.0 | |
| torch/_dynamo/utils.py | 6,402 | 961 | 142 | 76,892.0 | |
| torch/_inductor/codegen/wrapper.py | 7,137 | 888 | 145 | 75,018.9 | |
| torch/_inductor/utils.py | 6,412 | 914 | 178 | 73,188.5 | |
| test/dynamo/test_repros.py | 10,926 | 699 | 116 | 73,064.7 | |
| torch/nn/functional.py | 7,858 | 815 | 275 | 72,246.0 | |
| torch/_inductor/codecache.py | 5,962 | 922 | 148 | 71,191.3 | |
| tools/autograd/derivatives.yaml | 3,330 | 1,216 | 214 | 70,170.7 | |
| torch/_inductor/config.py | 3,722 | 1,143 | 208 | 69,732.4 | |
| torch/_dynamo/guards.py | 7,504 | 762 | 86 | 66,008.7 | |
| .ci/pytorch/test.sh | 3,064 | 1,173 | 245 | 64,929.5 | |
| torch/_C/__init__.pyi.in | 3,248 | 1,122 | 240 | 63,944.2 | |
| torch/distributed/distributed_c10d.py | 8,215 | 698 | 168 | 63,264.4 | |
| torch/csrc/distributed/c10d/init.cpp | 5,747 | 771 | 124 | 58,448.7 | |
| torch/_inductor/runtime/triton_heuristics.py | 6,291 | 736 | 147 | 58,376.4 | |
| torch/_dynamo/variables/user_defined.py | 6,213 | 719 | 100 | 56,673.4 | |
| torch/_inductor/select_algorithm.py | 6,997 | 671 | 115 | 56,127.9 | |
| torch/_dynamo/output_graph.py | 5,319 | 769 | 105 | 56,084.3 | |
| caffe2/CMakeLists.txt | 2,112 | 1,194 | 263 | 54,872.1 | |
| test/quantization/core/test_quantized_op.py | 9,797 | 547 | 113 | 54,141.9 | |
| torch/_refs/__init__.py | 7,324 | 629 | 124 | 53,830.1 | |
| torch/csrc/Module.cpp | 4,053 | 844 | 188 | 53,731.7 | |
| torch/_inductor/codegen/cpp.py | 6,495 | 664 | 111 | 53,512.8 | |
| torch/testing/_internal/distributed/distributed_test.py | 11,065 | 494 | 102 | 51,964.0 | |
| torch/_dynamo/variables/builtin.py | 4,145 | 801 | 105 | 51,569.7 | |
| torch/csrc/autograd/FunctionsManual.cpp | 9,053 | 529 | 103 | 50,332.9 | |
| torch/_dynamo/variables/torch.py | 5,153 | 691 | 114 | 49,603.0 | |
| torch/__init__.py | 3,618 | 810 | 233 | 48,721.3 | |
| test/distributed/test_c10d_nccl.py | 8,225 | 533 | 112 | 48,338.7 | |
| test/run_test.py | 2,867 | 890 | 204 | 47,654.5 | |
| torch/_decomp/decompositions.py | 6,550 | 588 | 162 | 47,588.1 | |
| test/inductor/test_flex_attention.py | 12,186 | 430 | 80 | 47,467.8 | |
| test/quantization/fx/test_quantize_fx.py | 9,920 | 470 | 63 | 46,811.6 | |
| build_variables.bzl | 1,708 | 1,116 | 254 | 46,122.0 | |
| test/dynamo/test_functions.py | 9,878 | 459 | 96 | 45,619.2 | |
| test/functorch/test_vmap.py | 6,915 | 536 | 78 | 44,571.9 | |
| test/inductor/test_max_autotune.py | 8,933 | 463 | 105 | 43,760.2 | |
| CMakeLists.txt | 1,545 | 1,107 | 255 | 43,512.3 | |
| torch/_inductor/compile_fx.py | 3,865 | 692 | 120 | 43,021.0 | |
| torch/_inductor/graph.py | 3,368 | 741 | 131 | 43,003.5 | |
| torch/_dynamo/trace_rules.py | 4,359 | 648 | 125 | 42,782.7 | |
| torch/_subclasses/fake_tensor.py | 4,703 | 619 | 96 | 42,450.0 | |
| torch/_tensor_docs.py | 6,981 | 506 | 180 | 42,277.5 | |
| torch/_dynamo/variables/functions.py | 5,095 | 591 | 91 | 42,185.1 | |
| test/inductor/test_cpu_repro.py | 8,195 | 463 | 103 | 41,913.6 | |
| benchmarks/dynamo/common.py | 4,993 | 592 | 104 | 41,831.4 | |
| torch/csrc/jit/frontend/ir_emitter.cpp | 5,896 | 539 | 78 | 41,387.3 | |
| .lintrunner.toml | 2,207 | 872 | 132 | 40,965.4 | |
| test/test_fx.py | 7,000 | 486 | 138 | 40,661.7 | |
| test/test_nestedtensor.py | 9,431 | 416 | 68 | 40,399.1 | |
| test/functorch/test_control_flow.py | 14,664 | 332 | 57 | 40,203.5 | |
| torch/_dynamo/variables/higher_order_ops.py | 6,677 | 488 | 66 | 39,875.9 | |
| aten/src/ATen/native/TensorShape.cpp | 4,877 | 565 | 148 | 39,457.1 | |
| test/test_transformers.py | 8,097 | 438 | 99 | 39,412.7 | |
| test/test_sparse.py | 6,058 | 506 | 135 | 39,383.6 | |
| test/test_dynamic_shapes.py | 8,772 | 418 | 68 | 39,149.4 | |
| torch/_dynamo/eval_frame.py | 3,083 | 654 | 103 | 36,313.2 | |
| c10/cuda/CUDACachingAllocator.cpp | 6,113 | 453 | 113 | 35,418.1 | |
| cmake/Dependencies.cmake | 1,831 | 811 | 198 | 34,702.8 | |
| torch/overrides.py | 2,339 | 709 | 179 | 34,289.5 | |
| torch/csrc/jit/python/init.cpp | 2,291 | 704 | 131 | 33,696.5 | |
| torch/_dynamo/variables/tensor.py | 4,218 | 518 | 103 | 33,642.1 | |
| torch/csrc/dynamo/guards.cpp | 9,524 | 340 | 65 | 33,180.9 | |
| test/functorch/test_ops.py | 3,064 | 596 | 72 | 32,990.6 | |
| test/test_fake_tensor.py | 7,483 | 380 | 82 | 32,871.6 | |
| tools/autograd/gen_variable_type.py | 2,315 | 678 | 112 | 32,621.6 | |
| torch/_inductor/codegen/common.py | 3,347 | 549 | 97 | 31,761.4 | |
| torch/_dynamo/graph_break_registry.json | 7,484 | 367 | 66 | 31,749.2 | |
| test/test_ops.py | 3,355 | 542 | 126 | 31,393.9 | |
| torch/_inductor/codegen/cpp_wrapper_cpu.py | 4,774 | 450 | 84 | 31,092.4 | |
| test/profiler/test_profiler.py | 5,877 | 401 | 110 | 30,741.3 | |
| test/test_proxy_tensor.py | 2,527 | 610 | 92 | 30,664.3 | |
| torch/csrc/autograd/python_variable.cpp | 3,995 | 485 | 112 | 30,654.9 | |
| torch/csrc/jit/runtime/register_prim_ops.cpp | 3,409 | 520 | 120 | 30,361.1 | |
| torch/_dynamo/convert_frame.py | 2,791 | 550 | 98 | 29,056.5 | |
| torch/testing/_internal/distributed/rpc/rpc_test.py | 6,190 | 367 | 56 | 28,874.3 | |
| torch/_dynamo/variables/misc.py | 3,054 | 519 | 84 | 28,681.5 | |
| torch/_inductor/codegen/simd.py | 6,883 | 340 | 59 | 28,207.7 |
How PyTorch compares with other open source AI and machine learning projects →
How PyTorch ranks among open source AI and machine learning projects by AI-assisted commits →
Generate this report for your own repository with gitstats-action · All Gallery reports
The smallest workflow
Publishes the report to GitHub Pages on every push to main: turn on Pages for the gh-pages branch.
# .github/workflows/gitstats.yml
name: GitStats Report
on:
push:
branches: [main]
permissions:
contents: write
jobs:
gitstats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: shenxianpeng/gitstats-action@v1
with:
deploy-to-pages: true