Fix group name lookup crash for flattened mesh collectives in debug_helpers#364
Open
Fix group name lookup crash for flattened mesh collectives in debug_helpers#364
Conversation
…elpers make_custom_runtime_estimation assumed every collective's process group corresponds to a single mesh dimension, using groups_name.index(group_name) to resolve it. This crashes with ValueError when a collective uses the flattened mesh group created by mesh._flatten() in _apply_placement_common, since that group isn't in mesh.get_all_groups(). The fix resolves the group name against per-dimension groups first, then falls back to mesh._flatten() (which is cached/idempotent) with mesh_dim=0. All downstream shape and topology references use cost_mesh so the cost estimation is correct for both per-dimension and flattened collectives. Authored with Claude.
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.
make_custom_runtime_estimationassumed every collective's process group corresponds to a single mesh dimension, usinggroups_name.index(group_name)to resolve it. This crashes withValueErrorwhen a collective uses the flattened mesh group created bymesh._flatten()in_apply_placement_common, since that group isn't inmesh.get_all_groups().The fix resolves the group name against per-dimension groups first, then falls back to
mesh._flatten()(which is cached/idempotent) withmesh_dim=0. All downstream shape and topology references use cost_mesh so the cost estimation is correct for both per-dimension and flattened collectives.Authored with Claude.