Streamline parallel: small batches reduce bubbles and increase status management

The flow line uses multiple microbatch staggered to put different layers in different devices in parallel.

• Step by stepCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives . 1 first fix

Try to do it after reading

  • Explain the parallelity of current lines: small batches reduce bubbles and increase mechanisms and prerequisites for state management
  • Positioning the mechanism ' s fault limits with fixed examples

Suggested first

  • Forward-reverse order and multistage model

Issues and mechanisms

The flow line uses multiple microbatch staggered to put different layers in different devices in parallel. It allows models to be accommodated across equipment and hopes to continue working at various stages; However, there are frequent bubbles at the beginning and at the end, and slow stages limit the overall speed. The schedule determines when to save the active, when to reverse and whether all microbates use the same version of parameters.

The model is divided into phases, with a clear indication of the activation and reverse gradients passed by the adjacent phases. Multiple batches can fill the pipe line, but this cannot result in arbitrary changes in the weight of the loss. Synchronization of water flow lines is usually a complete update of the harmonized border update parameters at one time; Other movements, if they allow the parameters to be obsolete, need to be statistically clear and cannot be commingled with the usual large batch update.

A concrete example

When processing only one batch per unit per phase of the synthesis phase, three units will be required forward, with a large number of equipment waiting. The four microbatches were reduced by one, or six units, in the desired flow order, in the approximate number of instalments to be completed, with a single order of 12 units required for implementation. This account book is not inverted or communicated and is only intended for display filling; It cannot be claimed that full training is twice as fast.

Borders and checks

Real-stage costs are uneven, transmission activated and reverse memory can change effects. Boundaries should be measured and not averaged by layer.

Debugs can first record the entry sequence, parameter version and loss contribution for each stage with a small number of named samples, checking for dishonour, duplicate or batch combinations. Checkpoints need to know whether the pipe is emptied and cannot hold only one weight in half of the batches and claim that it can be accurately renewed. The complexity of capacity gains, throughput and recovery should be assessed separately.

A method of verification

A fixed number for each batch can be given to record access, reverse and parameter versions at each stage, confirming that no skipping, repeating or future versions are used. Different dispatches may be called stream lines, and the time of activation may differ from the bubble. If you change the number of batches when you swallow, check whether the effective global batch and the optimist updates are maintained. The parallel upscaling of more samples cannot be misinterpreted as a single drop in the forward delay for each user.

Check understanding

Four microbatch equals four arguments update?

Not necessarily. This chapter is synchronized into cumulative settings, which together form an update; If each paragraph was updated, the training agreement had been changed.

The same number of layers, must the load be balanced?

No guarantee. Different attention, foreplay, length and communication costs should be measured according to actual time and memory, rather than just number of modules.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Stanford CS336 — Language Modeling from Scratch, Spring 2025
  2. PyTorch FSDP — Experiences on Scaling Fully Sharded Data Parallel

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.