-
Notifications
You must be signed in to change notification settings - Fork 700
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
Add Fine-Tune BERT LLM Example #2021
Add Fine-Tune BERT LLM Example #2021
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Signed-off-by: Andrey Velichkevich <[email protected]>
9c14096
to
1a48a0c
Compare
Pull Request Test Coverage Report for Build 8237084497Details
💛 - Coveralls |
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.
Is it fine to use space blank in filename?
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.
For Notebook files it should be normal, but if we want, we can name files without space blanks.
Happy to see it, thank @andreyvelich for driving this. Maybe we can make a roadmap for the examples and I'd like to contribute too. One thing from my personal perspective is that if we dedicate to the notebook format or we can support pure python code with markdown or something like that? |
+1 |
@@ -0,0 +1,683 @@ | |||
{ |
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.
Line #8. num_workers=3, # Number of PyTorch workers to use.
Should we replace this with 1
aligned with the above comment:
At least 1 GPU on your Kubernetes cluster to fine-tune BERT model on 1 worker.
Or, should we update the above comment?
Reply via ReviewNB
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.
Sure, let me change it to 3.
@@ -0,0 +1,683 @@ | |||
{ |
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.
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.
Nice catch, however LLM can easily recognize sentences without full stop 😃
Also, I believe this sentence is grammatically correct, isn't ?
This is one of the best restaurants I've ever been to
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.
It makes sense.
Also, Grammarly says this is fine as well :)
That's good idea, do you want to start issue to identify examples that we want to add (e.g. text-generation, speech recognition, and more)?
I think, we have pros and cons of using Notebook files vs Python files. For example, it's easier to implement E2Es test for Python files, but Notebooks are usually more Data Scientists friendly. I an open to your suggestions @tenzen-y @kuizhiqing @johnugeorge. |
Signed-off-by: Andrey Velichkevich <[email protected]>
Anyway, I think that we should have a dedicated issue. |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreyvelich, tenzen-y The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @kuizhiqing @johnugeorge @deepanker13 For the final review |
/lgtm |
We will add a similar one using Train API |
* Add Fine-Tune BERT LLM Example Signed-off-by: Andrey Velichkevich <[email protected]> * Add 3 GPUs in Notebook requirements Signed-off-by: Andrey Velichkevich <[email protected]> --------- Signed-off-by: Andrey Velichkevich <[email protected]>
* Add Fine-Tune BERT LLM Example Signed-off-by: Andrey Velichkevich <[email protected]> * Add 3 GPUs in Notebook requirements Signed-off-by: Andrey Velichkevich <[email protected]> --------- Signed-off-by: Andrey Velichkevich <[email protected]> Signed-off-by: deepanker13 <[email protected]>
* Add Fine-Tune BERT LLM Example Signed-off-by: Andrey Velichkevich <[email protected]> * Add 3 GPUs in Notebook requirements Signed-off-by: Andrey Velichkevich <[email protected]> --------- Signed-off-by: Andrey Velichkevich <[email protected]>
* Add Fine-Tune BERT LLM Example Signed-off-by: Andrey Velichkevich <[email protected]> * Add 3 GPUs in Notebook requirements Signed-off-by: Andrey Velichkevich <[email protected]> --------- Signed-off-by: Andrey Velichkevich <[email protected]>
I added example to fine-tune BERT model with Yelp review dataset.
This example is based on this tutorial: https://huggingface.co/docs/transformers/en/training
I used
split_dataset_by_node
to distribute data across PyTorchJob workers.Also, I moved our SDK examples to these folders:
text-classification
,image-classification
,language-modeling
.Similar to HuggingFace transformers examples: https://github.com/huggingface/transformers/tree/main/examples/pytorch
I think, we should refactor our Training Operator examples directory in the future PRs to make it more ML engineers and data scientists friendly.
Regardless if users are using Kubeflow Python SDK or
kubectl
and YAMLs to submit jobs they should be able to find the appropriate AI/ML training use-cases.From my perspective, for the long-term we should guide our users more towards Python SDK to submit Kubeflow Jobs.
Please let me know what do you think @johnugeorge @gaocegege @terrytangyuan @kuizhiqing @deepanker13 @Jeffwan @droctothorpe @tenzen-y @StefanoFioravanzo
/hold for review