Skip to main content

Roccoro

Native ROCm/HIP Kokoro-82M TTS engine — ~245× real-time on AMD Strix Halo (gfx1151), ~830 MB VRAM/GTT, zero PyTorch or ONNX Runtime at inference.

roccoro implements the complete Kokoro-82M acoustic model (ALBERT/PL-BERT, 6 BiLSTMs, AdaINResBlk1d, ConvTranspose1d + fused Snake, 9-harmonic NSF sine source, 20-pt STFT/iSTFT) directly in standalone C++/HIP + rocBLAS — bypassing MIOpen completely and running at roofline on AMD RDNA3 / RDNA3.5 GPUs.


Why Roccoro?

On AMD Strix Halo (gfx1151 / Radeon 8060S), PyTorch ROCm's MIOpen backend stalls on Kokoro-82M at < 1× real-time due to workspace fallback issues, while CPU ONNX Runtime caps out around ~33× RT.

roccoro replaces the ~4 GB torch + onnxruntime + transformers stack with a single ~500 KB HIP binary (roccoro-engine) plus lightweight misaki G2P:

Backend (AMD Ryzen AI MAX+ 395 / Radeon 8060S gfx1151) Speed (× RT) GPU / GTT Memory 9-Hour Audiobook Inference Deps
PyTorch ROCm (cudnn=True / MIOpen) < 1× RT ~3+ GB > 9 hours torch, transformers, kokoro
ONNX Runtime CPU FP32 (16 Zen 5 threads) 33.4× RT 0 MB ~16 min onnxruntime, kokoro
roccoro (native HIP, wave32 WMMA + persistent FP32 BiLSTM) 245× RT synth (222× RT e2e w/ G2P+Opus) ~830 MB ~2 min 14 sec numpy, misaki (zero torch/ort)

Quality & Hardware Parity (verified vs PyTorch FP32 reference)

  • Exact FP32 durations: 0/43 phoneme duration mismatches on reference fixture (verify_fixture — 19/19 layer checks pass).
  • Audio fidelity: cos = 0.99936 waveform correlation on deterministic fixture, env_mel_cos = 0.9999986 / env_mel_lsd_db = 0.0395 dB vs ONNX CPU FP32 on an 82-minute chapter.
  • Roofline utilization: Custom gfx1151 wave32 FP16-WMMA implicit-GEMM Conv1d kernel (__builtin_amdgcn_wmma_f32_16x16x16_f16_w32, BM=64, BN=128, BK=64) hits 27.61 TFLOP/s (107.7% of measured 25.64 TFLOP/s roof); single-launch persistent FP32 BiLSTM (k_bilstm_persistent_h256) slashes BiLSTM time 12–16× while preserving exact FP32 prosody.
  • Coexists safely with large LLMs: Uses only ~830 MB total GTT (199 MiB weights + 448 MiB arena + runtime), leaving room to run alongside an 85 GB resident llama-server.

Quickstart (AMD Strix Halo / RDNA3 / RDNA3.5 + ROCm)

1. Install roccoro

pip install roccoro

2. Build the native HIP binary (auto-detects your GPU arch via rocminfo)

roccoro build
# Or specify explicitly, e.g. Strix Halo (gfx1151) or RX 7900 XTX (gfx1100):
roccoro build --arch gfx1151

This compiles roccoro-engine and installs it to ~/.cache/roccoro/roccoro-engine.

3. One-time weight export from hexgrad/Kokoro-82M

Only this one-time conversion step needs torch + kokoro (you can run it in a throwaway venv if you want your inference environment 100% torch-free):

pip install "roccoro[export]"
roccoro export-weights

This folds weight_norm and writes a compact ~199 MiB 64-byte-aligned ~/.cache/roccoro/kokoro_v1_fp32.khip.

4. Synthesize speech

# CLI (24 kHz WAV)
roccoro "Hello from Strix Halo at two hundred forty five times real time!" -o hello.wav

# Synthesize a text file with voice blending
roccoro --text-file chapter.txt -o chapter.wav --voice af_heart,af_bella --speed 1.0

# Check device, binary, and weights status
roccoro info

