Skip to content
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b04903b
move deepspeed to `lib_integrations.deepspeed`
younesbelkada Aug 18, 2023
9453fa2
more refactor
younesbelkada Aug 18, 2023
7c0b4bb
oops
younesbelkada Aug 18, 2023
582fbde
fix slow tests
younesbelkada Aug 18, 2023
190b83f
Fix docs
younesbelkada Aug 18, 2023
026f53c
fix docs
younesbelkada Aug 18, 2023
b30adec
addess feedback
younesbelkada Aug 21, 2023
f8afb0a
address feedback
younesbelkada Aug 21, 2023
de497d4
final modifs for PEFT
younesbelkada Aug 21, 2023
b2e1672
Merge remote-tracking branch 'upstream/main' into move-integrations
younesbelkada Aug 21, 2023
e4e245b
fixup
younesbelkada Aug 21, 2023
5668474
Merge branch 'main' into move-integrations
younesbelkada Aug 21, 2023
f4d8c83
ok now
younesbelkada Aug 21, 2023
bc7a6ae
Merge branch 'move-integrations' of https://github.com/younesbelkada/…
younesbelkada Aug 21, 2023
c80cfd1
trigger CI
younesbelkada Aug 21, 2023
656c411
trigger CI again
younesbelkada Aug 21, 2023
80d2775
Update docs/source/en/main_classes/deepspeed.md
younesbelkada Aug 22, 2023
7cc7cbb
import from `integrations`
younesbelkada Aug 22, 2023
b4c4cf7
address feedback
younesbelkada Aug 22, 2023
bd95ee2
revert removal of `deepspeed` module
younesbelkada Aug 22, 2023
615ac14
revert removal of `deepspeed` module
younesbelkada Aug 22, 2023
b8fcf61
fix conflicts
younesbelkada Aug 22, 2023
be38218
ooops
younesbelkada Aug 22, 2023
310ceb1
oops
younesbelkada Aug 22, 2023
bb0a025
Merge remote-tracking branch 'upstream/main' into move-integrations
younesbelkada Aug 22, 2023
b756ace
add deprecation warning
younesbelkada Aug 22, 2023
080fc2f
place it on the top
younesbelkada Aug 22, 2023
d50051a
put `FutureWarning`
younesbelkada Aug 23, 2023
72fd103
fix conflicts with not_doctested.txt
younesbelkada Aug 23, 2023
5773b33
add back `bitsandbytes` module with a depr warning
younesbelkada Aug 23, 2023
8ace6bd
fix
younesbelkada Aug 23, 2023
10d3b77
Merge remote-tracking branch 'upstream/main' into move-integrations
younesbelkada Aug 23, 2023
7b6098c
fix
younesbelkada Aug 23, 2023
89f4ebd
fixup
younesbelkada Aug 23, 2023
3107a96
oops
younesbelkada Aug 23, 2023
fa451d4
fix doctests
younesbelkada Aug 23, 2023
33412d3
Merge branch 'main' into move-integrations
younesbelkada Aug 23, 2023
4b4c681
Merge remote-tracking branch 'upstream/main' into move-integrations
younesbelkada Aug 24, 2023
10d6e18
Merge remote-tracking branch 'upstream/main' into move-integrations
younesbelkada Aug 25, 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
12 changes: 6 additions & 6 deletions docs/source/en/main_classes/deepspeed.md
Original file line number Diff line number Diff line change
Expand Up @@ -2065,20 +2065,20 @@ In this case you usually need to raise the value of `initial_scale_power`. Setti

## Non-Trainer Deepspeed Integration

The [`~deepspeed.HfDeepSpeedConfig`] is used to integrate Deepspeed into the 🤗 Transformers core
The [`~integrations.HfDeepSpeedConfig`] is used to integrate Deepspeed into the 🤗 Transformers core
functionality, when [`Trainer`] is not used. The only thing that it does is handling Deepspeed ZeRO-3 param gathering and automatically splitting the model onto multiple gpus during `from_pretrained` call. Everything else you have to do by yourself.

When using [`Trainer`] everything is automatically taken care of.

When not using [`Trainer`], to efficiently deploy DeepSpeed ZeRO-3, you must instantiate the
[`~deepspeed.HfDeepSpeedConfig`] object before instantiating the model and keep that object alive.
[`~integrations.HfDeepSpeedConfig`] object before instantiating the model and keep that object alive.

If you're using Deepspeed ZeRO-1 or ZeRO-2 you don't need to use `HfDeepSpeedConfig` at all.

For example for a pretrained model:

```python
from transformers.deepspeed import HfDeepSpeedConfig
from transformers.integrations import HfDeepSpeedConfig
from transformers import AutoModel
import deepspeed

Expand All @@ -2092,7 +2092,7 @@ engine = deepspeed.initialize(model=model, config_params=ds_config, ...)
or for non-pretrained model:

```python
from transformers.deepspeed import HfDeepSpeedConfig
from transformers.integrations import HfDeepSpeedConfig
from transformers import AutoModel, AutoConfig
import deepspeed

Expand All @@ -2108,7 +2108,7 @@ Please note that if you're not using the [`Trainer`] integration, you're complet

## HfDeepSpeedConfig

[[autodoc]] deepspeed.HfDeepSpeedConfig
[[autodoc]] integrations.HfDeepSpeedConfig
- all

### Custom DeepSpeed ZeRO Inference
Expand Down Expand Up @@ -2161,7 +2161,7 @@ Make sure to:


from transformers import AutoTokenizer, AutoConfig, AutoModelForSeq2SeqLM
from transformers.deepspeed import HfDeepSpeedConfig
from transformers.integrations import HfDeepSpeedConfig
import deepspeed
import os
import torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

from parameterized import parameterized # noqa
from transformers import TrainingArguments, is_torch_available # noqa
from transformers.deepspeed import is_deepspeed_available # noqa
from transformers.integrations.deepspeed import is_deepspeed_available # noqa
from transformers.file_utils import WEIGHTS_NAME # noqa
from transformers.testing_utils import ( # noqa
CaptureLogger,
Expand Down
5 changes: 1 addition & 4 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"data.metrics": [],
"data.processors": [],
"debug_utils": [],
"deepspeed": [],
"dependency_versions_check": [],
"dependency_versions_table": [],
"dynamic_module_utils": [],
Expand All @@ -115,8 +116,6 @@
"is_tensorboard_available",
"is_wandb_available",
],
"lib_integrations": [],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing an integrations key here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"lib_integrations.peft": [],
"modelcard": ["ModelCard"],
"modeling_tf_pytorch_utils": [
"convert_tf_weight_name_to_pt_weight_name",
Expand Down Expand Up @@ -745,7 +744,6 @@
"is_vision_available",
"logging",
],
"utils.bitsandbytes": [],
"utils.quantization_config": ["BitsAndBytesConfig", "GPTQConfig"],
}

Expand Down Expand Up @@ -1002,7 +1000,6 @@
"TextDataset",
"TextDatasetForNextSentencePrediction",
]
_import_structure["deepspeed"] = []
_import_structure["generation"].extend(
[
"BeamScorer",
Expand Down
Loading