Skip to content

(#2820) validation adapter assignment into other (frozen/untrained) inference stages - #2829

Merged
bghira merged 2 commits into
mainfrom
feature/stage-specific-inference-lora
Jul 16, 2026
Merged

(#2820) validation adapter assignment into other (frozen/untrained) inference stages#2829
bghira merged 2 commits into
mainfrom
feature/stage-specific-inference-lora

Conversation

@bghira

@bghira bghira commented Jul 16, 2026

Copy link
Copy Markdown
Owner

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_stage option. Each supported model now defines its own mapping of user-facing stage aliases, and the validation pipeline is updated to pass the target_stage parameter 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_stage parameter 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 implements validation_adapter_stage_aliases, returning the supported stage names and their accepted aliases. The wan model also implements validation_adapter_load_kwargs and validation_adapter_component for fine-grained adapter loading. [1] [2] [3] [4] [5] [6]

Validation pipeline updates:

  • The validation pipeline now passes the target_stage argument to pipeline_call in 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:

  • Updated imports in validation.py to include new utilities for adapter stage normalization. [1] [2]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_stage and stage-name normalization.
  • Add model-specific stage alias maps (and Wan-specific load/component routing) and pass target_stage through 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.

Comment thread simpletuner/helpers/training/validation.py
Comment thread simpletuner/helpers/training/validation.py
@bghira
bghira merged commit dda8a86 into main Jul 16, 2026
3 checks passed
@bghira
bghira deleted the feature/stage-specific-inference-lora branch July 16, 2026 20:23
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.

validation adapters config should allow targeting specific inference stage

2 participants