Skip to content

Conversation

@muellerzr
Copy link
Contributor

What does this PR do?

This PR centralizes all arguments for the Accelerator not covered by fsdp_config and deepspeed_config into a singular dataclass that users can pass in as a json file or through raw CLI param args.

I think I have the CLI args configured right? But I'm not 100% sure. Advice on how to check that would be appreciated!

Fixes # (issue)

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.

@amyeroberts @LysandreJik

@muellerzr
Copy link
Contributor Author

@amyeroberts tests finally pass after losing my mind on imports 🙌

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! I can see that it's really going to help understand the arguments and handle them in the code.

@muellerzr muellerzr requested a review from amyeroberts January 25, 2024 08:44
Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for iterating - looking good!

Just a few final comments

@vanbasten23
Copy link

Hi @muellerzr , could you please get this PR merged? We need the PR to get the accelerate test on TPU v3 to succeed again. Thanks.

@muellerzr muellerzr force-pushed the muellerzr-accelerator-dataclass branch from 2c60474 to c99d51c Compare February 13, 2024 19:32
@muellerzr
Copy link
Contributor Author

muellerzr commented Feb 13, 2024

As a general note, immediately after the next accelerate release I'll make a follow-up PR utilizing the config class seen here so users won't have annoying FutureWarning's huggingface/accelerate#2441 (No big logic difference, just shove it all into the config rather than the Accelerator based on the accelerate version)

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for iterating!

@amyeroberts
Copy link
Contributor

For the doc tests, there was a recent commit merged to main, which should hopefully resolve this.

@muellerzr muellerzr force-pushed the muellerzr-accelerator-dataclass branch from 8c9535a to 1de6ff5 Compare February 14, 2024 14:06
@HuggingFaceDocBuilderDev

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.

@muellerzr muellerzr merged commit 0507e69 into main Feb 14, 2024
@muellerzr muellerzr deleted the muellerzr-accelerator-dataclass branch February 14, 2024 15:18
Copy link

@devCaiquedePaula devCaiquedePaula left a comment

Choose a reason for hiding this comment

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

The docstring for the AcceleratorConfig class is clear and provides a brief description of its purpose. Consider adding information about each attribute's meaning and potential values to make it more informative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants