Skip to content

feat: enable dit cache for wan dual transformers. - #2226

Open
z-jun03 wants to merge 1 commit into
xLLM-AI:mainfrom
z-jun03:cache_wan
Open

feat: enable dit cache for wan dual transformers.#2226
z-jun03 wants to merge 1 commit into
xLLM-AI:mainfrom
z-jun03:cache_wan

Conversation

@z-jun03

@z-jun03 z-jun03 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds DiTCache support for the Wan2.2 dual-transformer pipeline.

The implementation:

  • isolates cache state for transformer and transformer_2 with separate scopes;
  • maintains independent local cache step IDs for both transformers;
  • separates normal and CFG cache states;
  • passes the request-level boundary_ratio to transformer selection and cache-step accounting;
  • integrates DiTCache step/block callbacks with rolling load;
  • keeps rolling H2D scheduling consistent when cache skips individual blocks;
  • preserves the existing behavior for non-cache and non-rolling-load paths.

These changes are required because Wan2.2 switches between two transformers during denoising. Sharing one cache state or using the global denoising step would cause cache state, warmup, and residual scheduling to become inconsistent between the two transformers.

Related Issues

N/A

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Documentation
  • Test
  • Build or CI

Pull Request Checklist

Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.

PR Title and Commit Messages

  • The PR title and each commit message follow the xLLM commit format: <type>: <subject>.

Suggested title:

feat: add dit cache support for wan dual transformers.

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.

1 participant