Skip to content
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

Adds convert_dense_to_moe_parameters . #584

Merged
merged 10 commits into from
Jul 21, 2024
Merged

Conversation

ruomingp
Copy link
Contributor

@ruomingp ruomingp commented Jul 14, 2024

... to support upcycling of dense to MoE models.

@ruomingp ruomingp force-pushed the rpang_moe branch 2 times, most recently from 4da0333 to 337e90e Compare July 16, 2024 14:26
@ruomingp ruomingp marked this pull request as ready for review July 19, 2024 15:06
@ruomingp ruomingp requested a review from markblee as a code owner July 19, 2024 15:06
@ruomingp ruomingp requested review from xianzhidu and dunan July 19, 2024 15:06
@ruomingp ruomingp changed the title Adds convert_dense_to_sparse_parameters. Adds convert_dense_to_moe_parameters . Jul 19, 2024
@ruomingp ruomingp enabled auto-merge July 19, 2024 15:08
Copy link
Contributor

@xianzhidu xianzhidu left a comment

Choose a reason for hiding this comment

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

Thanks, Ruoming!

@ruomingp ruomingp disabled auto-merge July 20, 2024 11:19
@ruomingp ruomingp enabled auto-merge July 20, 2024 11:19
@ruomingp ruomingp disabled auto-merge July 21, 2024 01:11
@ruomingp ruomingp merged commit 23e587f into apple:main Jul 21, 2024
4 checks passed
@ruomingp ruomingp deleted the rpang_moe branch July 21, 2024 01:11
qdavid1 pushed a commit to qdavid1/axlearn that referenced this pull request Dec 11, 2024
* Adds `convert_dense_to_sparse_parameters`.

* Adds `convert_dense_to_moe_parameters`.

* Removes `target_layer` from the args of `convert_dense_to_moe_parameters`.

* Makes `convert_dense_to_moe_parameters` use pjit to get the right target sharding.

* Adds comments to `convert_dense_to_moe_parameters`.

* Simplifies the conversion logic.

* Use `einsum` instead of `tile` to replicate the dense weights to MoE ones.

* Adds testing that the dense weights are replicated to each expert.

* Adds explicit sharding constraint on the dispatch tensor.

* Addresses Xianzhi's review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants