Skip to content

fix: adding teacache.params back to sampling params as intended#20665

Merged
dougyster merged 4 commits intomainfrom
diffusion-teacache-fix
Mar 16, 2026
Merged

fix: adding teacache.params back to sampling params as intended#20665
dougyster merged 4 commits intomainfrom
diffusion-teacache-fix

Conversation

@dougyster
Copy link
Copy Markdown
Collaborator

@dougyster dougyster commented Mar 16, 2026

Motivation

Currently, adding enable_teacache=true fails with 'Req' object has no attribute 'teacache_params'. This bug was introduced in PR #19964 which intended to remove teacache_params from the request body so fallback to sampling params to be handled, but teacache_params were not on sampling params.

Also added teacache params for Wan 2.2 using the Wan2.1 14B coefficients as a proxy so that enable_teacache actually takes effect.

Modifications

Adding teacache_params back to sampling params and added teacache_params: to class Wan2_2_Base_SamplingParams.

Accuracy Tests

python3 -m
  sglang.multimodal_gen.runtime.entrypoints.cli.main
  serve \
    --model-path Wan-AI/Wan2.2-T2V-A14B-Diffusers \
    --dit-layerwise-offload \
    --host 0.0.0.0 --port 8080

  Request:
  curl "http://localhost:8080/v1/videos" \
    -F "prompt=A dog running through a park" \
    -F "size=832x480" \
    -F "num_frames=81" \
    -F "fps=24" \
    -F "num_inference_steps=50" \
    -F "guidance_scale=5.0" \
    -F "negative_prompt=blurry, low quality, distorted"
   \
    -F "seed=42" \
    -F "enable_teacache=true"
wan22-teacache-test.mp4

Benchmarking and Profiling

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions bot added the diffusion SGLang Diffusion label Mar 16, 2026
Copy link
Copy Markdown
Collaborator

@mickqian mickqian left a comment

Choose a reason for hiding this comment

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

could we modify a testcase to guard this model?

@dougyster
Copy link
Copy Markdown
Collaborator Author

could we modify a testcase to guard this model?

Added a teacache test for Wan2.2!

@mickqian
Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@yhyang201
Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@yhyang201
Copy link
Copy Markdown
Collaborator

@mickqian All CI (Nvidia + AMD) passed and PR is approved, ready for merge

— SGLDHelper bot

@dougyster dougyster merged commit 061ec58 into main Mar 16, 2026
118 of 125 checks passed
@dougyster dougyster deleted the diffusion-teacache-fix branch March 16, 2026 18:27
JustinTong0323 pushed a commit to JustinTong0323/sglang that referenced this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants