Improve leaf module interface (enable via config, relax matching criteria, add document, etc.)#7604
Merged
sfc-gh-truwase merged 11 commits intodeepspeedai:masterfrom Oct 3, 2025
Conversation
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
sfc-gh-truwase
approved these changes
Oct 3, 2025
mauryaavinash95
pushed a commit
to DataStates/DeepSpeed
that referenced
this pull request
Oct 4, 2025
…eria, add document, etc.) (deepspeedai#7604) This PR improves the usability of the leaf module feature. Here are the changes: - Allow enabling the leaf module via both the DeepSpeed config and APIs. - Relax matching criteria to support class-based matching. - Support multiple ways of specifying the target module: class, class name (with or without package name), module name, or suffix. - Add documentation to the training guide, including config snippets and explanations of default behavior. - Add default classes (e.g., Mixtral, Qwen2/Qwen3) that automatically enable the leaf module feature. (Welcoming requests to add more classes) --------- Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com> Co-authored-by: Olatunji Ruwase <tunji.ruwase@snowflake.com>
Comment on lines
+135
to
+138
| "leaf_module": { | ||
| "classes": ["my_package.layers.CustomMoEBlock"], | ||
| "names": ["transformer.layers.0.experts"], | ||
| "name_suffixes": ["experts"] |
Contributor
There was a problem hiding this comment.
This part of the doc is somewhat confusing since it may make the reader believe all 3 entries are needed if they jumped here directly not reading the API section.
Too bad json doesn't allow comments. But perhaps the first paragraph could start with - "While the example shows all 3 leaf_module keys, typically you will probably use just one of these" ?
tohtana
added a commit
that referenced
this pull request
Oct 7, 2025
Update document of leaf module config as suggested [here](#7604 (comment)). Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
Liangliang-Ma
pushed a commit
to Liangliang-Ma/DeepSpeed
that referenced
this pull request
Oct 13, 2025
…eria, add document, etc.) (deepspeedai#7604) This PR improves the usability of the leaf module feature. Here are the changes: - Allow enabling the leaf module via both the DeepSpeed config and APIs. - Relax matching criteria to support class-based matching. - Support multiple ways of specifying the target module: class, class name (with or without package name), module name, or suffix. - Add documentation to the training guide, including config snippets and explanations of default behavior. - Add default classes (e.g., Mixtral, Qwen2/Qwen3) that automatically enable the leaf module feature. (Welcoming requests to add more classes) --------- Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com> Co-authored-by: Olatunji Ruwase <tunji.ruwase@snowflake.com> Signed-off-by: Ma, Liangliang <liangliang.ma@intel.com>
Liangliang-Ma
pushed a commit
to Liangliang-Ma/DeepSpeed
that referenced
this pull request
Oct 13, 2025
Update document of leaf module config as suggested [here](deepspeedai#7604 (comment)). Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com> Signed-off-by: Ma, Liangliang <liangliang.ma@intel.com>
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
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 improves the usability of the leaf module feature.
Here are the changes: