fix(vae): avoid duplicate CPU fallback scheduler backend - #34
Open
aegioscy wants to merge 3 commits into
Open
Conversation
Do not register the internal scheduler CPU fallback when a VAE retry is already running on its explicit CPU backend.
Keep ModelManager compute assignments synchronized with temporary CPU VAE execution, release fallback staging before restoration, and cover symmetric backend reassignment.
~ModelManager force-frees the param storage blocks and writes through the registered ggml tensors (free_params_storage_block: state->tensor->buffer = nullptr). Those tensors live in the runner contexts, and runners hold only weak_ptr refs to the manager - so the manager must be destroyed first, while the tensors are alive. That is exactly how StableDiffusionGGML orders its members; both ABot entry points had it inverted: - AbotWalkSession declared model_manager before runner/tae, so member destruction killed the runners first and ~ModelManager corrupted freed memory at sd_abot_session_free. - sd_abot_scene_create declared the manager local before the t5/vae runners, with the same inverted teardown at scope exit - crashing (STATUS_HEAP_CORRUPTION / SIGSEGV) after the scene pack had already been written successfully. Fix by declaration order alone, mirroring StableDiffusionGGML: the manager is declared after the runners in both places. Surfaced by the qvac diffusion 2026-08-11 pair bump (QVAC-23767): the addon's abot-world integration test died with exit 139 right after the umT5 load on both linux-x64 GPU legs. Reproduced locally on CPU and root-caused with gdb (free_params_storage_block <- release_all <- ~ModelManager <- scene-create scope exit); with this change scene creation and a full walk block (frames decoded and written) both complete and exit cleanly.
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.
Summary
Validation
test-vae-routingandtest-gguf-comfy-shape.