Open-Source Wikis

/

PyTorch

/

By the numbers

pytorch/pytorch

By the numbers

A factual snapshot of the repository as of commit c923d169b1 (April 30, 2026), main branch.

Size

Metric Value
Total commits in history 103,407
First commit 2012-01-25
Latest commit 2026-04-30
Repo age ~14 years
Top-level directories ~70
Tracked files ~75K

Lines of code (excluding build/, third_party/, .git/)

Language LOC
Python 569,640
C++ (.cpp) 860,369
C/C++ headers 398,685
CUDA (.cu) 86,531
Total (these) ~1.92M

(Plus YAML, CMake, BUCK/Bazel, shell, Markdown — ~100K extra.)

Activity (last 6 months)

Metric Value
Commits ~8,183
Unique committer emails 860
Approximate weekly throughput ~315 commits

Bot share

Metric Value
Total commits with bot/noreply in author email 10,564
Bot share of total history ~10.2%

The largest single source of bot commits is the merge bot (facebook-github-bot, then pytorchbot) landing PRs through ghstack. Most of the human-authored work shows up in the merge commit.

Top-level directory sizes

Directory Approx LOC Notes
aten/ ~600K ATen tensor library (C++)
torch/ ~1.3M Python + torch/csrc/ C++
c10/ ~70K Core C++
tools/ ~80K Codegen, build, lint
torchgen/ ~20K The codegen Python package
test/ ~700K Test suite
benchmarks/ ~50K Microbenchmarks + nightly perf jobs
third_party/ (gitmodules) ~50 modules NCCL, FBGEMM, kineto, cutlass, …

Largest files

File Approx LOC Notes
torch/_torch_docs.py ~12,000 Docstrings for every torch.* op
torch/__init__.py ~3,500 Public surface
aten/src/ATen/native/native_functions.yaml ~17,000 The op registry
tools/autograd/derivatives.yaml ~3,000 Backward formulas
.lintrunner.toml ~3,000 Lint configuration

Test surface

Layer Approx files
test/ 1,000+ Python test files
test/inductor/ ~100 inductor-specific tests
test/distributed/ ~150 distributed tests
aten/src/ATen/test/ ~80 C++ unit tests
c10/test/ ~40 C++ unit tests
test/cpp/ ~60 C++ tests for the C++ frontend

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – PyTorch wiki | Factory