Add regression tests for FlowMatchEuler, DDIM guard, and LoRA state dict utils#6
Draft
cursor[bot] wants to merge 1 commit into
Draft
Add regression tests for FlowMatchEuler, DDIM guard, and LoRA state dict utils#6cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…ict utils - FlowMatchEulerDiscreteScheduler: contract tests for validation, dynamic shifting, integer-timestep rejection, and stochastic sampling - DDIMScheduler: lock down set_timesteps guard against inverted comparison - state_dict_utils: unit tests for LoRA key remapping and error paths Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
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.
Risky behavior now covered
FlowMatchEulerDiscreteScheduler
The default scheduler for SD3, Flux, Wan, Qwen-Image, and many other pipelines had no dedicated scheduler test file. Pipeline tests only smoke-test it as a black box. New contract tests lock down:
mustep()(a common pipeline footgun)DDIMScheduler
set_timestepsguardAn eval branch demonstrated that inverting the
num_inference_steps > num_train_timestepscomparison silently breaks all valid inference schedules. New tests assert the guard rejects over-limit steps and accepts the boundary value.LoRA state dict conversion (
state_dict_utils)Every LoRA load path goes through
convert_state_dict_to_peft/convert_state_dict_to_diffusers/convert_unet_state_dict_to_peft, but these had zero direct unit tests. New tests verify key remapping for diffusers-old, PEFT, and UNet formats, plus error paths for unrecognized state dicts.Test files added/updated
tests/schedulers/test_scheduler_flow_match_euler_discrete.py(11 tests)tests/schedulers/test_scheduler_ddim.py(2 tests)tests/others/test_state_dict_utils.py(6 tests)Why these tests materially reduce regression risk
ValueErrorpaths that are easy to break during refactors but invisible to pipeline smoke tests.Validation
All 19 new tests pass locally: