sglang_v0.5.2/pytorch_2.8.0/tools
hailin c8e8c1e9ff . 2025-09-20 16:09:34 +08:00
..
alerts . 2025-09-20 16:09:34 +08:00
amd_build . 2025-09-20 16:09:34 +08:00
autograd . 2025-09-20 16:09:34 +08:00
bazel_tools . 2025-09-20 16:09:34 +08:00
build/bazel . 2025-09-20 16:09:34 +08:00
build_defs . 2025-09-20 16:09:34 +08:00
code_analyzer . 2025-09-20 16:09:34 +08:00
code_coverage . 2025-09-20 16:09:34 +08:00
config . 2025-09-20 16:09:34 +08:00
coverage_plugins_package . 2025-09-20 16:09:34 +08:00
dynamo . 2025-09-20 16:09:34 +08:00
flight_recorder . 2025-09-20 16:09:34 +08:00
gdb . 2025-09-20 16:09:34 +08:00
github . 2025-09-20 16:09:34 +08:00
iwyu . 2025-09-20 16:09:34 +08:00
jit . 2025-09-20 16:09:34 +08:00
linter . 2025-09-20 16:09:34 +08:00
lite_interpreter . 2025-09-20 16:09:34 +08:00
lldb . 2025-09-20 16:09:34 +08:00
packaging . 2025-09-20 16:09:34 +08:00
pyi . 2025-09-20 16:09:34 +08:00
rules . 2025-09-20 16:09:34 +08:00
rules_cc . 2025-09-20 16:09:34 +08:00
setup_helpers . 2025-09-20 16:09:34 +08:00
shared . 2025-09-20 16:09:34 +08:00
stats . 2025-09-20 16:09:34 +08:00
test . 2025-09-20 16:09:34 +08:00
testing . 2025-09-20 16:09:34 +08:00
BUCK.bzl . 2025-09-20 16:09:34 +08:00
BUCK.oss . 2025-09-20 16:09:34 +08:00
README.md . 2025-09-20 16:09:34 +08:00
__init__.py . 2025-09-20 16:09:34 +08:00
bazel.bzl . 2025-09-20 16:09:34 +08:00
build_libtorch.py . 2025-09-20 16:09:34 +08:00
build_pytorch_libs.py . 2025-09-20 16:09:34 +08:00
build_with_debinfo.py . 2025-09-20 16:09:34 +08:00
download_mnist.py . 2025-09-20 16:09:34 +08:00
extract_scripts.py . 2025-09-20 16:09:34 +08:00
gen_flatbuffers.sh . 2025-09-20 16:09:34 +08:00
gen_vulkan_spv.py . 2025-09-20 16:09:34 +08:00
generate_torch_version.py . 2025-09-20 16:09:34 +08:00
generated_dirs.txt . 2025-09-20 16:09:34 +08:00
git_add_generated_dirs.sh . 2025-09-20 16:09:34 +08:00
git_reset_generated_dirs.sh . 2025-09-20 16:09:34 +08:00
nightly.py . 2025-09-20 16:09:34 +08:00
nightly_hotpatch.py . 2025-09-20 16:09:34 +08:00
nvcc_fix_deps.py . 2025-09-20 16:09:34 +08:00
optional_submodules.py . 2025-09-20 16:09:34 +08:00
render_junit.py . 2025-09-20 16:09:34 +08:00
substitute.py . 2025-09-20 16:09:34 +08:00
update_masked_docs.py . 2025-09-20 16:09:34 +08:00
vscode_settings.py . 2025-09-20 16:09:34 +08:00

README.md

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: