-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ScatterMoE LoRA support #3410
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
ScatterMoE LoRA support #3410
Changes from all commits
6dda44a
512934e
9f9116a
a1a5627
8cc7cc6
417688c
b1020e6
a00b11e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,3 +33,16 @@ def check_experts_implementation(cls, data): | |
| data["experts_implementation"] = "eager" | ||
|
|
||
| return data | ||
|
|
||
| @model_validator(mode="before") | ||
| @classmethod | ||
| def disable_mlp_kernel_scattermoe(cls, data): | ||
| if data.get("use_scattermoe") is True: | ||
| if data.get("lora_mlp_kernel") is True: | ||
| LOG.warning( | ||
| "Disabling lora_mlp_kernel when using scattermoe due to compatibility issues." | ||
| ) | ||
| data["lora_mlp_kernel"] = False | ||
| data["mlp_kernel"] = False | ||
|
Comment on lines
+39
to
+46
Contributor
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. Warning says "Disabling lora_mlp_kernel" but the code only disables The warning on line 43 tells the user Proposed fix (if both should be disabled) def disable_mlp_kernel_scattermoe(cls, data):
if data.get("use_scattermoe") is True:
if data.get("lora_mlp_kernel") is True:
LOG.warning(
"Disabling lora_mlp_kernel when using scattermoe due to compatibility issues."
)
+ data["lora_mlp_kernel"] = False
data["mlp_kernel"] = False🤖 Prompt for AI Agents |
||
|
|
||
| return data | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) Axolotl AI | ||
| # Licensed under the Apache License, Version 2.0 | ||
|
|
||
| from . import layers | ||
| from .lora_ops import ParallelExperts | ||
| from .parallel_experts import flatten_sort_count, parallel_linear | ||
| from .parallel_linear_lora import ScatterMoELoRA, parallel_linear_lora | ||
|
|
||
| __all__ = [ | ||
| "layers", | ||
| "ParallelExperts", | ||
| "flatten_sort_count", | ||
| "parallel_linear", | ||
| "ScatterMoELoRA", | ||
| "parallel_linear_lora", | ||
| "lora_ops", | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Original work Copyright (c) Shawn Tan and ScatterMoE Contributors | ||
| # Adapted from https://github.com/shawntan/scattermoe | ||
| # See https://github.com/shawntan/scattermoe/blob/main/LICENSE | ||
| # | ||
| # Modifications and LoRA adaptation Copyright (c) Axolotl AI | ||
| # Licensed under the Apache License, Version 2.0 | ||
|
|
||
| from . import lora_ops, ops | ||
|
|
||
| __all__ = ["ops", "lora_ops"] |
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.
This was added recently to solve some saving issue . Do the changes below solve it?
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.
Just did a quick pass on this,
.clone()may be unintentionally placing tensors on GPU.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.
What do you mean? This was a cleanup from changes upstream.
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.
This was just added by ved a week ago to fix saving in context parallelism 97a4f28