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

Fix dreambooth data sampler issue #8400

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def setup_training_data(self, cfg):
global_batch_size=self.cfg.global_batch_size,
data_parallel_rank=parallel_state.get_data_parallel_rank(),
data_parallel_size=parallel_state.get_data_parallel_world_size(),
drop_last=False,
drop_last=True,
)

self._train_dl = torch.utils.data.DataLoader(
Expand Down
3 changes: 3 additions & 0 deletions nemo/collections/multimodal/parts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
from pytorch_lightning.plugins.environments import TorchElasticEnvironment
from transformers import CLIPImageProcessor

from nemo.collections.nlp.modules.common.megatron.megatron_init import fake_initialize_model_parallel
from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy, NLPSaveRestoreConnector
from nemo.collections.nlp.parts.peft_config import PEFT_CONFIG_MAP
from nemo.utils import AppState, logging
from nemo.utils.model_utils import inject_model_parallel_rank

try:
from megatron.core import dist_checkpointing
Expand Down Expand Up @@ -361,6 +363,7 @@ def create_neva_model_and_processor(cfg):
neva_cfg.activations_checkpoint_method = None
neva_cfg.precision = trainer.precision
neva_cfg.mm_cfg.llm.from_pretrained = cfg.get('base_model_file', None)
neva_cfg.apply_rope_fusion = False
# neva_cfg.mm_cfg.vision_encoder.from_pretrained = None

model = MegatronNevaModel.restore_from(
Expand Down
Loading