Skip to content

[PP] Fix split_args_kwargs_into_chunks issues - #165306

Closed
fegin wants to merge 1 commit into
gh/fegin/328/basefrom
gh/fegin/328/head
Closed

fegin wants to merge 1 commit into
gh/fegin/328/basefrom
gh/fegin/328/head

Conversation

@fegin

@fegin fegin commented Oct 13, 2025 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

  1. [PP] Let PP split BlockMask into micro-BlockMask #164111 adds the support of splitting BlockMask. But BlockMask actually has B=1 case that the BlockMask will be broadcast. This PR adds the support of B=1 case.

  2. The original split_args_kwargs_into_chunks doesn't initialize the default specs correctly. Since we now use tree_flatten and tree_unflatten to do split, we should also use tree_map to initialize the default spec. This will actually support the case when the values are not torch.Tensor, which were only supported if users explicitly provide the shard spec.

cc @H-Huang @awgu @wanchaol @fduwjj @wz337 @wconstab @d4l3k @pragupta @msaroufim @dcci

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 13, 2025 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/165306

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (1 Unrelated Failure)

As of commit efdeeec with merge base 8461b63 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

fegin added a commit that referenced this pull request Oct 13, 2025
1. #164111 add support of
   splitting BlockMask. But BlockMask actually has B=1 case where the
   BlockMask will be broadcast. This PR adds the support of B=1 case.

2. The original ssplit_args_kwargs_into_chunks doesn't initialize the
   default specs correctly. Since we now use tree_flatten and
   tree_unflatten, we should also use tree_map to initialize the default
   spec. This will actually support the case where the values are not
   torch.Tensor, which are never supported before.


ghstack-source-id: 807a84e
Pull-Request: #165306
@pytorch-bot pytorch-bot Bot added the oncall: distributed Add this issue/PR to distributed oncall triage queue label Oct 13, 2025
@fegin
fegin requested a review from H-Huang October 13, 2025 08:36
@fegin fegin added module: pipelining Pipeline Parallelism pipeline parallelism Issues related to https://pytorch.org/docs/master/pipeline.html labels Oct 13, 2025
@H-Huang H-Huang added the release notes: distributed (pipeline) release notes category label Oct 13, 2025

@H-Huang H-Huang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@H-Huang

H-Huang commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 13, 2025
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Oct 21, 2025
1. pytorch#164111 adds the support of splitting BlockMask. But BlockMask actually has B=1 case that the BlockMask will be broadcast. This PR adds the support of B=1 case.

2. The original split_args_kwargs_into_chunks doesn't initialize the default specs correctly. Since we now use tree_flatten and tree_unflatten to do split, we should also use tree_map to initialize the default spec. This will actually support the case when the values are not torch.Tensor, which were only supported if users explicitly provide the shard spec.

Pull Request resolved: pytorch#165306
Approved by: https://github.com/H-Huang
@github-actions
github-actions Bot deleted the gh/fegin/328/head branch November 13, 2025 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: pipelining Pipeline Parallelism oncall: distributed Add this issue/PR to distributed oncall triage queue pipeline parallelism Issues related to https://pytorch.org/docs/master/pipeline.html release notes: distributed (pipeline) release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants