Skip to content

feat: add warmup support to cosine scheduler#896

Open
Packsod wants to merge 990 commits into
ostris:developmentfrom
Packsod:main
Open

feat: add warmup support to cosine scheduler#896
Packsod wants to merge 990 commits into
ostris:developmentfrom
Packsod:main

Conversation

@Packsod

@Packsod Packsod commented Jun 19, 2026

Copy link
Copy Markdown

Description

This PR adds warmup support to the cosine learning rate scheduler.

Previously, configuring a cosine schedule with warmup steps wasn't fully supported or would skip warmup if parameters were misplaced. By properly checking num_warmup_steps within lr_scheduler_params, users can now smoothly scale up their learning rate before entering the cosine decay phase.

Changes

  • Updated get_lr_scheduler in scheduler.py to handle num_warmup_steps for the cosine name branch.
  • Implemented a custom LambdaLR logic when warmup_steps > 0 to combine linear warmup with cosine annealing, reusing the automatically passed total_iters/T_max.
  • Falls back to the original CosineAnnealingLR seamlessly if no warmup steps are provided.

Usage Example

lr_scheduler: "cosine"
lr_scheduler_params:
  num_warmup_steps: 200
  eta_min: 0.000005

jaretburkett and others added 30 commits February 6, 2026 16:18
* Initial support for ltx 2.3. Still needs a lot of testing to make sure it is all right.

* bump version

* Handle lora renaming keys for new ltx 2.3 layers
…o convert surround sound audio to stereo. Invalidate old caches just to be safe so they recache now.
* Fix Qwen Image mask handling

* Fix Qwen attention mask crash with diffusers >=0.37

diffusers v0.37 (PR #12987) optimizes all-ones attention masks to None
in encode_prompt() when there is no padding. This breaks ai-toolkit's
Qwen extensions which call .to() on the mask unconditionally.

Fix: reconstruct the all-ones mask at the boundary (get_prompt_embeds)
right after encode_prompt() returns. This keeps the rest of the code
unchanged and works with both old and new diffusers versions.

Also removes redundant duplicate mask assignments in qwen_image_edit
and qwen_image_edit_plus.

Fixes ostris#740
Apply random_noise_multiplier to noise.
… videos. Varous ltx 2.3 VAE optimizations such as removing tiling articacts, and doing frame split encoding to reduce vram on encoding/decoding.
jaretburkett and others added 30 commits June 12, 2026 12:16
…l for DFE and other methods that target pixelspace losses.
…ely resemble the full pipeline results. I pushed a finetuned unconditional lora to the hub as an adapter.
Read num_warmup_steps from lr_scheduler_params to enable custom warmup length.

Fallback to standard CosineAnnealingLR if no warmup steps are specified.
- extends the `cosine` learning rate scheduler to support a configurable cosine decay window via `cosine_decay_steps`.
- If `cosine_decay_steps` is not provided, it defaults to `steps` to preserve current behavior.
- If `cosine_decay_steps` is smaller than the total training steps, the scheduler finishes cosine annealing early and keeps the learning rate at `eta_min` until training ends.
- If `cosine_decay_steps` exceeds `steps`, it is clamped to `steps` with a warning.
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.