Skip to content

Fix scalar parameter byte-view broadcasts - #8642

Merged
pengdurice merged 1 commit into
deepspeedai:masterfrom
adenzhou1350:codex/fix-scalar-byte-broadcast
Oct 27, 2026
Merged

pengdurice merged 1 commit into
deepspeedai:masterfrom
adenzhou1350:codex/fix-scalar-byte-broadcast

Conversation

@adenzhou1350

Copy link
Copy Markdown
Contributor

Fixes #8639.

PyTorch rejects reinterpreting a zero-dimensional tensor as uint8 when the element sizes differ. DeepSpeed uses that byte view in model and ZeRO parameter broadcasts, so a scalar parameter fails during initialization. Unsqueezing only scalar tensors creates a one-dimensional view of the same storage before the byte reinterpretation; non-scalar tensors keep the existing path.

Tested with a two-rank CPU/Gloo regression on Python 3.12 and PyTorch 2.12.1: ZeRO stages 0 and 3 both pass with this change. The same stage-0 test fails on the unmodified base with the reported self.dim() cannot be 0 error. Repository formatting/static hooks, py_compile, and git diff --check pass. A newer Linux flake8 reports three warnings already present on the base; excluding only those unchanged warnings leaves no lint findings in the changed files. GPU distributed execution was not tested.

Prepared with AI assistance; I reviewed the diff and ran the tests above.

@jinyouzhi jinyouzhi 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

@adenzhou1350

adenzhou1350 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Current status (October 26): head db710ae3b402821a7ef96890161da47f393497f0 has 12 successful checks and 3 skipped checks, and pengdurice approved this exact head on October 22. The maintainer update explains that CI instability is blocking several PRs; the team is repairing it and will merge this PR once that issue is fixed. The next step is shared CI repair followed by maintainer merge.

October 6 CI handoff (historical)

A consolidated CI handoff for my other pending fixes: #8728, #8726, #8715, #8709, #8619, #8512, #8511 and #8510 still have workflows awaiting maintainer approval and required checks Expected. Please approve the appropriate standard CI runs after reviewing their individual diffs. Thanks also to @ebarkhordar for the detailed CPU/PyTorch parity check on #8619; the CUDA-toolkit validation boundary remains as stated in that review.

@pengdurice
pengdurice added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@kaixuanliu

Copy link
Copy Markdown
Contributor

Hi, @pengdurice could you help accelerate the merge process? we have a lot of cases pending on this PR. Thx! CC @delock

@delock
delock self-requested a review October 26, 2026 02:29
@delock
delock added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 26, 2026
@pengdurice

Copy link
Copy Markdown
Contributor

Hi, @pengdurice could you help accelerate the merge process? we have a lot of cases pending on this PR. Thx! CC @delock

The CI tests are having some flakiness issues blocking several PRs's merge. Team is working on fixing the issue and will merge this PR when the CI issue is fixed. Thank you for your patience!

@pengdurice
pengdurice added this pull request to the merge queue Oct 26, 2026
Merged via the queue into deepspeedai:master with commit bf222a2 Oct 27, 2026
17 of 19 checks passed
@gpu-test-labeler gpu-test-labeler Bot added the skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Byte-view parameter broadcasts fail for zero-dimensional parameters

4 participants