Skip to content

[PP] Why always cache chunk outputs for last stage ? #159251

@mingyuanw-mt

Description

@mingyuanw-mt

In the implementation of pipeline parallelism (take 1F1B as an example), the device correspond to the last stage will cache the output of forward into self.output_chunks for final output merge or reduction, which results the forward output of each micro batch size keeps alive during the step period and possibly retaining more GPU memory.

My question is Do we really always need to cache the forward outputs during training (If not, can PP make the caching behavior optional?)

I have posted a more detailed discuss on question-about-gpu-memory-usage-when-using-pipeline-parallelism-training-under-larger-micro-batch-count

Hi, @H-Huang @kwen2501 could you please share any suggestions you might have ?

cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions