depyf
Decompile python functions, from bytecode to source code!
Decision gist · record as of 2026-08-14
Yes, if you use torch.compile and need to understand or debug its behavior. The tool fills a genuine gap—existing decompilers fail on PyTorch bytecode—and is backed by the PyTorch team. The aging maintenance status (305 days since last release) is a minor concern, but the repository is not archived and remains active. Install only if you have PyTorch>=2.2.0 available.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch>=2.2.0 (PyTorch nightly recommended).
- The package inspects internal torch.compile artifacts that depend on very recent PyTorch features.
- Low friction: pure Python wheel with only two runtime dependencies (astor, dill).
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute depyf freely in commercial and private projects without restriction.
last release 2025-10-13 (305 days) · last repo commit 2025-10-13 · 815 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,386,060 downloads/mo, #2,640 on PyPI
Alternatives
Verify before relying
pip install depyf
import depyf
with depyf.prepare_debug("./debug_output"):
# wrap your torch.compile code here
pass- Whether depyf works reliably with PyTorch versions between 2.2.0 and the current stable release, or if nightly is truly necessary for most use cases.
- Performance overhead or memory impact when running code under depyf.prepare_debug() or depyf.debug() context managers.
- Compatibility with custom torch.compile backends or non-standard compilation configurations.
What it is and what it does
depyf is a debugging and introspection tool for PyTorch's torch.compile compiler. It intercepts the bytecode and intermediate representations generated during compilation and writes them to disk in human-readable form, letting you see what torch.compile is actually doing to your code. The tool outputs the original source, transformed Python code, raw bytecode (loadable via dill), and the computation graphs at each optimization stage (captured graph, joint graph, forward/backward graphs, and compiled kernels).
The package is designed for machine learning researchers and practitioners who need to understand, debug, or optimize code compiled with torch.compile. It wraps your code in context managers that intercept compilation artifacts, and optionally integrates with debuggers so you can step through the compiled code. It requires PyTorch 2.2.0 or newer and depends on astor and dill for code generation and bytecode serialization.
Use it for
- Debug why torch.compile is not optimizing a function as expected by inspecting the captured and optimized graphs.
- Understand the bytecode transformations torch.compile applies to your code to identify performance bottlenecks.
- Inspect forward and backward graphs generated by AOTAutograd to verify gradient computation correctness.
- Step through compiled code in a debugger to trace execution flow and set breakpoints in generated functions.
- Analyze compiled CPU/GPU kernels produced by Inductor to understand hardware-level optimizations.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use torch.compile and need to understand or debug its behavior.
The tool fills a genuine gap—existing decompilers fail on PyTorch bytecode—and is backed by the PyTorch team. The aging maintenance status (305 days since last release) is a minor concern, but the repository is not archived and remains active. Install only if you have PyTorch>=2.2.0 available.
Install
depyf on PyPI
Before you install
Low friction: pure Python wheel with only two runtime dependencies (astor, dill). Maintenance status is aging—last release was 305 days ago—but the repository remains active with 815 stars and backed by PyTorch team collaboration.
Requires PyTorch>=2.2.0 (PyTorch nightly recommended). The package inspects internal torch.compile artifacts that depend on very recent PyTorch features.
License in practice
MIT license is permissive; you can use, modify, and distribute depyf freely in commercial and private projects without restriction.
Quickstart
pip install depyf
import depyf
with depyf.prepare_debug("./debug_output"):
# wrap your torch.compile code here
pass
Verify before relying
- Whether depyf works reliably with PyTorch versions between 2.2.0 and the current stable release, or if nightly is truly necessary for most use cases.
- Performance overhead or memory impact when running code under depyf.prepare_debug() or depyf.debug() context managers.
- Compatibility with custom torch.compile backends or non-standard compilation configurations.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesastordill |
| Maintenance | Aging 305 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,386,060 / month, #2,640 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: depyf-0.20.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “torch.compile debugging”
- depyfDecompile and inspect the internal bytecode and optimization graphs…
- tlparsetlparse parses structured PyTorch torch.compile trace logs and…
- cut-cross-entropyComputes cross-entropy loss for large-vocabulary language models with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also decompyle3 · tlparse · opt-einsum-fx · torch-c-dlpack-ext · uncompyle6 · ast-decompiler · torchvision · modulegraph2 · torch · hoptorch