Replies: 1 comment
-
|
This is a very good observation, and the confusion comes from how Megatron-LM mixes data parallel responsibilities with tensor model parallel ranks. Let’s break it down clearly. 🧠 Key line in questionif is_distributed or mpu.get_tensor_model_parallel_rank() == 0:
build_dataset()This means:
🔷 Your setupYou have:
So:
❓ Your question
✔️ Yes — it is expected in current Megatron design.But the important nuance is:
🧩 Why dataset is built per TP rank 0Megatron uses: 🔹 Tensor Parallelism (TP)
So:
🔹 Why NOT only global rank 0?Because in TP + PP hybrid:
So Megatron ensures:
🧠 Important insightEven though it looks like duplication: ❌ Not actually full dataset duplication across all GPUs✅ Only dataset initialization responsibility is duplicatedWhat happens in reality:
🔁 Why PP + TP combination causes confusionIn your mapping: Yes, both 0 and 4 do dataset setup — but they belong to:
So this is expected duplication of loader ownership, not data duplication
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Your question
hi,
I am very confused about the logic bellow. Here, datasets are built for each rank 0 of the TP group. If it is a rank 0 in the TP group of the middle layer, is it necessary to build datasets?
If the tp group is [[0,1,2,3], [4,5,6,7]], pp-group is [[0,4], [1,5], [2,6], [3,7]], world-size=8, that is global rank0 and rank4 make datasets both,that is right?
help please, thanks!
(
Megatron-LM/megatron/training/training.py
Line 1690 in 55622ff
Beta Was this translation helpful? Give feedback.
All reactions