Skip to content

Deepseek4: concat inputs to stay under limit - #26496

Closed
am17an wants to merge 1 commit into
ggml-org:masterfrom
am17an:dsv4-concat-inputs
Closed

Deepseek4: concat inputs to stay under limit#26496
am17an wants to merge 1 commit into
ggml-org:masterfrom
am17an:dsv4-concat-inputs

Conversation

@am17an

@am17an am17an commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Overview

Currently the number of inputs to the graph are more than GGML_SCHED_MAX_INPUTS, concat the inputs so that they stay under limit.

Additional information

Requirements

@am17an
am17an requested a review from CISC as a code owner August 3, 2026 06:18
Comment thread src/llama-graph.cpp
Comment on lines +935 to +940
inp.state_idxs = dsv4_build_input_1d(ctx, GGML_TYPE_I32, dsv4_comp_n_state_idxs(plan), prefix + "state_idxs");
// Keep state_idxs as a direct node source so the scheduler can rotate input copies.
ggml_tensor * state_idxs = inp.state_idxs ? ggml_dup(ctx, inp.state_idxs) : nullptr;
if (state_idxs) {
ggml_set_name(state_idxs, (prefix + "state_idxs_cpy").c_str());
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand the idea of this ggml_dup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is for pipeline paralleism to not override the views as they are not set with the INPUT flag

@ggerganov

Copy link
Copy Markdown
Member

Let's go with #22789 for now.

I want to take a deeper look in the pipeline parallel problem that you mentioned, but atm I can't repro. It could be something that needs a fix in the scheduler and the ggml_dup is masking it.

@am17an

am17an commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Yeah I think it boils down the views don't have the flag set. So taking a view from an input might lead to a race using pipeline parallel.

@am17an

am17an commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Fixed by #22789

@am17an am17an closed this Aug 3, 2026
@am17an
am17an deleted the dsv4-concat-inputs branch August 3, 2026 17:13
@ggerganov ggerganov mentioned this pull request Aug 4, 2026
13 tasks
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