[Bounty $1500] RVC (Retrieval-based Voice Conversion) bring up using TTNN APIs

Tenstorrent Bounties

Issue ID: I_kwDOI9Wqc87XHtHH

:memo: Background

This bounty is for bringing up the RVC (Retrieval-based Voice Conversion) framework using TTNN APIs on Tenstorrent hardware (Wormhole or Blackhole).

RVC is an easy-to-use voice conversion framework based on VITS architecture from the RVC-Project. Key features include:

  • Retrieval-based approach: Uses feature index retrieval for high-quality voice conversion
  • VITS-based architecture: Variational Inference with adversarial learning for end-to-end TTS
  • Multiple pitch extraction: Supports pm, harvest, crepe, and rmvpe algorithms
  • Accent strength control: Adjustable feature index search ratio
  • Flexible voice control: Transpose, volume envelope, consonant protection
  • F0 curve manipulation: Optional external F0 curve file support
  • High quality: Natural-sounding voice conversion with artifact prevention
  • MIT License: Free for commercial use
  • Full deployment stack: Library, CLI, and API support with Docker

RVC enables high-quality voice conversion by combining VITS architecture with retrieval-based feature matching, making it suitable for singing voice conversion, dubbing, voice cloning, and personalized voice applications.

The goal is to enable this model to run on TT hardware for high-throughput, low-latency voice conversion across diverse use cases.

:bullseye: What Success Looks Like

A successful submission will fulfill all requirements in the following stages. Payout is made after all three stages are completed.

Stage 1 β€” Bring-Up

  • Implement RVC using TTNN APIs (Python)
  • Implements the full generation pipeline:
    • VITS encoder (posterior encoder)
    • Pitch extraction module (rmvpe or crepe)
    • Feature retrieval module (index-based)
    • Flow-based decoder
    • HiFi-GAN vocoder
  • Model runs on either N150 or N300 Tenstorrent hardware with no errors
  • Produces valid converted audio output
  • Output is verifiable (audio quality assessment, compare with PyTorch reference)
  • Achieves baseline throughput target:
    • At least 30 tokens/second for flow generation
    • Real-time factor (RTF) < 0.5 for typical utterances
  • Accuracy evaluation:
    • Speaker similarity > 75% (cosine similarity of speaker embeddings)
    • Content preservation: WER < 2.5
    • Token-level accuracy > 95% against PyTorch reference
  • Audio quality: Natural prosody, accurate pitch conversion, minimal artifacts
  • Clear instructions for setup and running the model

Stage 2 β€” Basic Optimizations

  • Use optimal sharded/interleaved memory configs for encoder-decoder layers
  • Implement efficient sharding strategy for:
    • VITS posterior encoder
    • Flow-based decoder layers
    • Pitch extraction module (rmvpe/crepe)
    • Feature retrieval index
    • HiFi-GAN vocoder layers
  • Fuse simple ops where possible (e.g., layer normalization, activation functions)
  • Store intermediate activations in L1 where beneficial
  • Use recommended TTNN/tt-metal flows for audio models
  • Leverage TT library of fused ops for convolution and attention blocks
  • Optimize feature index retrieval operations
  • Optimize pitch extraction and F0 manipulation
  • Optimize HiFi-GAN vocoder integration

Stage 3 β€” Deeper Optimization

  • Maximize core counts used per inference
  • Implement deeper TT-specific optimizations:
    • Efficient flow-based decoder computation
    • Flash Attention or equivalent for attention layers
    • Minimize voice conversion latency
    • Batch processing for multiple voice conversions
    • Optimize feature index search (retrieval operations)
    • Pipeline encoder/decoder/vocoder stages
    • Efficient pitch extraction and transposition
  • Minimize memory and TM (tensor manipulation) overheads
  • Explore caching strategies for feature indices
  • Document any advanced tuning, known limitations, or trade-offs
  • Target stretched goals:
    • 60+ tokens/second generation speed
    • RTF < 0.2 for real-time applications
    • Support for batch processing (5+ concurrent conversions)

:compass: Guidance & Starting Points

  • Use the TTNN model bring-up tech report as your primary reference
  • Reference audio model implementations in tt-metal for audio model patterns
  • Use the official RVC repository for model architecture details
  • Reference VITS architecture for understanding the base model
  • Refer to TT Fused ops PR #29236 for optimization opportunities
  • The model architecture consists of:
    • Posterior encoder: VITS encoder for extracting speaker features
    • Pitch extraction: rmvpe, crepe, harvest, or pm algorithms
    • Feature retrieval: Index-based retrieval for accent control
    • Flow-based decoder: Normalizing flows for acoustic modeling
    • HiFi-GAN vocoder: Neural vocoder for waveform generation
  • Key challenges:
    • Flow-based decoder optimization (normalizing flows)
    • Feature index retrieval efficiency
    • Pitch extraction and F0 manipulation
    • HiFi-GAN vocoder integration
    • Real-time conversion latency
    • Artifact prevention (consonant protection, volume envelope)
  • Ask for help or file issues if ops are missing in TTNN

:magnifying_glass_tilted_right: Possible Approaches

  • Start from the official RVC repository and port components sequentially:
    1. VITS posterior encoder
    2. Pitch extraction module (start with rmvpe)
    3. Feature retrieval and index search
    4. Flow-based decoder
    5. HiFi-GAN vocoder integration
    6. F0 manipulation and volume envelope control
    7. End-to-end pipeline with all control parameters
  • Validate each submodule’s output against PyTorch reference before integration
  • Use TTNN profiling tools to identify bottlenecks in:
    • Encoder processing time
    • Feature retrieval latency
    • Pitch extraction overhead
    • Flow decoder computation
    • Vocoder latency
  • Test diverse use cases:
    • Male-to-female and female-to-male conversion
    • Singing voice conversion
    • Different pitch transpositions (-12 to +12 semitones)
    • Various index rates (0.0 to 1.0)
    • Real-time conversion requirements
  • Open a draft PR early to get feedback on your approach

:bar_chart: Result Submission Guidelines

Beyond the model implementation itself, contributors must submit the following material as proof of work. However, feel free to open a PR at any time if you want us checking that you are on the right track. Just understand that payout is only made after all 3 stages are completed.

Deliverables:

  • Functional model implementation
  • Validation logs (output correctness)
  • Performance report + header for final review

Links:

:books: Resources

Model Resources

TT-Metal Resources