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/43phoneme duration mismatches on reference fixture (verify_fixture— 19/19 layer checks pass). - Audio fidelity:
cos = 0.99936waveform correlation on deterministic fixture,env_mel_cos = 0.9999986/env_mel_lsd_db = 0.0395 dBvs ONNX CPU FP32 on an 82-minute chapter. - Roofline utilization: Custom
gfx1151wave32 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 (~95 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:
- Launch:
roccoro-engine --weights kokoro_v1_fp32.khip --arena-mb 448 --max-batch 32 - Engine writes 4-byte ready magic
0x4B484F4B("KHOK"). - Client sends request frames:
<magic=0x4B485251, num_chunks, speed_f32, max_batch>followed bynum_chunksrecords of<token_len_u32, seed_u64, style_256xf32, tokens_lenxi32>. - Engine replies:
<magic=0x4B485250, num_chunks>followed bynum_chunksrecords of<n_samples_u32, pcm_f32[n_samples]>. - 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 withroccoro build --arch <gfxXXXX>.
Credits & License
- Model architecture & weights: Kokoro-82M (Apache 2.0) and Misaki G2P.
- Extracted from mumblebee and inspired by custom HIP roofline kernel engineering in brainchop-core.
- Licensed under the MIT License.
Metadata
Release files for roccoro 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| roccoro-0.1.2.tar.gz | 64.8 kB | With provenance | Details for roccoro-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| roccoro-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for roccoro-0.1.2-py3-none-any.whl |
Total release size: 129.4 kB
Release files / roccoro-0.1.2.tar.gz
| Download URL | roccoro-0.1.2.tar.gz |
|---|---|
| Size | 64.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86bd8868938a2981c25818ed8b952560be82812d17242b1f1875089dbc3f42b9
|
|
BLAKE2b-256 checksum How to use checksums |
d2562428e0e9aab6b42d8a0ff865a23567fc849abceba30e259e06c14fef1101
|
| 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 logRelease files / roccoro-0.1.2-py3-none-any.whl
| Download URL | roccoro-0.1.2-py3-none-any.whl |
|---|---|
| Size | 64.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
040d875ca9896d308c7f962ba7226c439eff9f78485186b50da4cc4220f8fdfa
|
|
BLAKE2b-256 checksum How to use checksums |
41ff9d59756c13fc667046758d510962c9660add721c6ad1003fe0030265119b
|
| 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 logSecurity for roccoro 0.1.2
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.
Attestation for roccoro-0.1.2.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 logA 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.