TorchX is a Python SDK for MLOps that helps you compose, configure, and launch PyTorch applications on various schedulers like local, Docker, Kubernetes, and Ray. It provides a common API for distributed training, serving, and other ML workloads. The current version is 0.7.0, with major releases occurring every few months.
pip install torchxVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a basic `AppDef` with a single role and launch it using `TorchxRunner` on the `local_cwd` scheduler. It prints 'Hello, TorchX!' to the console via the `echo` command.
Migrate from `ddp_scheduler` to `ray_scheduler` or `kubernetes` scheduler for distributed training applications.
Update your CLI scripts to use `torchx launch` instead of `torchx run`.
Remove the `scheduler` argument from `specs.Role` definitions. Pass the desired scheduler string directly to `TorchxRunner.run(app, scheduler='your_scheduler')`.
Ensure Docker Desktop or the Docker daemon is installed and actively running on your system before attempting to launch jobs with Docker-dependent schedulers.
When using components, pass their output directly to `runner.run()`, e.g., `runner.run(torchx.components.dist.ddp_torchscript(...), ...)` rather than trying to `import ddp` directly.