[QUESTION] Megatron-LM DistributedOptimizer or NeMo MegatronDistributedFusedAdam Optimizer?
#1091
Replies: 1 comment
-
|
This is a good question because these two optimizers look similar but sit at different levels of the stack and make very different trade-offs. 1. High-level summary
2. Key conceptual difference🔹 Megatron-LM DistributedOptimizerThis is:
It provides:
Pros:
Cons:
🔹 NeMo MegatronDistributedFusedAdamThis is:
It includes:
Pros:
Cons:
3. Performance comparison (practical view)Compute-heavy large-scale training (7B+ models)✔ NeMo fused optimizer winsBecause:
👉 Typically better tokens/sec and MFU Small / medium scale / research setups✔ Megatron-LM DistributedOptimizer is often betterBecause:
4. Communication behavior difference
5. Stability vs performance trade-offMegatron-LM optimizer:
NeMo optimizer:
6. Which one should you use?✔ Use NeMo MegatronDistributedFusedAdam if:
✔ Use Megatron-LM DistributedOptimizer if:
7. Important nuanceBoth optimizers are still:
So differences are mostly:
8. Rule of thumb
9. Bottom line
If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find. Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting. GitHub: https://github.com/Advait251206 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
After going across both Megatron-LM & NeMo I've found that NeMo configs set by default the
MegatronDistributedFusedAdamoptimizer from the NeMo framework. But Megatron also contains aDistributedOptimizer.The NeMo one is based on the Apex's
DistributedFusedAdamwhich incorporates ZeRO-2. I would like to know which one is better, both in terms of throughput and performance or which config do you recommend to use for large scale training.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions