-
Notifications
You must be signed in to change notification settings - Fork 248
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
AnyMoE: Build an MoE model from anything, quickly #476
Merged
Conversation
This file contains 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
Code Metrics Report=============================================================================== Language Files Lines Code Comments Blanks =============================================================================== Dockerfile 1 34 25 0 9 Happy 1 442 369 0 73 JSON 9 21 21 0 0 Python 33 1274 1089 37 148 TOML 16 445 403 2 40 ------------------------------------------------------------------------------- Jupyter Notebooks 1 0 0 0 0 |- Markdown 1 60 30 22 8 |- Python 1 96 87 1 8 (Total) 156 117 23 16 ------------------------------------------------------------------------------- Markdown 19 1373 0 1028 345 |- BASH 5 101 98 0 3 |- Python 5 98 88 0 10 |- Rust 3 151 135 6 10 (Total) 1723 321 1034 368 ------------------------------------------------------------------------------- Rust 122 38838 35152 695 2991 |- Markdown 70 682 13 631 38 (Total) 39520 35165 1326 3029 =============================================================================== Total 203 42427 37059 1762 3606 =============================================================================== |
cargo run --release --features cuda -- -i toml -f toml-selectors/anymoe.toml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements AnyMoE, a method to build a flexible MoE model from any combination of fine-tuned expert models. Please see the paper for reference, although currently there are a few implementation-level differences.
The technique implemented here is similar to the gating method found in models such as Cephalo Vision 3x8b beta or Mixtral: it uses a gating layer to select experts in the MLP layer. This PR implements a built-in pretraining strategy with the option to save the resulting gating layer weights, powered by Candle's autograd infrastructure.
By allowing users to create an MoE model quickly by using the expert weights and a small pretraining dataset, AnyMoE lowers the barrier to entry for users who want to create and deploy tailored MoE models for their application.
Status