Skip to content

Tested Spectrum, Block Cache, SageAttention2, and ConvRot GGML implementations that may be useful for SD.cpp #1869

Description

@0xShug0

Hi @leejet,

I'm the maintainer of audio.cpp. I recently implemented the MiniMax-H3 text-to-audio path in GGML (released under the dev branch). The DiT path is effectively shared with video generation.

During the implementation, I tested several DiT optimizations that may also be useful for SD.cpp:

Spectrum-style acceleration
First-block / BlockCache
SageAttention
INT8 ConvRot

The biggest gain came from Spectrum. For a 30s H3 audio at 20 steps, Spectrum improved RTF from about 0.56 to 0.30. BlockCache also provided meaningful speedups, although quality was more sensitive to the number of steps. INT8 ConvRot gave consistent speedup on the normal DiT path, around 9%, and the optimizations could be combined.

I'm not planning to spend much time supporting or optimizing video model pipelines in audio.cpp. H3 video support mostly comes "for free" because the model produces audio and video latents jointly. These GGML implementations may be useful for video diffusion workloads in SD.cpp.

On RTX 5090, for the 1344x768 / 124 frames (5 seconds) / 20 steps case from the official comfyui workflow (the "Realistic live-action cinematic look, action movie trailer..." one) :

INT8 ConvRot, no spectrum --- 260.839 s
INT8 ConvRot + spectrum --- 114.035 s

For video, INT8 ConvRot + spectrum actually looks better.

Feel free to use the implementations at https://github.com/0xShug0/audio.cpp/tree/dev if they’re useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions