Skip to content

Incorrect LLM output when using pipeline parallelism #44945

@tasinislam21

Description

@tasinislam21

System Info

transformers==4.57.1
Python==3.12.12
Kaggle env

Who can help?

@Cyrilvallez
@3outeille

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

I am developing a notebook that runs the Molmo2 - action recognition and video understanding LLM model - on Kaggle. This setup will allow users with limited computational resources to run a demo on Kaggle's GPU for free. Kaggle provides an environment with 2 NVIDIA T4 GPUs. I have manually mapped the layers across each GPU to ensure that they fit within the VRAM constraints. However, I am experiencing extremely poor model performance, as it seems to operate as if the checkpoints were not loaded correctly.

On a single GPU or CPU, the model functions properly and produces expected results. Could someone please review my notebook and suggest a solution to this issue? Your help would be greatly appreciated.

Link to my notebook.

What I have already tried:

  • Used the load_in_8bit parameter, but when I called the generate function, I encountered a NotImplementedError, so I reverted back to using torch.float16.

  • Couldn't use torch.float32 because the T4 GPU does not have enough memory.

  • Tried using the argument device_map="auto", but the mapping was problematic, as half of a block stayed on one device while the other half ended up elsewhere. This is an issue when residuals are involved.

Expected behavior

The model should say that there are penguins in the video.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions