Skip to content
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

[Unified TorchTrainer] Add HF Transformers TorchTrainer Utilities #38083

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e8ea452
init
woshiyyya Aug 3, 2023
3e6eabd
Merge branch 'master' into train/unified-api/add_transformers_utilities
woshiyyya Aug 9, 2023
57e458b
update utilities
woshiyyya Aug 9, 2023
690bdf7
polish code
woshiyyya Aug 9, 2023
6ed560b
polish code
woshiyyya Aug 9, 2023
9730923
Merge remote-tracking branch 'upstream/master' into train/unified-api…
woshiyyya Aug 10, 2023
d562460
finish
woshiyyya Aug 10, 2023
4d4ecf6
add UT
woshiyyya Aug 10, 2023
fa41ab1
fix lint
woshiyyya Aug 10, 2023
8cc2c9c
add unittests
woshiyyya Aug 11, 2023
07b9953
fix tests
woshiyyya Aug 11, 2023
7f32f04
add basic example
woshiyyya Aug 11, 2023
3655a58
Merge branch 'master' into train/unified-api/add_transformers_utilities
woshiyyya Aug 11, 2023
1fd6695
fix doc
woshiyyya Aug 11, 2023
4c6ccb5
fix import path
woshiyyya Aug 11, 2023
29d44a8
Merge remote-tracking branch 'upstream/master' into train/unified-api…
woshiyyya Aug 11, 2023
fcac881
wip
woshiyyya Aug 11, 2023
93f12c5
update getting start page
woshiyyya Aug 11, 2023
19ee0a1
add to toc tree
woshiyyya Aug 11, 2023
8fdf7c6
add report and data integration
woshiyyya Aug 11, 2023
a5e5cfe
fix doc
woshiyyya Aug 11, 2023
8602ff2
Merge remote-tracking branch 'upstream/master' into train/unified-api…
woshiyyya Aug 11, 2023
8ad6e11
update report callback
woshiyyya Aug 11, 2023
1722273
Apply suggestions from code review
woshiyyya Aug 11, 2023
ba8bdd8
address comments
woshiyyya Aug 11, 2023
4f496a3
polish the basic example
woshiyyya Aug 11, 2023
f35a499
address comments
woshiyyya Aug 11, 2023
7427d98
minor fix
woshiyyya Aug 11, 2023
dcaca15
fix Title underline too short
woshiyyya Aug 11, 2023
18cbca8
fix lazy import and update checkpoint user guides
woshiyyya Aug 11, 2023
88c7acf
update emphasize lines
woshiyyya Aug 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/source/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ parts:
title: PyTorch
- file: train/getting-started-pytorch-lightning
title: PyTorch Lightning
- file: train/getting-started-transformers
title: Hugging Face Transformers
- file: train/more-frameworks
sections:
- file: train/huggingface-transformers-accelerate
title: HuggingFace Transformers & Accelerate
title: Hugging Face Transformers & Accelerate
- file: train/distributed-tensorflow-keras
title: TensorFlow & Keras
- file: train/distributed-xgboost-lightgbm
Expand All @@ -86,6 +88,8 @@ parts:
sections:
- file: train/examples/pytorch/torch_fashion_mnist_example
title: "PyTorch Fashion MNIST Example"
- file: train/examples/transformers/transformers_torch_trainer_basic
title: "Hugging Face Transformers Basic Example"
- file: train/examples/lightning/lightning_mnist_example
title: "PyTorch Lightning Basic Example"
- file: train/examples/lightning/lightning_cola_advanced
Expand Down
21 changes: 16 additions & 5 deletions doc/source/train/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Ray Train Integrations
PyTorch Ecosystem
~~~~~~~~~~~~~~~~~

Scale out your PyTorch, Lightning, HuggingFace code with Ray TorchTrainer.
Scale out your PyTorch, Lightning, Hugging Face code with Ray TorchTrainer.

.. autosummary::
:toctree: doc/
Expand Down Expand Up @@ -72,17 +72,28 @@ PyTorch Lightning
~train.lightning.LightningCheckpoint
~train.lightning.LightningPredictor

HuggingFace Transformers
************************
Hugging Face Transformers
*************************

.. autosummary::
:toctree: doc/

~train.huggingface.transformers.prepare_trainer
~train.huggingface.transformers.RayTrainReportCallback

.. note::

We will deprecate `TransformersTrainer`, `TransformersCheckpoint` in Ray 2.8. Please
refer to the :ref:`migration guide <transformers-trainer-migration-guide>` for more info.

.. autosummary::
:toctree: doc/

~train.huggingface.TransformersTrainer
~train.huggingface.TransformersCheckpoint

HuggingFace Accelerate
**********************
Hugging Face Accelerate
***********************

.. autosummary::
:toctree: doc/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:orphan:

.. _transformers_torch_trainer_basic_example :

Ray Train Basic Example for HuggingFace Transformers
====================================================

.. literalinclude:: /../../python/ray/train/examples/transformers/transformers_torch_trainer_basic.py
Loading
Loading