Skip to content

Installation

Install torch-rbln from pre-built wheels or build it from source. To compile models for RBLN NPUs, install rebel-compiler separately.

Use import torch as usual—torch-rbln autoloads as an out-of-tree extension.

import torch

For version history, see the release notes.

Quickstart

Create a virtual environment, install the packages, then verify the import.

1
2
3
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
1
2
3
$ pip install \
  --extra-index-url https://download.pytorch.org/whl/cpu \
  torch-rbln==0.1.8
1
2
3
$ pip install \
  --extra-index-url https://pypi.rbln.ai/simple \
  rebel-compiler==0.10.2
python -c "import torch; import torch_rbln; print(torch_rbln.__version__)"

Build from source (advanced)

Repository: torch-rbln

Requirements

  • Python: 3.10–3.13
  • PyTorch (CPU wheels)
  • rebel-compiler (required; installed separately)

Note

An RBLN Portal account is required to install rebel-compiler.

Prerequisites

  • Git
  • A C/C++ toolchain (GCC 13 on Linux) for building the torch-rbln extension
  • CMake 3.18+ and Ninja
  • uv (optional). See the uv installation guide.

Get the source

Clone the repository and create a virtual environment:

1
2
3
4
git clone https://github.com/RBLN-SW/torch-rbln.git
cd torch-rbln
uv venv .venv && source .venv/bin/activate
uv pip install -U pip

Run the setup script from the repository root:

./tools/dev-setup.sh pypi

Verify the installation using the command in Quickstart.

Build manually

From the repository root:

1
2
3
uv sync --no-install-project
# export TORCH_RBLN_BUILD_TYPE=Debug   # optional
uv pip install -e . --no-build-isolation

Verify the installation using the command in Quickstart.