fix: AutoTP partition_config uses full hierarchical module path#8088
Open
delock wants to merge 1 commit into
Open
fix: AutoTP partition_config uses full hierarchical module path#8088delock wants to merge 1 commit into
delock wants to merge 1 commit into
Conversation
Signed-off-by: Guokai Ma <guokai.ma@intel.com>
6daac90 to
9ae92f9
Compare
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.
Problem
When using custom patterns with AutoTP, built from the immediate parent only instead of the accumulated hierarchical path.
This meant patterns like never matched because the name passed was just (missing prefix).
Impact: Custom patterns are silently ignored — parameters are not TP-sharded, causing OOM on multi-GPU setups with large models.
Fix
Two changes in :
Line 574: Build
full_namefromclass_name(accumulated hierarchical path) instead ofprev_name(immediate parent only). This ensures patterns see the complete module path.Line 591: Pass
nameinstead offull_nameto the recursive_replace_modulecall, preventing path duplication at deeper nesting levels. Without this,class_namewould accumulate the full prefix twice (e.g.,model.layers.0.model.layers.0.self_attn).Note
This bug only affects the
partition_configcode path (custom patterns). The defaultlinear_policiesand HuggingFacetp_planpaths are unaffected.