Skip to content

[DeepSpeed] sync gradient accum steps from deepspeed plugin#3632

Merged
SunMarc merged 4 commits into
huggingface:mainfrom
kashif:fix-ci
Jun 18, 2025
Merged

[DeepSpeed] sync gradient accum steps from deepspeed plugin#3632
SunMarc merged 4 commits into
huggingface:mainfrom
kashif:fix-ci

Conversation

@kashif

@kashif kashif commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Syncs the gradient_accumulation_steps from the deepspeed plugin to the GradientAccumulationPlugin

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@kashif kashif requested review from SunMarc and Copilot June 18, 2025 07:09

This comment was marked as outdated.

@kashif kashif requested a review from Copilot June 18, 2025 07:18

Copilot AI 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.

Pull Request Overview

This PR synchronizes the gradient accumulation steps from the DeepSpeed plugin with the GradientAccumulationPlugin configuration.

  • Updates the accelerator initialization to override gradient_accumulation_steps when using DeepSpeed.
  • Adds a debug logging message to indicate when the overriding occurs.

Comment thread src/accelerate/accelerator.py Outdated
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@SunMarc SunMarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for fixing ! just a nit

Comment thread src/accelerate/accelerator.py

@SunMarc SunMarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot !

Comment thread src/accelerate/accelerator.py Outdated
@SunMarc SunMarc merged commit 7f9c8cb into huggingface:main Jun 18, 2025
23 of 25 checks passed
@kashif kashif deleted the fix-ci branch June 18, 2025 15:44
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.

4 participants