Skip to content

Fix modular pipeline: check required before applying default in get_block_state - #14395

Closed
lorenzozanee wants to merge 0 commit into
huggingface:mainfrom
lorenzozanee:fix/modular-required-param-default
Closed

Fix modular pipeline: check required before applying default in get_block_state#14395
lorenzozanee wants to merge 0 commit into
huggingface:mainfrom
lorenzozanee:fix/modular-required-param-default

Conversation

@lorenzozanee

@lorenzozanee lorenzozanee commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Fixes #14388

InputParam.template("num_inference_steps", required=True) was silently ignored because get_block_state would substitute the template's default before checking required. This moves the required check before the default fallback.

  • Adds regression tests covering missing required inputs (with/without template defaults), satisfied required inputs, and optional defaults.
  • Builds on the fix and tests by @yiyixuxu.

AI self-review: READY
Validated: test_modular_pipelines_custom_blocks.py, test_conditional_pipeline_blocks.py, ruff, check_copies, check_dummies, check_support_list.
Upstream-only CI: pr_tests.yml (GPU jobs), pr_tests_gpu.yml, pr_modular_tests.yml, pr_dependency_test.yml, pr_torch_dependency_test.yml, build_documentation.yml, build_pr_documentation.yml, pr_style_bot.yml.

@lorenzozanee

lorenzozanee commented Aug 5, 2026

Copy link
Copy Markdown
Author

AI self-review: READY
Validated: test_modular_pipelines_custom_blocks.py (5 new regression + 18 existing, 2 skipped), test_conditional_pipeline_blocks.py (31 passed), ruff (All checks passed), check_copies, check_dummies, check_support_list (all clean), git diff --check (clean).
Upstream-only CI: pr_tests.yml (GPU jobs), pr_tests_gpu.yml, pr_modular_tests.yml, pr_dependency_test.yml, pr_torch_dependency_test.yml, build_documentation.yml, build_pr_documentation.yml, pr_style_bot.yml, claude_review.yml (AI review job).

@lorenzozanee
lorenzozanee force-pushed the fix/modular-required-param-default branch from 326410b to 09514d4 Compare August 5, 2026 13:52
@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/M PR with diff < 200 LOC labels Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modular: required=True is silently ignored when an InputParam carries a default

1 participant