Skip to content

Fix ZeRO-3 autocast gather with mixed parameter dtypes#8113

Open
tohtana wants to merge 2 commits into
deepspeedai:masterfrom
tohtana:tohtana/fix/zero3-autocast-comm-dtype-assert
Open

Fix ZeRO-3 autocast gather with mixed parameter dtypes#8113
tohtana wants to merge 2 commits into
deepspeedai:masterfrom
tohtana:tohtana/fix/zero3-autocast-comm-dtype-assert

Conversation

@tohtana

@tohtana tohtana commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

This PR allows ZeRO-3 coalesced all-gather buckets to contain parameters with different original dtypes when they share the same autocast communication dtype.

Motivation: PEFT-style LoRA adapters can remain FP32 trainable parameters while the base model parameters are BF16. When DeepSpeed autocast marks both sets of parameters for BF16 communication, the existing assertion still checks their original parameter dtypes and fails on the BF16/FP32 mismatch. With this PR, LoRA-style FP32 adapter parameters can participate in BF16 autocast communication without requiring applications to pre-cast the adapters to BF16.

tohtana added 2 commits July 1, 2026 11:53
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
Signed-off-by: Masahiro Tanaka <mtanaka@anyscale.com>
@tohtana tohtana requested review from loadams and tjruwase as code owners July 2, 2026 03:28
@tohtana tohtana requested review from PKUWZP and delock July 2, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant