Name Date Size #Lines LOC

..--

alerts/H25-Apr-2025-322258

amd_build/H25-Apr-2025-216176

autograd/H25-Apr-2025-13,36310,116

bazel_tools/H25-Apr-2025-6538

build/bazel/H25-Apr-2025-231228

build_defs/H25-Apr-2025-426318

code_analyzer/H25-Apr-2025-923663

code_coverage/H25-Apr-2025-1,7121,289

config/H25-Apr-2025-10887

coverage_plugins_package/H25-Apr-2025-12287

dynamo/H25-Apr-2025-228169

flight_recorder/H25-Apr-2025-1,3191,063

gdb/H25-Apr-2025-5944

github/H25-Apr-2025-8369

iwyu/H25-Apr-2025-153117

jit/H25-Apr-2025-395315

linter/H25-Apr-2025-4,6673,831

lite_interpreter/H25-Apr-2025-186138

lldb/H25-Apr-2025-137110

onnx/H25-Apr-2025-494377

pyi/H25-Apr-2025-1,4921,279

rules/H25-Apr-2025-10896

rules_cc/H25-Apr-2025-8176

setup_helpers/H25-Apr-2025-1,031753

shared/H25-Apr-2025-3626

stats/H25-Apr-2025-2,1821,689

test/H25-Apr-2025-5,0534,226

testing/H25-Apr-2025-2,5391,942

BUCK.bzlH A D25-Apr-20258 KiB305282

BUCK.ossH A D25-Apr-2025284 119

README.mdH A D25-Apr-20252.6 KiB6047

__init__.pyH A D25-Apr-20250 10

bazel.bzlH A D25-Apr-20251.3 KiB4035

build_libtorch.pyH A D25-Apr-20251.1 KiB3524

build_pytorch_libs.pyH A D25-Apr-20253.3 KiB9569

build_with_debinfo.pyH A D25-Apr-20253.7 KiB11989

download_mnist.pyH A D25-Apr-20252.7 KiB9578

extract_scripts.pyH A D25-Apr-20253.1 KiB10680

gen_flatbuffers.shH A D25-Apr-2025485 1614

gen_vulkan_spv.pyH A D25-Apr-202524.2 KiB769586

generate_torch_version.pyH A D25-Apr-20253.5 KiB10785

generated_dirs.txtH A D25-Apr-202577 43

git_add_generated_dirs.shH A D25-Apr-2025353 142

git_reset_generated_dirs.shH A D25-Apr-2025357 142

nightly.pyH A D25-Apr-202522.6 KiB715573

nvcc_fix_deps.pyH A D25-Apr-20253.3 KiB12290

render_junit.pyH A D25-Apr-20253.2 KiB10887

substitute.pyH A D25-Apr-2025751 2920

update_masked_docs.pyH A D25-Apr-20251.6 KiB6147

vscode_settings.pyH A D25-Apr-20251.8 KiB6747

README.md

1This folder contains a number of scripts which are used as
2part of the PyTorch build process.  This directory also doubles
3as a Python module hierarchy (thus the `__init__.py`).
4
5## Overview
6
7Modern infrastructure:
8
9* [autograd](autograd) - Code generation for autograd.  This
10  includes definitions of all our derivatives.
11* [jit](jit) - Code generation for JIT
12* [shared](shared) - Generic infrastructure that scripts in
13  tools may find useful.
14  * [module_loader.py](shared/module_loader.py) - Makes it easier
15    to import arbitrary Python files in a script, without having to add
16    them to the PYTHONPATH first.
17
18Build system pieces:
19
20* [setup_helpers](setup_helpers) - Helper code for searching for
21  third-party dependencies on the user system.
22* [build_pytorch_libs.py](build_pytorch_libs.py) - cross-platform script that
23  builds all of the constituent libraries of PyTorch,
24  but not the PyTorch Python extension itself.
25* [build_libtorch.py](build_libtorch.py) - Script for building
26  libtorch, a standalone C++ library without Python support.  This
27  build script is tested in CI.
28
29Developer tools which you might find useful:
30
31* [git_add_generated_dirs.sh](git_add_generated_dirs.sh) and
32  [git_reset_generated_dirs.sh](git_reset_generated_dirs.sh) -
33  Use this to force add generated files to your Git index, so that you
34  can conveniently run diffs on them when working on code-generation.
35  (See also [generated_dirs.txt](generated_dirs.txt) which
36  specifies the list of directories with generated files.)
37
38Important if you want to run on AMD GPU:
39
40* [amd_build](amd_build) - HIPify scripts, for transpiling CUDA
41  into AMD HIP.  Right now, PyTorch and Caffe2 share logic for how to
42  do this transpilation, but have separate entry-points for transpiling
43  either PyTorch or Caffe2 code.
44  * [build_amd.py](amd_build/build_amd.py) - Top-level entry
45    point for HIPifying our codebase.
46
47Tools which are only situationally useful:
48
49* [docker](docker) - Dockerfile for running (but not developing)
50  PyTorch, using the official conda binary distribution.  Context:
51  https://github.com/pytorch/pytorch/issues/1619
52* [download_mnist.py](download_mnist.py) - Download the MNIST
53  dataset; this is necessary if you want to run the C++ API tests.
54
55[actions/github-script]: https://github.com/actions/github-script
56[flake8]: https://flake8.pycqa.org/en/latest/
57[github actions expressions]: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#about-contexts-and-expressions
58[pytorch/add-annotations-github-action]: https://github.com/pytorch/add-annotations-github-action
59[shellcheck]: https://github.com/koalaman/shellcheck
60