Skip to content

fix(vae): avoid duplicate CPU fallback scheduler backend - #34

Open
aegioscy wants to merge 3 commits into
2026-08-11from
fix/wan-vae-midrun-cpu-fallback
Open

fix(vae): avoid duplicate CPU fallback scheduler backend#34
aegioscy wants to merge 3 commits into
2026-08-11from
fix/wan-vae-midrun-cpu-fallback

Conversation

@aegioscy

Copy link
Copy Markdown

Summary

  • Avoid registering the internal scheduler CPU fallback when a VAE graph is already retried on its explicit CPU backend.
  • Prevent ambiguous duplicate CPU routes during mid-run VAE backend fallback.
  • Keep the ggml submodule unchanged.

Validation

  • Release engine build completed successfully on nv5090.
  • All 8 CTest regressions passed, including test-vae-routing and test-gguf-comfy-shape.
  • Windows Vulkan Wan I2V CI validation is the remaining check.

aegioscy and others added 3 commits August 25, 2026 11:55
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants