Skip to content

[DtoH sync] set scheduler begin index in SD3 T2I#14176

Open
laradipupo wants to merge 1 commit into
huggingface:mainfrom
laradipupo:fix/dtoh-sync-sd3
Open

[DtoH sync] set scheduler begin index in SD3 T2I#14176
laradipupo wants to merge 1 commit into
huggingface:mainfrom
laradipupo:fix/dtoh-sync-sd3

Conversation

@laradipupo

Copy link
Copy Markdown

Description

Sets the scheduler's begin index to 0 before the denoising loop in SD3 T2I, eliminating the implicit GPU→CPU synchronization point from index_for_timestep.item(). This enables full torch.compile graph capture.

Follows the established pattern from PR #11696 (already deployed in Flux, Flux2, Wan, Z-Image, OVIS-Image, and SDXL).

Changes

  • src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py: Added canonical set_begin_index(0) block with hasattr guard before the denoising loop.

Verification

  • Fast tests pass: pytest tests/pipelines/stable_diffusion_3/ -x -v
  • make style && make fix-copies && make quality clean

This is commit 1 of 6 per the Phase 1 plan.

@github-actions github-actions Bot added pipelines size/S PR with diff < 50 LOC labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipelines size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant