rGPU Open-Sourced: Enables Remote NVIDIA GPU Execution for PyTorch Tensors and CUDA Binaries
rGPU is an open-source tool that offloads computation to remote NVIDIA GPUs while keeping applications local. It offers two integration paths: a native PyTorch device backend supporting `rgpu`, and a CUDA shim intercepting low-level APIs for existing binaries. This solution addresses remote training and inference needs in scenarios with limited local compute or resource isolation requirements.
Related Entities
Full Report
Contents4 sections
rGPU
rGPU 在远程 NVIDIA 机器上运行 GPU 任务,而应用程序则保留在客户端。目前它提供两种使用路径:
PyTorch 设备是更简单的集成方式。CUDA shim 覆盖现有二进制文件,但具有更大的兼容性范围。
文档
website/ 中的 Fumadocs 站点即为产品文档:
工程记录与实验索引见 docs/README.md。
快速开始:PyTorch 设备
通过 pip install rgpu 安装 rGPU,或在此代码库中执行 pip install -e ./python,然后按照快速开始部署服务器。将以下内容保存为工作目录下的 smoke.py:
import torch
import rgpu
x = torch.ones(4, device="rgpu")
print((x * 2).sum().item()) # 8.0在安装 rGPU 的环境中运行该程序,并使用服务器的 SSH 目标地址及选项:
rgpu-run --host user@gpu-host --ssh-port 2222 -i ~/.ssh/gpu_key \
python smoke.py程序选择设备;rgpu-run 负责建立隧道并配置连接。预期输出为 8.0。
对于现有的 Linux CUDA 程序,请遵循 CUDA shim 指南,从 ./scripts/build_client.sh 开始。
这两种协议均不对连接进行身份验证或加密。请将 rgpu-opserver 保持默认的 localhost 绑定,并使用 SSH。CUDA 服务器监听所有 IPv4 接口:即使使用 SSH 隧道,在启动前也需通过主机/云防火墙规则限制端口 9713。参见部署。
开发
# C++ 客户端和 fake-driver 测试
./scripts/build_client.sh
# Python 测试
python -m pip install -e './python[test]'
python -m pytest python/tests
# 静态文档
npm --prefix website ci
npm --prefix website run build有关其余的构建、云和硬件命令,请参阅 scripts/README.md。生成的 C++ 代码已提交至仓库;其策略和重新生成步骤详见 codegen/README.md。
仓库结构图
历史实现笔记和实验结果已在 docs/README.md 中索引。
作者发帖说明(HN):
rGPU 在远程 NVIDIA 机器上运行 GPU 任务,而应用程序仍保留在客户端。