Skip to content

[WIP][modular] update required_inputs, adding override_attribute etc - #15136

Open
yiyixuxu wants to merge 1 commit into
conditional-runtime-defaultsfrom
sequential-required-inputs
Open

yiyixuxu wants to merge 1 commit into
conditional-runtime-defaultsfrom
sequential-required-inputs

Conversation

@yiyixuxu

@yiyixuxu yiyixuxu commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

fix #15009
related #15133

…walk

Sequential and loop blocks decide each input's `required` flag and default in one
ordered walk over their sub-blocks; `required_inputs` is derived from `inputs` as
in conditional blocks, and the two overrides are gone. Composites declare their
own `InputParam`/`OutputParam`/`ComponentSpec`/`ConfigSpec` for a derived entry
with `*_overrides`, and get a FutureWarning until they settle a default two
sub-blocks disagree on, a conditional block's per-branch defaults included.
Leaf blocks declare what they write back, docstrings regenerated.

Fixes #15009.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests modular-pipelines size/L PR with diff > 200 LOC labels Oct 27, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

f"{block_name}.{attr_name}['{name}'] must be of type {expected.__name__}, replacing the derived one; "
f"got {type(declaration).__name__}."
)
items[index[name]] = declaration

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could the declaration name (or kwargs group) be checked against the override key? {"height": InputParam("width", default=512)} currently passes validation and replaces the public height input with width, while the child still reads height. Rejecting this mismatch would prevent a silently ineffective override.

f"`input_overrides` on {self.__class__.__name__} to pick the default explicitly.",
standard_warn=False,
)
if isinstance(block, ConditionalPipelineBlocks) and block.default_block_name is None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could guaranteed outputs be derived from every reachable branch, including nested composites? A conditional with a default branch can still produce different output sets; treating its union as guaranteed drops a later required input even when the selected branch never produces it. Wrapping a skippable conditional in a sequence has the same problem.

if description is not None:
instance.description = description
for name, value in (
("input_overrides", input_overrides),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could get_execution_blocks() preserve applicable overrides when it calls from_blocks_dict()? An input overridden to 0.9 currently reverts to the leaf default 0.3 in the extracted blocks, so initializing a pipeline from the selected workflow changes its behavior. Please cover overrides during workflow extraction.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation modular-pipelines size/L PR with diff > 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants