PyTorch RBLN (torch-rbln) is a PyTorch extension that allows natural use of Rebellions NPU compute within PyTorch. By implementing eager mode, which operates in a define-by-run fashion, it supports the full lifecycle of model development, deployment, and serving in the PyTorch ecosystem. It is also convenient for debugging and related workflows.
The same interface style as CPU and GPU applies — the rbln device, torch.rbln, and torch.compile — so developers and customers can target RBLN NPUs with familiar APIs. Operations on rbln tensors are integrated via PyTorch’s out-of-tree extension path; execution is coordinated with the RBLN compiler and runtime (rebel-compiler).
PyTorch RBLN is currently in beta and under active development. APIs may change between releases, backward compatibility is not guaranteed, and production use is not recommended yet. For the full notice, architecture, supported operators, and tutorials, see PyTorch RBLN — Overview in the RBLN SDK documentation. For wheels, rebel-compiler, and building from source, see Installation.
- Python 3.10–3.13 — see Installation — Requirements (source build).
rebel-compiler— required; not installed withtorch-rbln. Use an RBLN Portal account and the RBLN package index as described in Install pre-built wheels.
torch-rbln (public wheel). Install torch from the PyTorch CPU index first, then torch-rbln from PyPI.
pip3 install torch==2.11.0+cpu --index-url https://download.pytorch.org/whl/cpu
pip3 install torch-rblnFor rebel-compiler and the rest of the setup, see Prerequisites above and Installation.
- Install uv (see Installation — Prerequisites in the SDK docs).
- Configure access to the RBLN package index (see Authenticate to the RBLN package index below).
- Follow Build from source (venv,
rebel-compiler, editable build, manual steps).
git clone https://github.com/RBLN-SW/torch-rbln.git
cd torch-rbln
uv venv .venv && source .venv/bin/activate
./tools/dev-setup.sh pypirebel-compiler must be available in the same environment before the torch-rbln build finishes (see Prerequisites).
rebel-compiler is installed from the RBLN package index (pypi.rbln.ai), which requires an RBLN Portal account. Without credentials, ./tools/dev-setup.sh pypi fails with:
❌ Cannot reach any rbln pypi index (no permission or network error).
Add your RBLN Portal credentials to ~/.netrc so pip/uv can authenticate:
machine pypi.rbln.ai
login <your-rbln-portal-id>
password <your-rbln-portal-password>
Then restrict its permissions (tools refuse a world-readable .netrc):
chmod 600 ~/.netrcRe-run ./tools/dev-setup.sh pypi once the file is in place.
RBLN SDK (hosted)
- Overview — design, components, and entry points into the PyTorch RBLN docs
- Installation — pre-built wheels,
rebel-compiler, build from source - Running and debugging with PyTorch RBLN — basic usage and debugging
- Running a LLM model: Llama3.2-1B —
transformersexample - Supported Ops — operator coverage
- APIs — Python API reference
- Troubleshooting —
librbln/torch_rbln.diagnose, core dumps, logging, dtype / CPU, memory (maintained in the RBLN SDK docs)
This repository
- Configuration — environment variables and runtime options
- Test Guide — local test runs
- Linting — code style and lint
- Third-party update — PyTorch pin, upstream files,
rebel-compilerversion bumps inpyproject.toml - Release Process — branch model, versioning, tagging, and publication
See docs/CONTRIBUTING.md.
Apache License 2.0 — see LICENSE and NOTICE.
- Community: discuss.rebellions.ai
- Email: support@rebellions.ai