Skip to content

[Bug fix] tt_dit: run_single_prompt forwards guidance_scale, prompt_2 and negative_prompt_2 - #65025

Draft
singhharsh1708 wants to merge 1 commit into
tenstorrent:mainfrom
singhharsh1708:fix/tt-dit-run-single-prompt-guidance-prompt2
Draft

singhharsh1708 wants to merge 1 commit into
tenstorrent:mainfrom
singhharsh1708:fix/tt-dit-run-single-prompt-guidance-prompt2

Conversation

@singhharsh1708

Copy link
Copy Markdown
Contributor

PR Category

Bug fix

Summary

PipelineAPIMixin.run_single_prompt (models/tt_dit/pipelines/pipeline_api.py) takes only prompt, negative_prompt, num_inference_steps, seed and on_event, so a caller holding a guidance scale or a second text-encoder prompt has no way to pass them short of calling the pipeline directly. tt-inference-server's TTDiTRunner serves SD3.5 Large and FLUX.1-dev through this entry point, and its image request already accepts guidance_scale, prompt_2 and negative_prompt_2; today they stop at the runner, so SD3.5 Large always runs at the pipeline's 3.5 and both models feed the first prompt to the second encoder.

This adds guidance_scale, prompt_2 and negative_prompt_2 to run_single_prompt. Each is forwarded only when given (as guidance_scale, prompts_2=[...], negative_prompts_2=[...]), so pipelines without those parameters (Motif, QwenImage and FIBO take cfg_scale; Mochi, Wan and Ideogram have no second prompt) are called exactly as before, and a caller passing an argument a pipeline lacks gets that pipeline's TypeError. With none of the three set the call is identical to the current one. The _Pipeline protocol gains **kwargs to match.

Notes for reviewers

Mapping guidance_scale onto cfg_scale for Motif, QwenImage and FIBO is left out on purpose; none of them is served with a guidance value through this entry point today, and the two names carry different defaults.

Verification

New device-free test models/tt_dit/tests/unit/test_pipeline_api.py, in the style of test_observability.py, with a recording pipeline: the default call passes the original six keyword arguments and nothing else; a call with all three new arguments passes them as single-item lists and a float. On main the second test fails with TypeError: run_single_prompt() got an unexpected keyword argument 'prompt_2'; with this change both pass (run with --noconftest together with test_observability.py: 10 passed).

Not run: any pipeline on device or simulator. The existing callers (test_performance_flux1.py, test_performance_motif.py, dataset_eval/test_tt_dit.py) pass only the old arguments and are unaffected.

Code owners

  • Ping pending code owners

@singhharsh1708
singhharsh1708 requested review from a team as code owners November 9, 2026 16:28
Copilot AI balanced review requested due to automatic review settings November 9, 2026 16:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants