Skip to content

Files

Latest commit

386aa72 · Jun 7, 2025

History

History
This branch is 1982 commits behind pytorch/pytorch:main.

tools

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 29, 2024
Mar 11, 2025
May 21, 2025
Jun 25, 2022
May 25, 2025
Jul 19, 2024
Dec 11, 2024
Mar 4, 2025
Aug 27, 2021
Jun 29, 2024
Jun 4, 2025
Apr 22, 2025
Nov 19, 2024
Feb 24, 2025
Feb 24, 2025
Jan 4, 2025
May 22, 2025
Feb 24, 2025
Jun 29, 2024
Mar 26, 2025
May 16, 2025
May 27, 2025
Jun 16, 2022
Nov 27, 2024
May 31, 2025
May 16, 2023
May 20, 2025
Jun 7, 2025
Jun 4, 2025
Jun 7, 2025
Jun 29, 2022
Mar 28, 2023
Jul 18, 2020
May 23, 2023
Dec 29, 2024
May 6, 2025
Feb 10, 2025
Apr 27, 2025
Dec 11, 2024
Jan 14, 2022
Jan 24, 2025
Apr 1, 2025
Oct 22, 2018
Oct 22, 2018
Oct 22, 2018
Jun 6, 2025
Dec 11, 2024
Jan 4, 2025
Jun 29, 2024
Nov 15, 2023
Jan 28, 2024
Jul 17, 2024

This folder contains a number of scripts which are used as part of the PyTorch build process. This directory also doubles as a Python module hierarchy (thus the __init__.py).

Overview

Modern infrastructure:

  • autograd - Code generation for autograd. This includes definitions of all our derivatives.
  • jit - Code generation for JIT
  • shared - Generic infrastructure that scripts in tools may find useful.
    • module_loader.py - Makes it easier to import arbitrary Python files in a script, without having to add them to the PYTHONPATH first.

Build system pieces:

  • setup_helpers - Helper code for searching for third-party dependencies on the user system.
  • build_pytorch_libs.py - cross-platform script that builds all of the constituent libraries of PyTorch, but not the PyTorch Python extension itself.
  • build_libtorch.py - Script for building libtorch, a standalone C++ library without Python support. This build script is tested in CI.

Developer tools which you might find useful:

Important if you want to run on AMD GPU:

  • amd_build - HIPify scripts, for transpiling CUDA into AMD HIP. Right now, PyTorch and Caffe2 share logic for how to do this transpilation, but have separate entry-points for transpiling either PyTorch or Caffe2 code.
    • build_amd.py - Top-level entry point for HIPifying our codebase.

Tools which are only situationally useful:

  • docker - Dockerfile for running (but not developing) PyTorch, using the official conda binary distribution. Context: pytorch#1619
  • download_mnist.py - Download the MNIST dataset; this is necessary if you want to run the C++ API tests.