Skip to content

Models: Add control vector functions to models that missed it (initially meant for qwen3.5 and qwen-next models)#20653

Merged
CISC merged 6 commits intoggml-org:masterfrom
GreyWorks:feat-add-qwen3x-cvector-support
Mar 18, 2026
Merged

Models: Add control vector functions to models that missed it (initially meant for qwen3.5 and qwen-next models)#20653
CISC merged 6 commits intoggml-org:masterfrom
GreyWorks:feat-add-qwen3x-cvector-support

Conversation

@GreyWorks
Copy link
Copy Markdown
Contributor

@GreyWorks GreyWorks commented Mar 16, 2026

This PR adds control vector support to Qwen3.5, Qwen3.5-MoE and Qwen3-next (Qwen3-coder-next).
It was missing before but was present for Qwen3-vl and so on.
Control vector PR for reference: #5970

The PR resolves #20541

AI disclaimer: I had Claude point me at the missing parts and help me understand the correct position for the two lines added in each file.
I tested the changes myself and made sure it doesn't break things where I could. The local CI pipeline shows no problem with the new code.

@GreyWorks GreyWorks requested a review from CISC as a code owner March 16, 2026 20:09
Copy link
Copy Markdown
Member

@CISC CISC left a comment

Choose a reason for hiding this comment

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

Thank you, this was accidentally left out!

Would you mind checking the other models as well? I think there are a couple also missing this...

@github-actions github-actions Bot added the model Model specific label Mar 16, 2026
@GreyWorks
Copy link
Copy Markdown
Contributor Author

I cannot test them all but I'll go through them tomorrow and add it to the missing ones.
Should follow the same pattern I suppose.

@GreyWorks
Copy link
Copy Markdown
Contributor Author

I updated the rest of the models.

Chatglm, jais and lfm2 are slightly different than the rest. So it would be great if you could have a look at those in particular. To my understanding it should be correct like that.

Copy link
Copy Markdown
Member

@CISC CISC left a comment

Choose a reason for hiding this comment

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

Thank you, perfect. :)

I'm not sure the embedding models should have it, and I don't think it's correct in plamo2, so best leave them out for now...

Comment thread src/models/bert.cpp Outdated
Comment thread src/models/eurobert.cpp Outdated
Comment thread src/models/jais.cpp Outdated
Comment thread src/models/modern-bert.cpp Outdated
Comment thread src/models/neo-bert.cpp Outdated
Comment thread src/models/plamo2.cpp Outdated
Comment thread src/models/smallthinker.cpp
Comment thread src/models/step35-iswa.cpp
@CISC CISC merged commit 6729d49 into ggml-org:master Mar 18, 2026
47 of 48 checks passed
@GreyWorks GreyWorks changed the title Models: Add control vector functions to qwen3.5 and qwen-next models Models: Add control vector functions to models that missed it (initially meant for qwen3.5 and qwen-next models) Mar 18, 2026
@GreyWorks GreyWorks deleted the feat-add-qwen3x-cvector-support branch March 18, 2026 23:38
Ethan-a2 pushed a commit to Ethan-a2/llama.cpp that referenced this pull request Mar 20, 2026
* Add control vector functions to qwen3.5 and qwen-next models

* Add missing cvec compatibility to the rest of the models

* Adjust comments and formatting

* cleanup

* whitespace

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
nisparks added a commit to nisparks/llama.cpp that referenced this pull request Apr 4, 2026
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>
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* Add control vector functions to qwen3.5 and qwen-next models

* Add missing cvec compatibility to the rest of the models

* Adjust comments and formatting

* cleanup

* whitespace

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
rsenthilkumar6 pushed a commit to rsenthilkumar6/llama.cpp that referenced this pull request May 1, 2026
* Add control vector functions to qwen3.5 and qwen-next models

* Add missing cvec compatibility to the rest of the models

* Adjust comments and formatting

* cleanup

* whitespace

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
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.

Feature Request: Control vector support for Qwen3.5, Qwen3.5-moe and Qwen3-next

2 participants