Python API

import roccoro

with roccoro.KokoroEngine(voice="af_heart") as engine:
    # Single call -> 24 kHz float32 NumPy waveform
    audio = engine.synthesize("Hello from Roccoro on Strix Halo!", speed=1.0)
    roccoro.write_wav("hello.wav", audio)

    # Or write directly to WAV
    out_path, duration_s = engine.synthesize_to_file("Fast local TTS.", "fast.wav")

    # Low-level pipelined API (used by mumblebee for 222x RT full-book synthesis)
    phonemes = engine.phonemize_batch("Paragraph one.\n\nParagraph two.")
    chunks = engine.synthesize_phonemes(phonemes, model_speed=1.0, show_progress=True)

Standalone C++/HIP Binary & Benchmarks (Zero Python Required)

If you clone the repo directly:

git clone https://github.com/sergeyplis/roccoro.git
cd roccoro
make install               # builds roccoro-engine + installs to ~/.cache/roccoro/roccoro-engine
make verify bench          # builds verify_fixture and kokoro_bench_hip

Layer-by-layer Numerical Verification

roccoro export-weights --out kokoro_v1_fp32.khip --dump-fixture fixture_short.khip
./src/roccoro/csrc/verify_fixture kokoro_v1_fp32.khip fixture_short.khip

Binary Pipe Protocol (roccoro-engine)

roccoro-engine can be driven from any language (C++, Rust, Go, Node, Python) over stdin/stdout without Python:

  1. Launch: roccoro-engine --weights kokoro_v1_fp32.khip --arena-mb 448 --max-batch 32
  2. Engine writes 4-byte ready magic 0x4B484F4B ("KHOK").
  3. Client sends request frames: <magic=0x4B485251, num_chunks, speed_f32, max_batch> followed by num_chunks records of <token_len_u32, seed_u64, style_256xf32, tokens_lenxi32>.
  4. Engine replies: <magic=0x4B485250, num_chunks> followed by num_chunks records of <n_samples_u32, pcm_f32[n_samples]>.
  5. Send num_chunks = 0 (or close stdin) to exit cleanly.

Configuration & Environment Variables

Variable Purpose
ROCCORO_BIN Explicit path to roccoro-engine binary
ROCCORO_WEIGHTS Explicit path to kokoro_v1_fp32.khip weights
ROCCORO_CACHE_DIR Override cache dir (default: $XDG_CACHE_HOME/roccoro or ~/.cache/roccoro)
ROCM_PATH ROCm root used by roccoro build (default: /opt/rocm)

GPU Compatibility

  • Tested & tuned: AMD Radeon 8060S / Strix Halo (gfx1151, ROCm 7.2.2).
  • Compatible ISA: RDNA3 / RDNA3.5 GPUs supporting wave32 FP16 WMMA (gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151). Build with roccoro build --arch <gfxXXXX>.

Credits & License

Metadata

Release files for roccoro 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roccoro 0.1.1
File Size Uploaded Provenance Actions
roccoro-0.1.1.tar.gz 62.9 kB With provenance Details for roccoro-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for roccoro 0.1.1
File Interpreter ABI Platform Actions
roccoro-0.1.1-py3-none-any.whl Python 3 none any Details for roccoro-0.1.1-py3-none-any.whl

Total release size: 125.8 kB

Release files / roccoro-0.1.1.tar.gz

Download URL roccoro-0.1.1.tar.gz
Size 62.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c09fd2e02e64e6105910ff42cd096ba9a31b1de2a8b62686756eb8ead47f1701
BLAKE2b-256 checksum
How to use checksums
ae074de2d108f44599fe02871461127ce1834cf13c2e576e406dfd2581c83113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / roccoro-0.1.1-py3-none-any.whl

Download URL roccoro-0.1.1-py3-none-any.whl
Size 62.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7de18197e55fa093d5634c47e83286b5c527519d56d0f99d0fd7d10166416a3
BLAKE2b-256 checksum
How to use checksums
b7d33d386e2bf449338b9b86bcf468a4764ad787d0e85a9cf6fd3d6a9989d525
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for roccoro 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for roccoro-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page