Add regression tests for schedulers, loaders, and pipeline weight selection - #30
Draft
cursor[bot] wants to merge 3 commits into
Draft
Add regression tests for schedulers, loaders, and pipeline weight selection#30cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
Cover FlowMatchEulerDiscreteScheduler, HeliosScheduler, and LTXEulerAncestralRFScheduler contract behavior, DDIM/DDPM set_timesteps validation guards, state_dict LoRA conversion paths, and remote_utils encode/decode helpers. Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
…g_utils Cover high-blast-radius code paths that previously only had indirect pipeline coverage: - CogVideoXDDIMScheduler SNR shift and set_timesteps guard - CogVideoXDPMScheduler multi-step API (old_pred_original_sample) - DDPMWuerstchenScheduler float timestep schedule and add_noise - loading_utils path/URL validation and submodule resolution Use python -m ruff in check_copies so the commit hook works when ruff is installed as a Python package but not on PATH. Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
…nference 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.
What does this PR do?
Adds fast regression tests for high-blast-radius utilities and schedulers that previously had little or no direct unit coverage.
Risky behavior now covered
_get_ignore_patterns— decides which weight formats (.bin,.safetensors,.onnx, flashpack) are downloaded/loaded on everyfrom_pretrainedcall; now tested for flax, safetensors, flashpack, pickle fallback, ONNX toggles, and incompatible-safetensors errors.infer_diffusers_model_type— shape/key-based checkpoint classifier gating all single-file loading; now tested for Flux2, LTX2, Wan variants, Z-Image ControlNet 2.0 vs 2.1, Cosmos invalid shapes, and v1 fallback.state_dict_utils— LoRA key-format translation (DIFFUSERS ↔ PEFT ↔ Kohya); round-trip and fallback paths.loading_utils—load_image/load_videovalidation, submodule resolution for LoRA injection.remote_utils— remote VAE encode/decode input validation.set_timesteps,step, and scheduler-specific math.Test files added/updated
tests/loaders/test_single_file_utils.pyinfer_diffusers_model_typebranch coveragetests/pipelines/test_pipeline_utils.pyIgnorePatternsTestsfor_get_ignore_patternstests/others/test_state_dict_utils.pytests/others/test_loading_utils.pytests/others/test_remote_utils.pytests/schedulers/test_scheduler_flow_match_euler_discrete.pytests/schedulers/test_scheduler_helios.pytests/schedulers/test_scheduler_ltx_euler_ancestral_rf.pytests/schedulers/test_scheduler_cogvideox.pytests/schedulers/test_scheduler_ddpm_wuerstchen.pyWhy these tests materially reduce regression risk
These modules sit on critical paths used by dozens of pipelines. Integration tests exercise happy paths only; a wrong ignore pattern or misclassified checkpoint type fails silently or at Hub download time. The new tests are deterministic, CPU-only, and run in ~6s (96 tests), making them suitable for every CI run.
Validation
Result: 96 passed
Before submitting