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)

Instant 1-command uvx demo (~84 MB download, zero PyTorch or CUDA!)

uvx roccoro "Hello from Strix Halo at two hundred forty five times real time!" -o hello.wav

On first run, roccoro automatically compiles roccoro-engine for your GPU arch (~6 s), downloads & folds Kokoro-82M weights in pure NumPy (~199 MiB, zero PyTorch), and caches everything under ~/.cache/roccoro/.

Or install permanently with pip

pip install roccoro
roccoro build            # optional: auto-detects GPU arch via rocminfo (or pass --arch gfx1151)
roccoro export-weights   # optional: pure-NumPy weight export -> ~/.cache/roccoro/kokoro_v1_fp32.khip

# Synthesize speech (24 kHz WAV)
roccoro "Hello from Strix Halo!" -o hello.wav
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.4

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.4
File Size Uploaded Provenance Actions
roccoro-0.1.4.tar.gz 66.6 kB With provenance Details for roccoro-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 132.9 kB

Release files / roccoro-0.1.4.tar.gz

Download URL roccoro-0.1.4.tar.gz
Size 66.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d6d90bba0c0e9d32e4695897dde0e9309ad1315dd9045596599a22b839b3b777
BLAKE2b-256 checksum
How to use checksums
95a65358e636966378fd98fc7be9c5420476a723c5386e7ad26dcb4d91d4a74f
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 30, 2026.

Transparency log

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

Download URL roccoro-0.1.4-py3-none-any.whl
Size 66.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f94143a99912ad2c0c56995bb0281934ef5dcdcd95f4172e2891a2198b5b1bd
BLAKE2b-256 checksum
How to use checksums
c5d04004f4dfbd621c528f11d95ab0b931bf8a70064b720580becdf3ca50226e
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 30, 2026.

Transparency log

Security for roccoro 0.1.4

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.4.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 30, 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