Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,16 @@ The pre-trained public models use `--model-id 1` (R=9) and `--model-id 4` (R=13)
After training (or starting from the shipped `.safetensors` files), you can export the model to
ONNX and optionally apply INT8 or FP8 post-training quantization for deployment.

Set the `ONNX_WORKFLOW` and (optionally) `QUANT_FORMAT` environment variables before running
inference with `local_run.sh`:
You may also change the surface code distance and number of rounds at inference
time. That is - you are not required retrain a new model when changing either
one of these parameters; since the model is a 3D convolutional neural network,
the model will simply be run over a new decoding volume.

- To run with a new distance, simply add `DISTANCE=<your distance>` to the commands below.
- To run with a new number of rounds, simply add `N_ROUNDS=<your number of rounds>` to the commands below.

Set the `ONNX_WORKFLOW` and (optionally) (`QUANT_FORMAT`, `DISTANCE`,
`N_ROUNDS`) environment variables before running inference with `local_run.sh`:

| `ONNX_WORKFLOW` | Behavior |
|---|---|
Expand Down Expand Up @@ -169,7 +177,16 @@ ONNX_WORKFLOW=3 WORKFLOW=inference bash code/scripts/local_run.sh
| `QUANT_FORMAT` | unset | `int8` or `fp8`. Unset means no quantization (FP32 ONNX). |
| `QUANT_CALIB_SAMPLES` | `256` | Calibration samples for INT8/FP8 post-training quantization. |

**Circuit variables:**

| Variable | Default | Description |
|---|---|---|
| `CONFIG_NAME` | `config_public` | Use the defaults from the `conf/$CONFIG_NAME.yaml` file |
| `DISTANCE` | Use the distance specified in the `conf/$CONFIG_NAME.yaml` file | surface code distance |
| `N_ROUNDS` | Calibration samples for INT8/FP8 post-training quantization. | number of rounds in memory experiment |

Notes:

- TensorRT workflows (`ONNX_WORKFLOW=2` or `3`) require `tensorrt` and `modelopt`.
- FP8 quantization failure is fatal. INT8 failure falls back to the FP32 ONNX model silently.
- ONNX and engine files are written to the current working directory.
Expand Down Expand Up @@ -215,7 +232,7 @@ Results are written to `outputs/<EXPERIMENT_NAME>/plots/`.
| Decoder | Source | Notes |
|---|---|---|
| No-op | — | Pre-decoder output only, no global correction |
| Union-Find | `ldpc` | Fast, sub-optimal |
| Union-Find | `ldpc` | Fast, sub-optimal LER (Logical Error Rate) |
| BP-only | `ldpc` | Belief propagation, no OSD |
| BP+LSD-0 | `ldpc` | BP with localized statistics decoding |
| Uncorr-PM | PyMatching | Uncorrelated minimum-weight perfect matching |
Expand Down
Loading