pytorch/tools
Xuehai Pan 42a4df9447 Support CUDA nightly package in tools/nightly.py (#131133)
Add a new option `--cuda` to `tools/nightly.py` to pull the nightly packages with CUDA support.

```bash
# installs pytorch-nightly with cpuonly
tools/nightly.py pull

# The following only available on Linux and Windows
# installs pytorch-nightly with latest CUDA we support
tools/nightly.py pull --cuda

# installs pytorch-nightly with CUDA 12.1
tools/nightly.py pull --cuda 12.1
```

Also add targets in `Makefile` and instructions in constribution guidelines.

```bash
# setup conda environment with pytorch-nightly
make setup-env

# setup conda environment with pytorch-nightly with CUDA support
make setup-env-cuda
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131133
Approved by: https://github.com/ezyang
2024-07-25 05:33:52 +00:00
..
alerts
amd_build [BE][Easy][5/19] enforce style for empty lines in import segments in tools/ and torchgen/ (#129756) 2024-07-17 06:44:35 +00:00
autograd [MTIA] Support module.mtia() (#131499) 2024-07-25 04:23:48 +00:00
bazel_tools
build/bazel Bump setuptools from 69.5.1 to 70.0.0 in /tools/build/bazel (#130893) 2024-07-25 03:32:08 +00:00
build_defs [lint] Remove unnecessary BUCKRESTRICTEDSYNTAX suppressions 2024-07-19 07:19:11 -07:00
code_analyzer
code_coverage [BE][Easy] fix ruff rule needless-bool (SIM103) (#130206) 2024-07-14 08:17:52 +00:00
config
coverage_plugins_package
dynamo
flight_recorder Initial commit of flight recorder trace (#130764) 2024-07-19 06:00:54 +00:00
gdb
github
iwyu
jit [9/N] Replace c10::optional with std::optional (#130674) 2024-07-15 00:48:43 +00:00
linter Support CUDA nightly package in tools/nightly.py (#131133) 2024-07-25 05:33:52 +00:00
lite_interpreter
lldb
onnx
pyi FakeTensor cache SymInt support (#127596) 2024-07-21 19:26:38 +00:00
rules
rules_cc
setup_helpers Allow setting PYTHON_LIB_REL_PATH via environment variable (#128419) 2024-07-24 19:49:06 +00:00
shared
stats [CI][dashboard] Rename cpu-x86 to cpu_x86 (#131658) 2024-07-24 19:16:52 +00:00
test [BE][Easy][5/19] enforce style for empty lines in import segments in tools/ and torchgen/ (#129756) 2024-07-17 06:44:35 +00:00
testing [TD] More synonyms, new heuristic for test_public_bindings (#130397) 2024-07-22 21:42:54 +00:00
__init__.py
bazel.bzl
BUCK.bzl [lint] Remove unnecessary BUCKRESTRICTEDSYNTAX suppressions 2024-07-19 07:19:11 -07:00
BUCK.oss
build_libtorch.py [BE][Easy][5/19] enforce style for empty lines in import segments in tools/ and torchgen/ (#129756) 2024-07-17 06:44:35 +00:00
build_pytorch_libs.py
build_with_debinfo.py
download_mnist.py
extract_scripts.py
gen_flatbuffers.sh
gen_vulkan_spv.py
generate_torch_version.py
generated_dirs.txt
git_add_generated_dirs.sh
git_reset_generated_dirs.sh
nightly.py Support CUDA nightly package in tools/nightly.py (#131133) 2024-07-25 05:33:52 +00:00
nvcc_fix_deps.py
pytorch.version
README.md
render_junit.py
substitute.py
update_masked_docs.py
vscode_settings.py [BE][Easy][5/19] enforce style for empty lines in import segments in tools/ and torchgen/ (#129756) 2024-07-17 06:44:35 +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: