-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accelerate runner helper method #2746
Accelerate runner helper method #2746
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
LLM Finetuning template updates in |
…ithub.com/zenml-io/zenml into feature/OSSK-535-accelerate-helper-method
@strickvl , I can see that the docs for the |
Could you maybe make changes directly on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one tiny comment otherwise looks good to me. Is there any testing we can add for the function utils? Also wondering if we should have an e2e test script which runs a simple (CPU-backed) pipeline in CI but using run_with_accelerate
? I'm a bit worried by how quickly HF things can break, esp with something like accelerate
so I'd like to get advance failure notice of API changes that way if possible.
LLM Finetuning template updates in |
Quickstart template updates in |
E2E template updates in |
NLP template updates in |
Co-authored-by: Alex Strick van Linschoten <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests. This LGTM now, providing you get the tests passing (there's a security one failing atm e.g.)
…ithub.com/zenml-io/zenml into feature/OSSK-535-accelerate-helper-method
…SSK-535-accelerate-helper-method
…ithub.com/zenml-io/zenml into feature/OSSK-535-accelerate-helper-method
@bcdurak, as discussed this one is ready to be merged, but can give more work to the pydantic merge. LMK, when can I merge it? |
Describe changes
Key changes
zenml.integrations.huggingface.steps.run_with_accelerate
to be able to run any step using Accelerate (obviously, the step should be written in a way that it makes sense to run it with Accelerate). This function is supported by a utility, which wraps any function into a Click CLI script (which is needed by most of the Distributed train tools). CLI is quite limited, so it accepts only(str, int, float, bool, Path, tuple)
as params. This can be maybe extended in the future.How it works?
Running the same step without accelerating would be:
cleanup_gpu_memory
to clean up GPU memory at the step start. It has a side effect on the environment, so there is a mustforce
param to be passed to protect that.Companion PR: zenml-io/zenml-projects#102
Sample run:
runs/5080958e-31f5-46b0-8e0b-fbf7086f1ff4
in DemoPre-requisites
Please ensure you have done the following:
develop
and the open PR is targetingdevelop
. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes