[diffusion]: Fix diffusers executor crash when component residency manager is absent#24573
Merged
mickqian merged 2 commits intosgl-project:mainfrom May 9, 2026
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
Author
Contributor
Author
|
/tag-and-rerun-ci |
mickqian
approved these changes
May 9, 2026
Collaborator
|
duplicated with #24748 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix a
--backend diffusersruntime crash introduced by the component residency manager refactor in #23771.DiffusersPipelineuses the commonSyncExecutor, but it was not binding a component residency manager before executing stages the way composed/native pipelines do. After the refactor, the shared executor calls residency hooks such ascomponent_residency_manager.begin_request(...). For diffusers pipelines, that manager wasNone, so generation failed before the diffusers pipeline ran.This change initializes the diffusers pipeline residency state and binds the global component residency manager to the executor before forwarding the request
Motivation
Forced diffusers backend models can load successfully but fail on the first generation request:
Testing
1x rtx5090 32GB
black-forest-labs/FLUX.2-klein-4B
Baseline command:
sglang generate \ --model-path black-forest-labs/FLUX.2-klein-4B \ --backend diffusers \ --trust-remote-code \ --prompt "A compact engineering test image of a red cube on a gray table, studio lighting" \ --height 512 \ --width 512 \ --num-inference-steps 1 \ --guidance-scale 1.0 \the pipeline loads:
but the generation request fails before the diffusers stage runs:
After fix command:
the pipeline loads:
And the generation request succeeds: