Running and debugging with PyTorch RBLN¶
Overview¶
This tutorial demonstrates how to run and debug with PyTorch RBLN.
Setup & Installation¶
- System requirements
- Python: 3.10–3.13
- RBLN Driver
- Major package requirements
- Installation
Note
Please note that rebel-compiler requires an RBLN Portal account.
Running a simple example (torch.add)¶
The following add.py example verifies fp16 tensor ops on the RBLN NPUs. It uses the same code you would use on a GPU or CPU, except that it uses rbln instead of cuda or cpu.
| add.py | |
|---|---|
If you run the above script, we expect the following:
As we can see, fp16 element-wise torch.add on rbln matches the expected value.
Using PDB in PyTorch RBLN for further debugging¶
The following shows how to confirm the result tensor and indexed values in PDB.
In the above example, we can see that both the full tensor and indexed tensor match expectations.