Skip to content

[graph_trainer] Fix AutoParallel input_fn to include positions tensor - #3315

Merged
IvanKobzarev merged 1 commit into
mainfrom
ap-input-fix
May 11, 2026
Merged

IvanKobzarev merged 1 commit into
mainfrom
ap-input-fix

Conversation

@IvanKobzarev

Copy link
Copy Markdown
Contributor

AutoParallel's input_fn() only returned tokens, but Decoder.forward() also receives positions via extra_kwargs. This caused a mismatch between the number of graph placeholders (from tracing with tokens only) and the actual runtime args (which include positions), failing with "expected N arguments for placeholders but received N+1".

Add positions to input_fn() and a matching input constraint so AutoParallel traces with both inputs.

Authored by Claude.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 11, 2026
@IvanKobzarev
IvanKobzarev requested a review from fmassa May 11, 2026 14:15
AutoParallel's input_fn() only returned tokens, but Decoder.forward()
also receives positions via extra_kwargs. This caused a mismatch
between the number of graph placeholders (from tracing with tokens
only) and the actual runtime args (which include positions), failing
with "expected N arguments for placeholders but received N+1".

Add positions to input_fn() and a matching input constraint so
AutoParallel traces with both inputs.

Authored by Claude.
@IvanKobzarev
IvanKobzarev merged commit 0fadde3 into main May 11, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants