Show HN: Run PyTorch locally with a remote GPU backend (github.com)

🤖 AI Summary
Mycelya’s new mycelya_torch library plugs a remote GPU backend directly into PyTorch, letting you run tensors, models and training loops on cloud GPUs with almost no code changes. You create a RemoteMachine (e.g., Modal + A100), request a "cuda" device and then use standard PyTorch APIs (.to(device), model.to(device), tensor operations, DataLoader loops) or decorate functions with @mycelya_torch.remote to execute entire functions remotely. The library demonstrates end-to-end examples for training (MNIST), Hugging Face causal LMs, and Diffusers image pipelines, plus sync/async remote calls, preinstalled pip packages, dynamic pip_install, pause/resume, and multi-GPU requests (1–8). Technically, it targets Python 3.10+ and PyTorch 2.0+, supports eight GPU types (T4, L4, A10G, A100, L40S, H100, H200, B200), and currently uses Modal as the cloud provider (free tier available); other providers are planned. Notable features include device_map="auto" / torch_dtype="auto" model loading, deterministic generation via CUDA Generator, idle timeout to save costs, and AGPL-3.0 licensing. Practical implications: it dramatically lowers friction for prototyping, scaling and remote inference while keeping familiar APIs, but users should weigh network latency, data transfer costs, cloud spend and the AGPL license for production use.
Loading comments...
loading comments...