Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit 1eb64a1

Browse files
authored
Fine-Tuning Scheduler Tutorial Update for Lightning/PyTorch 2.5.0 (#372)
1 parent a7d9471 commit 1eb64a1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lightning_examples/finetuning-scheduler/finetuning-scheduler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
#
148148
# - ``ddp`` (and aliases ``ddp_find_unused_parameters_false``, ``ddp_find_unused_parameters_true``, ``ddp_spawn``, ``ddp_fork``, ``ddp_notebook``)
149149
# - ``fsdp`` (and alias ``fsdp_cpu_offload``)
150+
# - **NEW**: ``ModelParallelStrategy``
151+
# - [See this example](https://finetuning-scheduler.readthedocs.io/en/stable/distributed/model_parallel_scheduled_fine_tuning.html) using FTS with PyTorch's composable distributed (e.g. ``fully_shard``, ``checkpoint``) and Tensor Parallelism (TP) APIs
150152
#
151153
# Custom or officially unsupported strategies can be used by setting [FinetuningScheduler.allow_untested](https://finetuning-scheduler.readthedocs.io/en/stable/api/finetuning_scheduler.fts.html?highlight=allow_untested#finetuning_scheduler.fts.FinetuningScheduler.params.allow_untested) to ``True``.
152154
# Note that most currently unsupported strategies are so because they require varying degrees of modification to be compatible. For example, ``deepspeed`` will require a [StrategyAdapter](https://finetuning-scheduler.readthedocs.io/en/stable/api/finetuning_scheduler.strategy_adapters.html#finetuning_scheduler.strategy_adapters.StrategyAdapter) to be written (similar to the one for ``FSDP``, [FSDPStrategyAdapter](https://finetuning-scheduler.readthedocs.io/en/stable/api/finetuning_scheduler.strategy_adapters.html#finetuning_scheduler.strategy_adapters.FSDPStrategyAdapter)) before support can be added (PRs welcome!),
@@ -260,7 +262,10 @@ def __init__(
260262
self.save_hyperparameters()
261263
os.environ["TOKENIZERS_PARALLELISM"] = "true" if self.hparams.tokenizers_parallelism else "false"
262264
self.tokenizer = AutoTokenizer.from_pretrained(
263-
self.hparams.model_name_or_path, use_fast=True, local_files_only=False
265+
self.hparams.model_name_or_path,
266+
use_fast=True,
267+
local_files_only=False,
268+
clean_up_tokenization_spaces=True,
264269
)
265270

266271
def prepare_data(self):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
datasets >=2.17.0 # to allow explicitly setting `trust_remote_code`
2-
finetuning-scheduler[examples] <=2.4.0
2+
finetuning-scheduler[examples] <=2.5.0

0 commit comments

Comments
 (0)