[diffusion] fix: handle disabled component residency in executor#24748
[diffusion] fix: handle disabled component residency in executor#24748mickqian wants to merge 1 commit into
Conversation
|
/tag-and-rerun-ci |
There was a problem hiding this comment.
Code Review
This pull request introduces null checks for component_residency_manager in the PipelineExecutor class to prevent potential runtime errors. The review feedback identifies a potential AttributeError in begin_component_residency_request when the batch parameter is a list during grouped execution and suggests handling this case in both begin_component_residency_request and before_stage to ensure type consistency.
| if self.component_residency_manager is None: | ||
| return |
There was a problem hiding this comment.
While adding the null check is correct, the batch parameter can be a list of requests when called from execute_group. The component_residency_manager.begin_request method expects a single object satisfying the ResidencyBatch protocol (to access is_warmup), so passing a list will cause an AttributeError. Rebinding batch to its first element when it is a list ensures compatibility with grouped execution.
| if self.component_residency_manager is None: | |
| return | |
| if self.component_residency_manager is None: | |
| return | |
| if isinstance(batch, list): | |
| batch = batch[0] |
| if self.component_residency_manager is None: | ||
| return |
There was a problem hiding this comment.
Similar to begin_component_residency_request, batch can be a list of requests during grouped execution. Although the current implementation of manager.before_stage does not access batch.is_warmup, it is better to pass the expected type to maintain consistency and avoid potential issues if the manager's implementation changes in the future.
if self.component_residency_manager is None:
return
if isinstance(batch, list):
batch = batch[0]|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Motivation
Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci