Skip to content

Fix zero reduce bucket size validation - #8266

Open
fwerkor wants to merge 3 commits into
deepspeedai:masterfrom
fwerkor:fix-reduce-bucket-size-zero
Open

Fix zero reduce bucket size validation#8266
fwerkor wants to merge 3 commits into
deepspeedai:masterfrom
fwerkor:fix-reduce-bucket-size-zero

Conversation

@fwerkor

@fwerkor fwerkor commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Reject zero_optimization.reduce_bucket_size=0 during configuration validation instead of allowing ZeRO to fail later with a division by zero during backward.

This changes the field constraint from non-negative to strictly positive and adds a boundary regression test covering 1 as valid and 0 as invalid.

Fixes #8260

Testing

  • python -m pytest tests/unit/runtime/zero/test_zero_config.py -q (7 passed)
  • pre-commit run --files deepspeed/runtime/zero/config.py tests/unit/runtime/zero/test_zero_config.py

Signed-off-by: Cao Yuhang <caoyuhang@fwerkor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

fwerkor commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi @tohtana, gentle ping — would appreciate a review when you have a chance. Thanks!

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.

[BUG] reduce_bucket_size=0 passes validation but crashes ZeRO backward with ZeroDivisionError

2 participants