diff --git a/examples/nlp/gpt/serve_reward_model.py b/examples/nlp/gpt/serve_reward_model.py index a425f26e7..5f5dfc609 100644 --- a/examples/nlp/gpt/serve_reward_model.py +++ b/examples/nlp/gpt/serve_reward_model.py @@ -13,7 +13,7 @@ # limitations under the License. import torch -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy from nemo.core.config import hydra_runner diff --git a/nemo_aligner/models/nlp/gpt/gpt_sft_model.py b/nemo_aligner/models/nlp/gpt/gpt_sft_model.py index d3a615500..87b272473 100644 --- a/nemo_aligner/models/nlp/gpt/gpt_sft_model.py +++ b/nemo_aligner/models/nlp/gpt/gpt_sft_model.py @@ -19,7 +19,7 @@ from megatron.core.num_microbatches_calculator import get_micro_batch_size, get_num_microbatches from megatron.core.pipeline_parallel.schedules import get_forward_backward_func from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel from nemo.collections.nlp.modules.common.megatron.utils import get_iterator_k_split diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_critic.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_critic.py index a61cd2b8d..b43c01766 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_critic.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_critic.py @@ -19,7 +19,7 @@ from megatron.core.pipeline_parallel.schedules import get_forward_backward_func from megatron.core.transformer.module import Float16Module from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.modules.common.megatron.utils import ( average_losses_across_data_parallel_group, diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_dpo_model.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_dpo_model.py index 952b4e897..024b3cc8d 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_dpo_model.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_dpo_model.py @@ -20,7 +20,7 @@ from megatron.core.pipeline_parallel.schedules import get_forward_backward_func from megatron.core.utils import divide from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel from nemo.collections.nlp.modules.common.megatron.utils import ( diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_kto_model.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_kto_model.py index 0be08e808..f99f170d0 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_kto_model.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_kto_model.py @@ -20,7 +20,7 @@ from megatron.core.pipeline_parallel.schedules import get_forward_backward_func from megatron.core.utils import divide from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel from nemo.collections.nlp.modules.common.megatron.utils import ( diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_ppo_actor.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_ppo_actor.py index 275e02e82..7433ddff9 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_ppo_actor.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_ppo_actor.py @@ -21,7 +21,7 @@ from megatron.core.utils import divide from omegaconf import OmegaConf from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel from nemo.collections.nlp.modules.common.megatron.utils import ( diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_regression_reward_model.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_regression_reward_model.py index eb9333c12..130c0a276 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_regression_reward_model.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_regression_reward_model.py @@ -17,7 +17,7 @@ from megatron.core.num_microbatches_calculator import get_num_microbatches from megatron.core.pipeline_parallel.schedules import get_forward_backward_func from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.modules.common.megatron.utils import ( average_losses_across_data_parallel_group, diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_reward_model.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_reward_model.py index 596436c67..9bb7b3019 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_reward_model.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_reward_model.py @@ -21,7 +21,7 @@ from megatron.core.pipeline_parallel.schedules import get_forward_backward_func from megatron.core.utils import divide from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel, get_specs from nemo.collections.nlp.modules.common.megatron.utils import ( diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_rs_actor.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_rs_actor.py index 49dd3846c..4dad4a2b0 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_rs_actor.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_rs_actor.py @@ -21,7 +21,7 @@ from megatron.core.utils import divide from omegaconf import OmegaConf from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel from nemo.collections.nlp.modules.common.megatron.utils import ( diff --git a/nemo_aligner/models/nlp/gpt/megatron_gpt_spin_model.py b/nemo_aligner/models/nlp/gpt/megatron_gpt_spin_model.py index 4598eaaac..626c21ce4 100644 --- a/nemo_aligner/models/nlp/gpt/megatron_gpt_spin_model.py +++ b/nemo_aligner/models/nlp/gpt/megatron_gpt_spin_model.py @@ -20,7 +20,7 @@ from megatron.core.pipeline_parallel.schedules import get_forward_backward_func from omegaconf import OmegaConf from omegaconf.dictconfig import DictConfig -from pytorch_lightning.trainer.trainer import Trainer +from lightning.pytorch.trainer.trainer import Trainer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel from nemo.collections.nlp.modules.common.megatron.utils import ( diff --git a/nemo_aligner/utils/train_script_utils.py b/nemo_aligner/utils/train_script_utils.py index c6f6f8089..05af2955d 100644 --- a/nemo_aligner/utils/train_script_utils.py +++ b/nemo_aligner/utils/train_script_utils.py @@ -19,8 +19,8 @@ from omegaconf import open_dict from omegaconf.omegaconf import OmegaConf -from pytorch_lightning.trainer import call -from pytorch_lightning.trainer.states import TrainerFn +from lightning.pytorch.trainer import call +from lightning.pytorch.trainer.states import TrainerFn from nemo.collections.nlp.parts.megatron_trainer_builder import MegatronTrainerBuilder from nemo.collections.nlp.parts.peft_config import PEFT_CONFIG_MAP diff --git a/tests/conftest.py b/tests/conftest.py index a9f49b28f..ba6280094 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,7 +16,7 @@ import pytest from omegaconf import DictConfig -from pytorch_lightning import Trainer +from lightning.pytorch import Trainer from nemo.collections.common.tokenizers.huggingface.auto_tokenizer import AutoTokenizer from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel