Skip to content

Add check for if num_items_in_batch is not None - #35102

Merged
muellerzr merged 1 commit into
mainfrom
muellerzr-num-items-in-batch
Jan 6, 2025
Merged

Add check for if num_items_in_batch is not None#35102
muellerzr merged 1 commit into
mainfrom
muellerzr-num-items-in-batch

Conversation

@muellerzr

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a check before calling .gather() to make sure that num_items_in_batch actually has a value

Fixes #35076

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.

@Rocketknight1 @SunMarc

@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 the PR ! LGTM !

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

@Rocketknight1 Rocketknight1 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.

I give this my Small Enough To Not Require A Real Core Maintainer stamp of approval 🕹️

@ving666

ving666 commented Jan 2, 2025

Copy link
Copy Markdown

@Rocketknight1 @SunMarc We encountered the same issue. When will this MR be merged? Thank you!

@SunMarc

SunMarc commented Jan 2, 2025

Copy link
Copy Markdown
Member

I'll let @muellerzr decide either to merge this one or this PR : #35399

@muellerzr
muellerzr merged commit a821b9c into main Jan 6, 2025
@muellerzr
muellerzr deleted the muellerzr-num-items-in-batch branch January 6, 2025 15:11
@muellerzr

Copy link
Copy Markdown
Contributor Author

Thanks! This one got swept under (not good)

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 of self.accelerator.gather(num_items_in_batch) with enabling average_tokens_across_devices

5 participants