Large-Scale Training Parallelism

이 경로는 DP/DDP/FSDP 이후의 대규모 학습 병렬화를 다룹니다.

기준 흐름은 다음입니다.

Picotron  -> 원리가 드러나는 최소 구현
Nanotron  -> 실제 trainer/config/checkpoint 구조
Megatron  -> production-scale reference

각 카드는 작성 전에 세 코드베이스를 먼저 비교합니다. 독자는 작은 코드에서 원리를 잡고, 중간 규모 framework에서 구조를 보고, 마지막으로 Megatron에서 production 복잡도가 왜 필요한지 확인합니다.

카드는 한 번에 하나씩 추가합니다. 모든 카드는 이해를 돕는 위젯을 최소 1개 포함합니다.

  1. Large-Scale Parallelism Coordinate System — Picotron, Nanotron, Megatron을 같은 DP/TP/PP/CP/EP 좌표계로 읽기 위한 기준을 세운다.
  2. Picotron Process Group Manager — Picotron의 4D rank grid를 기준으로 TP/PP/CP/DP process group이 어떻게 만들어지는지 읽는다.
  3. Tensor Parallel Linear From Picotron — Picotron의 ColumnParallelLinear와 RowParallelLinear를 기준으로 TP layer sharding의 계산 의미를 이해한다.
  4. Sequence Parallelism as TP Layout — Nanotron과 Megatron에서 SP가 TP의 all-reduce를 reduce-scatter/all-gather layout 전환으로 바꾸는 방식을 이해한다.
  5. Pipeline Parallelism from Picotron — Picotron의 작은 PP 구현에서 layer ownership, activation/gradient P2P, AFAB, 1F1B를 읽고 Nanotron/Megatron이 어떤 구조를 더하는지 비교한다.
  6. Context Parallel Ring Attention — Picotron의 ring attention 루프를 기준으로 CP에서 K/V chunk가 어떻게 이동하고 online softmax로 full attention과 같은 결과를 만드는지 읽는다.
  7. Expert Parallel MoE Dispatch — Picotron에는 비어 있는 EP 축을 Nanotron의 작은 MoE 구현과 Megatron의 token dispatcher 구조로 채우며 router, permutation, all-to-all, expert compute의 흐름을 이해한다.
  8. Picotron to Megatron Reading Map — Picotron, Nanotron, Megatron을 각각 어떤 목적으로 읽어야 하는지 정리하고 TP, SP, PP, CP, EP를 실제 학습 전략으로 조합하는 기준을 세운다.