(#2820) validation adapter assignment into other (frozen/untrained) inference stages - #2829
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a target_stage option to validation adapter runs so LoRA adapters can be applied to specific inference/validation stages in multi-stage models (e.g., SDXL stage1 vs stage2, DeepFloyd stage1/2/3, Wan high/low). This expands the validation adapter system from “apply to whole validation” to “apply at specific stage(s)”, and updates docs/UI help text accordingly.
Changes:
- Extend validation adapter config/spec parsing with
target_stageand stage-name normalization. - Add model-specific stage alias maps (and Wan-specific load/component routing) and pass
target_stagethrough all multi-stage validation paths. - Update tests and OPTIONS documentation (EN + translations) to cover
target_stage.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_wan_model.py | Updates expected pipeline_call signature/args to include target_stage. |
| tests/test_validation_adapters.py | Adds parsing + stage-targeted adapter loading tests (including Wan transformer_2 routing). |
| tests/test_sdxl_multistage_validation.py | Updates callbacks to accept target_stage in multi-stage validation. |
| tests/test_pixart_multistage_validation.py | Updates callbacks to accept target_stage in multi-stage validation. |
| tests/test_ltxvideo2_multistage_validation.py | Updates callbacks to accept target_stage in multi-stage validation. |
| tests/test_deepfloyd_multistage_validation.py | Asserts stage sequence is passed through target_stage. |
| simpletuner/simpletuner_sdk/server/services/field_registry/sections/validation.py | Updates UI tooltip to mention target_stage. |
| simpletuner/helpers/training/validation.py | Core stage alias resolution + stage-scoped adapter load/apply/remove logic; passes target_stage into pipeline calls. |
| simpletuner/helpers/training/validation_adapters.py | Adds target_stage to adapter specs and config parsing + normalization helper. |
| simpletuner/helpers/models/wan/model.py | Defines Wan stage aliases + load kwargs + component routing; passes ("high","low") target stages. |
| simpletuner/helpers/models/sdxl/model.py | Defines SDXL stage aliases; passes target_stage per stage call. |
| simpletuner/helpers/models/pixart/model.py | Defines PixArt stage aliases; passes target_stage per stage call. |
| simpletuner/helpers/models/ltxvideo2/model.py | Defines LTX-2 stage aliases; passes target_stage per stage call. |
| simpletuner/helpers/models/deepfloyd/model.py | Defines DeepFloyd stage aliases; passes target_stage per stage call. |
| simpletuner/helpers/models/common.py | Adds base APIs for stage aliases + stage-specific adapter load kwargs/component selection. |
| documentation/OPTIONS.md | Documents target_stage in validation adapter config (English). |
| documentation/OPTIONS.es.md | Documents target_stage in validation adapter config (Spanish). |
| documentation/OPTIONS.hi.md | Documents target_stage in validation adapter config (Hindi). |
| documentation/OPTIONS.ja.md | Documents target_stage in validation adapter config (Japanese). |
| documentation/OPTIONS.pt-BR.md | Documents target_stage in validation adapter config (Portuguese BR). |
| documentation/OPTIONS.zh.md | Documents target_stage in validation adapter config (Chinese). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Closes #2820
This pull request adds support for specifying and handling multi-stage validation targets for adapters across several models, and updates documentation in multiple languages to describe the new
target_stageoption. Each supported model now defines its own mapping of user-facing stage aliases, and the validation pipeline is updated to pass thetarget_stageparameter appropriately. This enables more flexible and explicit control over which validation stage an adapter applies to, improving the multi-stage validation workflow.Multi-stage validation enhancements:
Added the
target_stageparameter to validation adapter configuration, allowing users to specify which validation stage an adapter should apply to. This is now documented in English, Spanish, Hindi, Japanese, Portuguese, and Chinese (OPTIONS.md,OPTIONS.es.md,OPTIONS.hi.md,OPTIONS.ja.md,OPTIONS.pt-BR.md,OPTIONS.zh.md). [1] [2] [3] [4] [5] [6]Each model class (
deepfloyd,ltxvideo2,pixart,sdxl,wan) now implementsvalidation_adapter_stage_aliases, returning the supported stage names and their accepted aliases. Thewanmodel also implementsvalidation_adapter_load_kwargsandvalidation_adapter_componentfor fine-grained adapter loading. [1] [2] [3] [4] [5] [6]Validation pipeline updates:
target_stageargument topipeline_callin all multi-stage validation routines, ensuring adapters are loaded and applied at the correct stage for each model. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Codebase maintenance:
validation.pyto include new utilities for adapter stage normalization. [1] [2]