Skip to content

models: clean up some dead switch branches in old models - #28669

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
iggy:chore/clean-up-dead-branches
Sep 10, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
iggy:chore/clean-up-dead-branches

Conversation

@iggy

@iggy iggy commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Overview

Some of these if statements were copypastaed in a former refactor and never cleaned up to remove the cases that could never happen anymore. The only thing that's shared between these relatives anymore is llama_model_bert::graph::graph, so the rest of the code doesn't need the conditionals.

Additional information

I was looking into something unrelated and stumbled on this bit of dead code

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES — the issue was found and code change was implemented with AI assistance and manually reviewed and tested by me (full ./ci/run.sh passed)

@iggy
iggy requested a review from CISC as a code owner September 9, 2026 20:09
@github-actions github-actions Bot added the model Model specific label Sep 9, 2026
@ggml-gh-bot

This comment was marked as resolved.

@iggy

iggy commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

I did write the commit message and PR description myself. The only thing I copied from my robit was the llama_model_bert::graph::graph bit.

@CISC CISC left a comment

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.

You can also remove the moe_every_n_layers ffn block for all but nomic-bert-moe.

Comment thread src/models/nomic-bert-moe.cpp Outdated
Comment thread src/models/nomic-bert.cpp Outdated
Some of these if statements were copypastaed in a former refactor and
never cleaned up to remove the cases that could never happen anymore. The
only thing that's shared between these relatives anymore is
llama_model_bert::graph::graph, so the rest of the code doesn't need the
conditionals.
@iggy
iggy force-pushed the chore/clean-up-dead-branches branch from d8f1ecf to f32d50d Compare September 10, 2026 10:38
@iggy

iggy commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Fixed review feedback. Reran ci/run.sh ( ✔️ ). Also ran some standalone tests against the models this touches.

  ┌──────────────────────────┬────────────────┬────────────┬───────────┬────────────┐
  │          model           │      arch      │ embeddings │ load log  │ type label │
  ├──────────────────────────┼────────────────┼────────────┼───────────┼────────────┤
  │ bge-small-en-v1.5        │ bert           │ identical  │ -         │ -          │
  ├──────────────────────────┼────────────────┼────────────┼───────────┼────────────┤
  │ jina-reranker-v1-tiny-en │ jina-bert-v2   │ identical  │ -         │ -          │
  ├──────────────────────────┼────────────────┼────────────┼───────────┼────────────┤
  │ nomic-embed-text-v1.5    │ nomic-bert     │ identical  │ identical │ 137M       │
  ├──────────────────────────┼────────────────┼────────────┼───────────┼────────────┤
  │ nomic-embed-text-v2-moe  │ nomic-bert-moe │ identical  │ identical │ 475M       │
  ├──────────────────────────┼────────────────┼────────────┼───────────┼────────────┤
  │ jina-embeddings-v3       │ jina-bert-v3   │ identical  │ identical │ 558M       │
  └──────────────────────────┴────────────────┴────────────┴───────────┴────────────┘

@CISC CISC added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Sep 10, 2026
@ggerganov
ggerganov merged commit d344123 into ggml-org:master Sep 10, 2026
23 of 27 checks passed
pl752 pushed a commit to pl752/llama.cpp that referenced this pull request Sep 15, 2026
)

Some of these if statements were copypastaed in a former refactor and
never cleaned up to remove the cases that could never happen anymore. The
only thing that's shared between these relatives anymore is
llama_model_bert::graph::graph, so the rest of the code doesn't need the
conditionals.
zsogitbe pushed a commit to zsogitbe/llama.cpp that referenced this pull request Sep 17, 2026
)

Some of these if statements were copypastaed in a former refactor and
never cleaned up to remove the cases that could never happen anymore. The
only thing that's shared between these relatives anymore is
llama_model_bert::graph::graph, so the rest of the code doesn't need the
conditionals.
Te-eMster pushed a commit to Te-eMster/mx-llama.cpp that referenced this pull request Sep 18, 2026
)

Some of these if statements were copypastaed in a former refactor and
never cleaned up to remove the cases that could never happen anymore. The
only thing that's shared between these relatives anymore is
llama_model_bert::graph::graph, so the rest of the code doesn't need the
conditionals.
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
)

Some of these if statements were copypastaed in a former refactor and
never cleaned up to remove the cases that could never happen anymore. The
only thing that's shared between these relatives anymore is
llama_model_bert::graph::graph, so the rest of the code doesn't need the
conditionals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. model Model specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants