-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Add support for SmallThinker model series #14898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+443
−6
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
efe27eb
support smallthinker
wdl339 a6d6eaf
support 20b softmax, 4b no sliding window
wdl339 a5274b7
Merge branch 'master' into smallthinker
wdl339 8e2cb21
new build_moe_ffn_from_probs, and can run 4b
wdl339 e28d2c5
fix 4b rope bug
wdl339 ebd78cc
Merge branch 'master' into smallthinker
wdl339 8c6af02
fix python type check
wdl339 92b518b
remove is_moe judge
wdl339 4186bab
remove set_dense_start_swa_pattern function and modify set_swa_patter…
wdl339 f1d4698
trim trailing whitespace
wdl339 f10cd46
remove get_vocab_base of SmallThinkerModel in convert_hf_to_gguf.py
wdl339 4af8b59
better whitespace
wdl339 e2c900c
use GGML_ASSERT for expert count validation
wdl339 594af99
Improve null pointer check for probs
wdl339 29e1fe0
use template parameter for SWA attention logic
wdl339 5d09d11
better whitespace
wdl339 bb3dd58
move the creation of inp_out_ids before the layer loop
wdl339 e338c30
remove redundant judge for probs
wdl339 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code duplication is unfortunate, is it possible to merge this into
build_moe_ffn
withprobs
as a toggle without making too much of a mess?Can be a follow-up.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great point. I've been thinking about the best way to merge these and have a couple of ideas on how we could approach it.
build_moe_ffn
to accept an optionalprobs
parameter. The main difficulty here is that the logic for weight normalization and activation functions diverges significantly between the two paths, so it would require some careful internal branching to keep it clean.build_moe_ffn
would then have a check at the beginning to decide whether to call this new router function. My main concern with this approach is thatbuild_moe_ffn
is a core function, and I'm a bit worried about affecting other models, so this would need careful testing.Both approaches seem feasible. Given the complexity and your suggestion that this can be a follow-up, would you prefer I handle this in a separate PR, or should I proceed with one of these solutions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate PR is probably best.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll open a follow-up issue later to track this so we don't forget. Thanks!
Edit: I've created issue #14920 to track this.