fix: LoRA engine-cache correctness + per-engine VAE opt-level#19
Open
forkni wants to merge 6 commits into
Open
fix: LoRA engine-cache correctness + per-engine VAE opt-level#19forkni wants to merge 6 commits into
forkni wants to merge 6 commits into
Conversation
…led engines On load_lora_weights failure the entry was silently dropped from the merge list but the original lora_dict remained, so get_engine_path() still built a cache path with the failed LoRA's signature — producing a no-LoRA engine permanently labelled as a LoRA engine (G1 cache-poisoning bug). Changes: - Track only successfully loaded adapters in _loaded_adapter_names dict - After merge, reassign lora_dict to only the fused entries (or None if all failed) so engine paths always reflect actual UNet weight content - Replace warn-and-continue on fuse_lora failure with RuntimeError: partial fusion leaves UNet weights ambiguous; a TRT engine built from that state is never correct and must not be silently cached
Runs two StreamDiffusionWrapper passes (acceleration=none, same seed) and saves baseline.png, lora.png, and a side-by-side comparison PNG. Purpose: verify a LoRA loads on sdxl-turbo and is visibly effective at 2 denoising steps before paying the fp8 TRT engine build cost. Default: nerijs/pixel-art-xl @ 1.0 (SDXL, strong style at 2 steps) Usage: venv/Scripts/python scripts/test_lora_sanity.py venv/Scripts/python scripts/test_lora_sanity.py --lora not/a-real-lora
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.
Changes
Branch
feat/lora-engine-cache-fixes->SDTD_031_dev