forked from ggml-org/llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 5
Hunyuan tokenizer #26
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
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5e78e88
almost working
kooshi d219580
skip embed, fix bos
kooshi 616f4c7
Merge remote-tracking branch 'other/xsn/hunyuan-moe' into hunyuan
kooshi 0fd3930
cleanup
kooshi b19ecae
yarn scaling
kooshi 245db15
cleanup
kooshi 8fd547b
failed token fix
kooshi 34cc679
Merge remote-tracking branch 'other/xsn/hunyuan-moe' into hunyuan
kooshi b20bd26
tokenization working
kooshi 99d9e94
Merge remote-tracking branch 'other/xsn/hunyuan-moe' into hunyuan
kooshi 1221d94
cleanup and pr changes
kooshi 5471f5a
vocab_size sanity check
kooshi 46c8b70
ntk alpha generic
kooshi 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -705,13 +705,6 @@ ggml_tensor * llm_graph_context::build_moe_ffn( | |
ggml_reshape_3d(ctx0, probs, 1, n_expert, n_tokens), selected_experts); // [1, n_expert_used, n_tokens] | ||
cb(weights, "ffn_moe_weights", il); | ||
|
||
if (arch == LLM_ARCH_HUNYUAN_MOE) { | ||
weights = ggml_reshape_2d(ctx0, weights, n_expert_used, n_tokens); // [n_expert_used, n_tokens] | ||
weights = ggml_div(ctx0, weights, ggml_sum_rows(ctx0, weights)); // [1, n_tokens] | ||
weights = ggml_reshape_3d(ctx0, weights, 1, n_expert_used, n_tokens); // [1, n_expert_used, n_tokens] | ||
cb(weights, "ffn_moe_weights_scaled", il); | ||
} | ||
|
||
Comment on lines
-708
to
-714
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha good catch, I didn't notice that I reinvented the |
||
if (norm_w) { | ||
weights = ggml_reshape_2d(ctx0, weights, n_expert_used, n_tokens); | ||
|
||
|
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
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.
We can overwrite this in
hparams["bos_token_id"]
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.
I'm not sure if setting it in hparams would override the id that
gguf.SpecialVocab
reads from the config. I've left this as is for now, but that can be tested later