Skip to content

model: add missing build_cvec to plamo2#21444

Closed
nisparks wants to merge 1 commit intoggml-org:masterfrom
nisparks:fix/plamo2-cvec
Closed

model: add missing build_cvec to plamo2#21444
nisparks wants to merge 1 commit intoggml-org:masterfrom
nisparks:fix/plamo2-cvec

Conversation

@nisparks
Copy link
Copy Markdown
Contributor

@nisparks nisparks commented Apr 4, 2026

Summary

PLaMo-2 is missing the build_cvec() call in its graph builder, causing --control-vector to be silently ignored.

Root Cause

PR #20653 ("model: add control vector support where missing") touched both plamo2.cpp and plamo3.cpp, but the plamo2 change was incomplete.

Comparing the diffs from #20653:

plamo3.cpp — correct (3 lines added):

        cur = build_cvec(cur, il);
        cb(cur, "l_out", il);

        // input for next layer

plamo2.cpp — incomplete (only the comment was added):

        // input for next layer

The actual build_cvec() and cb() calls were missed.

Fix

Adds the missing two lines, matching the pattern in plamo3.cpp and all other 100+ model implementations:

        cur = build_cvec(cur, il);
        cb(cur, "l_out", il);

Impact

  • Without fix: --control-vector silently does nothing on PLaMo-2
  • With fix: Control vectors are applied per-layer as intended
  • Risk: Zero — build_cvec is a no-op when no control vector is loaded, so normal inference is completely unaffected

PR ggml-org#20653 added control vector support to models that were missing it,
but the plamo2 change was incomplete — it added the comment
('// input for next layer') but missed the actual build_cvec() call.

Compare the ggml-org#20653 diffs for the two sibling models:

  plamo3.cpp: +build_cvec(cur, il)  +cb(cur, "l_out", il)  +// input for next layer
  plamo2.cpp: +// input for next layer   (build_cvec omitted)

Without this call, --control-vector is silently ignored on PLaMo-2.
Normal inference is unaffected since build_cvec is a no-op when no
control vector is loaded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nisparks nisparks requested a review from CISC as a code owner April 4, 2026 19:25
@github-actions github-actions Bot added the model Model specific label Apr 4, 2026
@ggml-gh-bot
Copy link
Copy Markdown

ggml-gh-bot Bot commented Apr 4, 2026

Hi @nisparks, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • Multiple open PRs from a new contributor: We limit new contributors (those without a previously merged PR) to 1 open PR at a time. You currently have 2 open PRs.

  • AI-generated content: This project does not accept PRs, descriptions or commit messages that are fully or predominantly AI-generated. If you have used AI to assist you in writing code, please make sure to disclose that explicitly.


Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@CISC
Copy link
Copy Markdown
Member

CISC commented Apr 4, 2026

Not missed, but rather purposefully left out, see #20653 (review)

Also, please read and conform to our contribution guidelines in the future.

@CISC CISC closed this Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model Model specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants