feat(refit): view-ops slice planning for reshard - #672
Draft
tanushriya910 wants to merge 1 commit into
Draft
Conversation
Record view ops during geometry capture and plan strided reads in slice_plan, so a receiver can reconstruct converted/sharded sources. Adds geometry + slice_plan tests. Signed-off-by: Tanushriya Singh <tanushriyas@nvidia.com>
tanushriya910
force-pushed
the
tanushriyas/view-ops-pr2
branch
from
August 22, 2026 02:43
6019a59 to
51647f8
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.
What
Extend reshard geometry capture and the slice planner to support rank-reducing view ops, so a trainer that publishes a stacked source (e.g. MoE experts stacked into one tensor) can be resharded into its per-slice destination weights.
Changes
selectandsplitto_SUPPORTED_OPS.select(rank-reducing) andsplit(multi-return view, likechunk) are how a stacked source is unstacked into per-expert / per-slice tensors. Without them, every such weight was classified unsupported and the receiver failed closed._view_to_box_permnow derives the source box for rank-reducing views (select/unbind drop a dim): a dropped source dim is not iterated by any view dim, so it contributes a single fixed index ([idx, idx+1]) decoded from the offset. Rank increase (unsqueeze) and dim-merging reshapes still raiseUnsupportedReshard.test_reshard_refit_geometry.py,test_reshard_refit_slice_plan.py.Why
Stacked-expert MoE layouts (and similar stacked sources) need select/split to map each slice onto its own destination box — closing that gap in view-op coverage.
Stacked on the receiver-mapping PR (base
tanushriyas/reshard-native-convert); retarget tomainonce that merges.