metaflow-torchrun
A torchrun decorator for Metaflow
Decision gist · record as of 2026-08-14
Yes, if you use Metaflow and PyTorch distributed training together. The package has no runtime dependencies, low install friction, active maintenance, and solves a real integration gap. License treatment is unclear—verify Apache License compliance before production use. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Metaflow to be installed and configured; GPU/compute environment must support the resource decorators used (e.g., @kubernetes or @batch).
- Installation is straightforward with no runtime dependencies.
- The package is actively maintained with a recent release, though Python version support is unspecified.
License · maintenance · safety
(unclear) — License treatment is unclear; the description mentions Apache License but SPDX metadata is not present in the package record, so verify the actual license terms before use.
last release 2026-07-15 (30 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 82,474 downloads/mo, #14,161 on PyPI
Alternatives
Verify before relying
pip install metaflow-torchrun
from metaflow import FlowSpec, step, torchrun
class MyFlow(FlowSpec):
@kubernetes(gpu=1)
@torchrun
@step
def train(self):
current.torch.run(
entrypoint="main.py",
entrypoint_args={"main-arg-1": "123"},
nproc_per_node=1
)- Exact Python version requirements and compatibility range
- Whether Metaflow itself is a required dependency or assumed to be pre-installed
- GPU/CUDA version requirements for torchrun integration
What it is and what it does
metaflow-torchrun is a plugin that bridges Metaflow workflows and PyTorch's torchrun distributed training framework. It provides a @torchrun decorator that lets you run existing PyTorch distributed programs (like DDP training) as parallel steps in a Metaflow DAG without modifying your training code. The decorator automatically handles torchrun argument selection based on Metaflow compute resource requests (CPU, GPU, memory), network discovery, and subprocess orchestration.
You use it by stacking the @torchrun decorator on a Metaflow step, then calling current.torch.run() with your training entrypoint and arguments. This pattern is useful for multi-node training jobs submitted to AWS Batch or Kubernetes, where you want Metaflow to manage task orchestration and torchrun to manage the distributed torch processes within each task.
Use it for
- Run multi-node PyTorch DDP training as a step in a Metaflow workflow without subprocess boilerplate
- Orchestrate distributed GPT or transformer training across parallel Metaflow tasks on Kubernetes or AWS Batch
- Execute existing torchrun scripts inside Metaflow without rewriting training code for the workflow framework
- Automate network discovery and torchrun argument configuration based on Metaflow resource decorators
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use Metaflow and PyTorch distributed training together.
The package has no runtime dependencies, low install friction, active maintenance, and solves a real integration gap. License treatment is unclear—verify Apache License compliance before production use. No known vulnerabilities.
Install
metaflow-torchrun on PyPI
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with a recent release, though Python version support is unspecified.
Requires Metaflow to be installed and configured; GPU/compute environment must support the resource decorators used (e.g., @kubernetes or @batch).
License in practice
License treatment is unclear; the description mentions Apache License but SPDX metadata is not present in the package record, so verify the actual license terms before use.
Quickstart
pip install metaflow-torchrun
from metaflow import FlowSpec, step, torchrun
class MyFlow(FlowSpec):
@kubernetes(gpu=1)
@torchrun
@step
def train(self):
current.torch.run(
entrypoint="main.py",
entrypoint_args={"main-arg-1": "123"},
nproc_per_node=1
)
Verify before relying
- Exact Python version requirements and compatibility range
- Whether Metaflow itself is a required dependency or assumed to be pre-installed
- GPU/CUDA version requirements for torchrun integration
Package facts
| License | Not declared unclear |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 30 days since the last release |
| First released | |
| Downloads | 82,474 / month, #14,161 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: metaflow_torchrun-0.2.2-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 › “metaflow pytorch distributed training”
- metaflow-torchrunProvides a Metaflow decorator that integrates PyTorch distributed…
- outerboundsOuterbounds is the main platform package that integrates data science…
- metaflow-checkpointProvides decorators for Metaflow workflows to save and resume…
Give your agent the search over MCP, or paste the wish link into any chat.
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework that enables you to define and call remote procedures across network boundaries using protocol buffers for serialization.
Install it if you need RPC communication in a distributed system or are integrating with existing gRPC services.
execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.
However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…
Cloudpickle extends Python's standard pickle module to serialize lambda functions, interactively-defined functions and classes, and other constructs that the default pickle cannot handle, making it suitable for cluster computing and remote code execution.
Install it if you need to serialize lambda functions, interactively-defined code, or non-standard Python constructs for cluster computing or distributed execution.
Provides a unified, open()-compatible Python API for streaming large files from remote storage (S3, GCS, Azure, HDFS, SFTP, HTTP) and local filesystems, with transparent compression support.
Install it if you work with large files on cloud storage or remote systems and want to avoid writing boilerplate around multiple SDKs.
Portalocker provides cross-platform file locking with support for exclusive and shared locks, plus Redis-based distributed locks and process-aware PID file locking.
Install it if you need file or process coordination; the optional extras (pywin32, redis) are only required for specific lock types.
Ray is a distributed computing framework that scales Python applications from a single machine to multi-node clusters, providing abstractions for parallel tasks, stateful actors, and shared objects.
See also metaflow-prebuilt · torchtitan · torchft-nightly · torchx · torchrunx · torchtnt · metaflow-checkpoint · torch · fairscale · metaflow