pytorch/tools
Richard Barnes 3705e65254 Add pin_memory to torch.Tensor type annotation args (#109797)
Test Plan: Sandcastle

Differential Revision: D49504528

Pull Request resolved: https://github.com/pytorch/pytorch/pull/109797
Approved by: https://github.com/jianyuh
2023-09-26 17:12:37 +00:00
..
alerts Revert "add oncall info individual info to failing alert job alert (#103915)" 2023-06-21 23:06:45 +00:00
amd_build Remove redundant change for gloo (#106750) 2023-09-26 03:46:14 +00:00
autograd Avoid saving self for mean.backward (#109935) 2023-09-23 11:50:54 +00:00
bazel_tools
build/bazel Bump certifi from 2023.5.7 to 2023.7.22 in /tools/build/bazel (#105983) 2023-07-27 10:23:56 -07:00
build_defs Back out "[aarch64][tools/build_defs/third_party/fbcode_defs.bzl] Fix dep handling in cross-builds" 2023-05-01 16:27:51 -07:00
code_analyzer [gen_operators_yaml] add arguments to control include_all_overloads (#108396) 2023-09-02 17:37:36 +00:00
code_coverage [Reland] Update mypy to 1.4.1 (#105227) 2023-07-15 20:30:20 +00:00
config
coverage_plugins_package [BE] Enable ruff's UP rules and autoformat tools and scripts (#105428) 2023-07-19 01:24:44 +00:00
dynamo Move has_triton to top level triton utils so that dynamo can also access (#109832) 2023-09-22 19:33:41 +00:00
gdb [BE] f-stringify torch/ and scripts (#105538) 2023-07-21 19:35:24 +00:00
github fix upload alerts to rockset (#103995) 2023-06-22 23:33:10 +00:00
iwyu Revert "[1/N] Cleanup header inclusions in torch_cpu by iwyu (#101178)" 2023-09-25 20:05:25 +00:00
jit [BE] Enable ruff's UP rules and autoformat tools and scripts (#105428) 2023-07-19 01:24:44 +00:00
linter [lintrunner] Capture mypy internal error (#109421) 2023-09-18 15:48:14 +00:00
lite_interpreter removing some redundant str splits (#106089) 2023-09-01 00:22:58 +00:00
lldb Add helpful pretty pretting summaries to torch for lldb debugging (#97101) 2023-03-20 01:27:44 +00:00
onnx [BE] Enable ruff's UP rules and autoformat tools and scripts (#105428) 2023-07-19 01:24:44 +00:00
pyi Add pin_memory to torch.Tensor type annotation args (#109797) 2023-09-26 17:12:37 +00:00
rules
rules_cc [bazel] enable sccache+nvcc in CI (#95528) 2023-02-28 03:51:11 +00:00
setup_helpers Fix the Requirement of CMake Version (#106254) 2023-08-02 08:02:52 +00:00
shared Test Reordering: Run previously failing tests first (#101123) 2023-05-16 19:57:54 +00:00
stats [BE] Add sharding data by default to metrics (#110035) 2023-09-26 17:06:49 +00:00
test [BE] Add sharding data by default to metrics (#110035) 2023-09-26 17:06:49 +00:00
testing Monitor baseline for TD prioritizations (#110031) 2023-09-26 04:27:16 +00:00
__init__.py
bazel.bzl update rules_python and let bazel install its own pip dependencies (#101405) 2023-05-23 06:20:33 +00:00
BUCK.bzl Use global variables to register the return_types namedtuples (#108832) 2023-09-13 17:42:46 +00:00
BUCK.oss
build_libtorch.py
build_pytorch_libs.py
download_mnist.py [BE] f-stringify torch/ and scripts (#105538) 2023-07-21 19:35:24 +00:00
extract_scripts.py [BE] Import Literal, Protocol, and Final from standard library typing as of Python 3.8+ (#94490) 2023-02-09 19:17:49 +00:00
gen_flatbuffers.sh
gen_vulkan_spv.py Add torchgen path in gen_vulkan_spy (#108980) 2023-09-16 04:09:56 +00:00
generate_torch_version.py [BE] Enable ruff's UP rules and autoformat tools and scripts (#105428) 2023-07-19 01:24:44 +00:00
generated_dirs.txt
git_add_generated_dirs.sh
git_reset_generated_dirs.sh
nightly.py removing some redundant str splits (#106089) 2023-09-01 00:22:58 +00:00
nvcc_fix_deps.py
pytorch.version
README.md Remove fast_nvcc entry in README.md (#97624) 2023-03-28 16:23:09 +00:00
render_junit.py Fix exception causes all over the codebase (#90271) 2022-12-07 04:29:00 +00:00
substitute.py [BE] Enable ruff's UP rules and autoformat tools and scripts (#105428) 2023-07-19 01:24:44 +00:00
update_masked_docs.py Bump black version to 23.1.0 (#96578) 2023-03-15 06:27:59 +00:00
vscode_settings.py [1/3] Recognize .py.in and .pyi.in files as Python in VS Code (#95200) 2023-03-01 19:16:56 +00:00

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: