Files that are both large and changed often are where bugs tend to cluster and where refactoring pays off first. Each file in the current tree is placed by its size and by the number of commits that changed it; its hotspot score is changes × √lines. Files without counted lines, such as binary files, are left out.
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, so the large files that change often are in the top right. Both axes are logarithmic. Showing the 2,000 highest-scoring of 12,778 files.
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 | |
|---|---|---|---|---|---|
| torch/testing/_internal/common_methods_invocations.py | 27,018 | 2,771 | 351 | 455,473.5 | |
| aten/src/ATen/native/native_functions.yaml | 16,254 | 3,336 | 426 | 425,310.6 | |
| test/inductor/test_torchinductor.py | 23,388 | 1,785 | 289 | 272,982.5 | |
| test/test_jit.py | 16,358 | 1,998 | 221 | 255,541.0 | |
| test/test_torch.py | 11,910 | 2,332 | 371 | 254,498.0 | |
| test/test_nn.py | 18,143 | 1,797 | 441 | 242,048.6 | |
| test/test_autograd.py | 19,190 | 1,252 | 217 | 173,437.0 | |
| test/dynamo/test_misc.py | 20,903 | 1,120 | 148 | 161,928.1 | |
| torch/_inductor/ir.py | 12,643 | 1,338 | 177 | 150,446.2 | |
| test/test_cuda.py | 15,574 | 1,188 | 251 | 148,257.4 |
| File | Lines | Changes | Authors | Score | |
|---|---|---|---|---|---|
| torch/testing/_internal/common_methods_invocations.py | 27,018 | 2,771 | 351 | 455,473.5 | |
| aten/src/ATen/native/native_functions.yaml | 16,254 | 3,336 | 426 | 425,310.6 | |
| test/inductor/test_torchinductor.py | 23,388 | 1,785 | 289 | 272,982.5 | |
| test/test_jit.py | 16,358 | 1,998 | 221 | 255,541.0 | |
| test/test_torch.py | 11,910 | 2,332 | 371 | 254,498.0 | |
| test/test_nn.py | 18,143 | 1,797 | 441 | 242,048.6 | |
| test/test_autograd.py | 19,190 | 1,252 | 217 | 173,437.0 | |
| test/dynamo/test_misc.py | 20,903 | 1,120 | 148 | 161,928.1 | |
| torch/_inductor/ir.py | 12,643 | 1,338 | 177 | 150,446.2 | |
| test/test_cuda.py | 15,574 | 1,188 | 251 | 148,257.4 | |
| test/export/test_export.py | 19,853 | 993 | 104 | 139,914.4 | |
| test/test_mps.py | 17,005 | 1,026 | 131 | 133,793.7 | |
| torch/_torch_docs.py | 15,008 | 1,071 | 319 | 131,205.1 | |
| torch/_inductor/lowering.py | 9,953 | 1,176 | 194 | 117,323.3 | |
| torch/_inductor/codegen/triton.py | 9,452 | 1,006 | 161 | 97,804.7 | |
| torch/_inductor/scheduler.py | 13,239 | 784 | 137 | 90,207.7 | |
| torch/fx/experimental/symbolic_shapes.py | 9,779 | 910 | 94 | 89,988.8 | |
| torch/_dynamo/variables/builder.py | 5,936 | 1,061 | 129 | 81,745.2 | |
| torch/_meta_registrations.py | 9,528 | 837 | 203 | 81,700.8 | |
| test/inductor/test_aot_inductor.py | 11,873 | 738 | 155 | 80,414.9 | |
| test/functorch/test_aotdispatch.py | 13,482 | 678 | 117 | 78,723.9 | |
| torch/_dynamo/symbolic_convert.py | 6,850 | 922 | 113 | 76,309.1 | |
| test/test_linalg.py | 12,096 | 683 | 182 | 75,117.6 | |
| torch/_dynamo/utils.py | 6,300 | 939 | 142 | 74,530.8 | |
| test/onnx/test_pytorch_onnx_onnxruntime.py | 13,980 | 625 | 103 | 73,898.2 | |
| torch/testing/_internal/common_utils.py | 6,934 | 865 | 212 | 72,029.1 | |
| test/dynamo/test_repros.py | 10,743 | 691 | 116 | 71,621.1 | |
| tools/autograd/derivatives.yaml | 3,311 | 1,212 | 219 | 69,740.0 | |
| torch/nn/functional.py | 7,516 | 802 | 273 | 69,529.3 | |
| torch/_inductor/utils.py | 6,058 | 890 | 176 | 69,271.5 | |
| torch/_inductor/codecache.py | 5,828 | 900 | 147 | 68,707.2 | |
| torch/_inductor/codegen/wrapper.py | 6,440 | 851 | 143 | 68,292.4 | |
| torch/_inductor/config.py | 3,495 | 1,098 | 197 | 64,912.1 | |
| torch/distributed/distributed_c10d.py | 8,466 | 682 | 169 | 62,751.4 | |
| torch/_dynamo/guards.py | 7,159 | 720 | 82 | 60,919.8 | |
| torch/_C/__init__.pyi.in | 3,202 | 1,073 | 241 | 60,717.0 | |
| caffe2/CMakeLists.txt | 2,293 | 1,175 | 269 | 56,265.2 | |
| torch/csrc/distributed/c10d/init.cpp | 5,400 | 749 | 124 | 55,040.0 | |
| torch/_inductor/select_algorithm.py | 6,765 | 654 | 109 | 53,791.3 | |
| torch/_refs/__init__.py | 7,325 | 626 | 124 | 53,577.0 | |
| torch/_inductor/codegen/cpp.py | 6,472 | 659 | 110 | 53,015.7 | |
| torch/_dynamo/output_graph.py | 4,983 | 749 | 103 | 52,872.2 | |
| torch/_dynamo/variables/user_defined.py | 6,146 | 671 | 98 | 52,604.0 | |
| torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp | 6,233 | 656 | 121 | 51,790.8 | |
| torch/testing/_internal/distributed/distributed_test.py | 11,032 | 488 | 106 | 51,256.3 | |
| torch/csrc/autograd/FunctionsManual.cpp | 9,059 | 521 | 103 | 49,588.1 | |
| torch/csrc/Module.cpp | 3,692 | 804 | 188 | 48,852.5 | |
| torch/_dynamo/variables/builtin.py | 4,206 | 752 | 102 | 48,770.0 | |
| torch/__init__.py | 3,610 | 792 | 234 | 47,586.0 | |
| torch/_dynamo/variables/torch.py | 4,902 | 658 | 113 | 46,069.4 | |
| test/distributed/test_c10d_nccl.py | 7,846 | 519 | 110 | 45,971.8 | |
| torch/_decomp/decompositions.py | 6,391 | 573 | 158 | 45,807.8 | |
| CMakeLists.txt | 1,675 | 1,092 | 258 | 44,692.0 | |
| test/run_test.py | 2,581 | 860 | 208 | 43,691.0 | |
| test/inductor/test_flex_attention.py | 11,795 | 399 | 78 | 43,333.3 | |
| torch/_dynamo/variables/functions.py | 6,063 | 556 | 89 | 43,293.1 | |
| torch/_tensor_docs.py | 6,934 | 504 | 181 | 41,968.4 | |
| torch/_inductor/graph.py | 3,321 | 727 | 129 | 41,895.6 | |
| benchmarks/dynamo/common.py | 5,055 | 589 | 107 | 41,877.0 | |
| torch/_inductor/compile_fx.py | 3,821 | 677 | 121 | 41,848.2 | |
| torch/_dynamo/trace_rules.py | 4,318 | 634 | 129 | 41,661.1 | |
| torch/_inductor/runtime/triton_heuristics.py | 5,716 | 551 | 117 | 41,657.9 | |
| test/inductor/test_cpu_repro.py | 8,042 | 454 | 99 | 40,713.4 | |
| test/dynamo/test_functions.py | 8,562 | 431 | 89 | 39,880.9 | |
| test/test_nestedtensor.py | 9,409 | 411 | 68 | 39,867.0 | |
| test/inductor/test_max_autotune.py | 8,032 | 442 | 98 | 39,612.7 | |
| .lintrunner.toml | 2,152 | 851 | 130 | 39,477.6 | |
| aten/src/ATen/native/TensorShape.cpp | 4,876 | 561 | 150 | 39,173.7 | |
| torch/_dynamo/variables/higher_order_ops.py | 6,609 | 479 | 68 | 38,940.7 | |
| test/test_sparse.py | 5,931 | 498 | 130 | 38,352.5 | |
| test/functorch/test_control_flow.py | 14,331 | 319 | 55 | 38,188.2 | |
| test/test_fx.py | 6,163 | 474 | 135 | 37,211.3 | |
| .ci/pytorch/test.sh | 2,889 | 682 | 153 | 36,657.1 | |
| torch/_subclasses/fake_tensor.py | 4,003 | 570 | 98 | 36,063.5 | |
| test/test_transformers.py | 7,705 | 406 | 92 | 35,637.9 | |
| torch/_dynamo/eval_frame.py | 3,032 | 646 | 108 | 35,571.1 | |
| test/test_dynamic_shapes.py | 7,763 | 399 | 62 | 35,155.0 | |
| cmake/Dependencies.cmake | 1,844 | 799 | 200 | 34,310.5 | |
| tools/autograd/gen_variable_type.py | 2,315 | 678 | 114 | 32,621.6 | |
| c10/cuda/CUDACachingAllocator.cpp | 5,949 | 419 | 107 | 32,317.4 | |
| torch/csrc/dynamo/guards.cpp | 9,162 | 329 | 63 | 31,491.3 | |
| torch/_dynamo/variables/tensor.py | 3,944 | 499 | 98 | 31,337.8 | |
| torch/_inductor/codegen/common.py | 3,300 | 545 | 95 | 31,307.9 | |
| torch/overrides.py | 2,337 | 632 | 164 | 30,552.5 | |
| torch/csrc/autograd/python_variable.cpp | 3,975 | 481 | 115 | 30,325.9 | |
| test/test_ops.py | 3,283 | 528 | 126 | 30,253.1 | |
| torch/_inductor/codegen/cpp_wrapper_cpu.py | 4,680 | 440 | 81 | 30,100.6 | |
| test/quantization/fx/test_quantize_fx.py | 9,939 | 296 | 55 | 29,509.6 | |
| test/test_proxy_tensor.py | 2,409 | 597 | 89 | 29,301.7 | |
| torch/_dynamo/convert_frame.py | 2,768 | 535 | 94 | 28,147.3 | |
| torch/_dynamo/graph_break_registry.json | 6,947 | 329 | 58 | 27,421.7 | |
| test/dynamo/test_higher_order_ops.py | 7,748 | 311 | 57 | 27,375.1 | |
| torch/_dynamo/variables/misc.py | 2,950 | 493 | 83 | 26,776.8 | |
| aten/src/ATen/native/LinearAlgebra.cpp | 3,846 | 429 | 122 | 26,604.9 | |
| torch/_inductor/codegen/simd.py | 6,319 | 314 | 58 | 24,960.5 | |
| torch/fx/experimental/proxy_tensor.py | 3,705 | 410 | 74 | 24,956.2 | |
| torch/utils/cpp_extension.py | 3,464 | 420 | 166 | 24,719.4 | |
| torch/nn/modules/module.py | 3,066 | 445 | 170 | 24,640.3 | |
| test/inductor/test_cudagraph_trees.py | 7,897 | 277 | 56 | 24,615.6 | |
| c10/core/TensorImpl.h | 3,409 | 411 | 103 | 23,996.9 |