Repository navigation
vae: a decode graph with no room on the device is decoded again in smaller tiles - #8
Merged
cynodesmus merged 1 commit intoNov 19, 2026
Conversation
…aller tiles The graph of a tile is measured on a scheduler of its own before anything is allocated (ggml_backend_sched_reserve_size) and set against the device's free memory; on a card it leaves 768 MiB for what the desktop, a browser and the CUDA context hold, since the driver tells a process only its own room. A graph that does not fit, or an allocation that fails, makes the whole decode start over in tiles half the size, down to 64 frames, instead of failing the song or, on Windows, spilling into the computer's memory and running many times slower. An error or a cancel is not retried.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ServeurpersoCom#29
On a card that is short of memory the VAE decode either failed the song ("graph alloc failed") or, on
Windows with the NVIDIA driver's default, spilled into system memory and ran many times slower without any
error.
Now, before a tile's graph is allocated, it is measured on a scheduler of its own
(
ggml_backend_sched_reserve_size) and compared with the device's free memory; on a GPU it leaves 768 MiB forwhat the desktop, a browser and the CUDA context hold, because the driver reports a process only its own room.
A graph that does not fit — or an allocation that still fails — returns
VAE_GRAPH_NO_FIT, andvae_ggml_decode_tiledstarts the whole decode over in tiles half the size, down to 64 frames, before itgives up with an out-of-memory message. Errors and cancels are not retried. Memory the scheduler already holds
for an earlier tile counts as available. The public signature of
vae_ggml_decode_tiledis unchanged.In the engine of YuE2 Studio 4.1.0 (our fork, commits 20364d8 and 67f59c1): on an RTX 4090 every song decodes through the fitting path. The retry itself was not exercised on a 4-6 GB card, we have none.
Ported onto master by hand from our fork, where it runs in YuE2 Studio 4.1.0; not built on master on our side.