GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: avoid IndexError in BF16_Optimizer.destroy() when using DummyOptim by nathon-lee · Pull Request #7763 · deepspeedai/DeepSpeed

Conversation

@nathon-lee

@nathon-lee nathon-lee commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

fix: avoid IndexError in BF16_Optimizer.destroy() when using DummyOptim

Short-circuit BF16_Optimizer.destroy() if using_real_optimizer is False.
When initialized with optimizer=None (DummyOptim), bf16_groups remains empty, causing an IndexError when accessing it in destroy().

Resolves #7752

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nathon-lee
fix: avoid IndexError in BF16_Optimizer.destroy() when using DummyOptim
78c8f78
@nathon-lee
nathon-lee requested review from tjruwase and tohtana as code owners January 6, 2026 03:34
@tohtana

tohtana commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

Hi @leejianwoo-collab, thank you for your contribution!
Can you fix format?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nathon-lee
fix: delete use less blank row.
aa3a639
@nathon-lee

nathon-lee commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

ok @tohtana

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sfc-gh-truwase

sfc-gh-truwase commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

@leejianwoo-collab thanks for the PR. For context, DummyOptim was a temporary hack to enable ZeRO-Inference but it somehow outlived its useful. So the long-term solution is to eliminate DummyOptim. However, your solution is fine for now.

nathon-lee reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sfc-gh-truwase
sfc-gh-truwase approved these changes Jan 6, 2026
View reviewed changes
@nathon-lee
Update bf16_optimizer.py
b566f17
@tohtana
tohtana enabled auto-merge (squash) January 7, 2026 08:11
@tohtana
tohtana merged commit b35d9eb into deepspeedai:master Jan 7, 2026
nathon-lee added a commit to nathon-lee/DeepSpeed_woo that referenced this pull request Jan 7, 2026
@nathon-lee
fix: avoid IndexError in BF16_Optimizer.destroy() when using DummyOpt…
c8196be
…im (deepspeedai#7763)

fix: avoid IndexError in BF16_Optimizer.destroy() when using DummyOptim

Short-circuit BF16_Optimizer.destroy() if using_real_optimizer is False.
When initialized with optimizer=None (DummyOptim), bf16_groups remains
empty, causing an IndexError when accessing it in destroy().

Resolves deepspeedai#7752

Signed-off-by: leejianwoo-collab <[email protected]>
phalani-paladugu pushed a commit to phalani-paladugu/DeepSpeed that referenced this pull request Jan 29, 2026
@nathon-lee @phalani-paladugu
fix: avoid IndexError in BF16_Optimizer.destroy() when using DummyOpt…
fa5927b
…im (deepspeedai#7763)

fix: avoid IndexError in BF16_Optimizer.destroy() when using DummyOptim

Short-circuit BF16_Optimizer.destroy() if using_real_optimizer is False.
When initialized with optimizer=None (DummyOptim), bf16_groups remains
empty, causing an IndexError when accessing it in destroy().

Resolves deepspeedai#7752

Signed-off-by: Phalani Paladugu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sfc-gh-truwase sfc-gh-truwase sfc-gh-truwase approved these changes
@tjruwase tjruwase Awaiting requested review from tjruwase tjruwase is a code owner
@tohtana tohtana Awaiting requested review from tohtana tohtana is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] IndexError in BF16_Optimizer.destroy() when optimizer=None (DummyOptim)

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@nathon-lee @tohtana @sfc-gh-truwase
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.