Skip to main content

Run any PyTorch script on a remote GPU. Change zero lines of code.

Project description

Chidori GPU

Run any PyTorch script on a remote GPU. Zero code changes.

pip install chidori-gpu

Quick Start

GPU Server:

chidori serve

Client (any machine, no GPU needed):

chidori run --server GPU_HOST:43211 python train.py

Your train.py is completely unmodified. Chidori intercepts CUDA calls and routes them to the remote GPU over TCP.

Features

  • Zero code changes — works with any PyTorch/HuggingFace script
  • Training — full forward + backward + optimizer over the wire
  • Inference — 100+ tok/s with server-side graph decode
  • Multi-GPU — one client per GPU, scale to 8+ GPUs
  • All PyTorch CUDA versions — cu118, cu121, cu126, cu128, cu130, cu131

Performance

Tested over WAN (70ms RTT):

Workload Hardware Speed
Matmul 4096x4096 A100-40GB 96 TFLOPS
FP32 Training A100-40GB 35K tok/s
FP16 Training A100-40GB 59K tok/s
Inference (graph decode) A100-40GB 100+ tok/s

Fast Inference

For optimized inference (100+ tok/s instead of ~1 tok/s):

import chidori
chidori.optimize()

from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("model", dtype=torch.float16).cuda()
out = model.generate(inputs, max_new_tokens=100, cache_implementation="static")

Or use the direct API:

from chidori import server_decode
text = server_decode(model, tokenizer, "Hello world", max_new_tokens=100)

Multi-GPU

Start one server per GPU on different ports:

# On an 8-GPU server
for i in $(seq 0 7); do
    CUDA_VISIBLE_DEVICES=$i chidori serve --port $((43211 + i)) &
done

Each client connects to a specific GPU:

chidori run -s gpu-server:43211 python job1.py  # GPU 0
chidori run -s gpu-server:43212 python job2.py  # GPU 1
chidori run -s gpu-server:43213 python job3.py  # GPU 2

How It Works

Chidori uses LD_PRELOAD to intercept CUDA API calls at the driver level. Each call is serialized over TCP to a remote GPU server that executes it on a real GPU. The application sees a virtual GPU — no code changes needed.

  • 280+ CUDA functions intercepted (Driver API, Runtime API, cuBLAS, cuBLASLt, cuDNN)
  • Async RPC batching — kernel launches are fire-and-forget, batched via TCP_CORK
  • Server-side graph decode — captures a CUDA graph and runs the entire inference loop server-side
  • Version-aware — translates struct layouts between CUDA versions automatically

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chidori_gpu-0.1.1.tar.gz (762.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chidori_gpu-0.1.1-py3-none-any.whl (787.4 kB view details)

Uploaded Python 3

File details

Details for the file chidori_gpu-0.1.1.tar.gz.

File metadata

  • Download URL: chidori_gpu-0.1.1.tar.gz
  • Upload date:
  • Size: 762.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for chidori_gpu-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0600f975322b82750c6bb3bf839277e17fc78ea60b5e8c46bc156bc121dfef7e
MD5 8525815e3cfb68f73e679b3cb57ad86f
BLAKE2b-256 d0188a3e71f6ec7181b71939ebcd69c5940e9f4f8560cbdf8e00ae08e8580aa8

See more details on using hashes here.

File details

Details for the file chidori_gpu-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chidori_gpu-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 787.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for chidori_gpu-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e837c2101c27fe797da534eebcdba68c2286cd052c78a6fe9de2fbf586c22c43
MD5 0e8d779ef622d690b21946b7ad58e5f8
BLAKE2b-256 68f81648964d0176b13d6c5f01782fac420318b5df6ae8fe67cd7e8dfacc0ff5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page