Lattice
Skip to content

Megatron-LM

librarySelf-hostedgithub.com

Megatron-LM is a self-hosted library in the Fine-tuning & Training layer of the AI stack. Tensor and pipeline parallel training for multi-GPU clusters.

By Facts verifiedmethod

Licence
Apache-2.0
Language
CUDA
Cost
free
Owned by
AI Infrastructure

Use Megatron-LM when

Tensor and pipeline parallel pretraining at cluster scale.

Skip Megatron-LM when

You are fine-tuning rather than pretraining.

Produces the weights that layer 1 serves. See every training tool.

Badge this entry
Lattice badge: Megatron-LM verified 2026-09
[![Megatron-LM on Lattice: verified 2026-09](https://lattice.kunjshah.in/fine-tuning/megatron-lm/badge.svg)](https://lattice.kunjshah.in/fine-tuning/megatron-lm)

Rules of thumb

  • Fine-tuning teaches behaviour, not facts. If the answer changes monthly, it belongs in retrieval instead.
  • Exhaust prompting and retrieval before training. A fine-tune is a model you now have to version, evaluate and serve.
  • Hold out an eval set before the first training run. Without it you cannot tell a better model from a different one.

Quick answers

Is Megatron-LM open source?
Yes. Megatron-LM is open source under the Apache-2.0 licence. It is free to use.
What are the alternatives to Megatron-LM?
The closest alternatives to Megatron-LM are DeepSpeed.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.

Reading on training

Alternatives to Megatron-LM

Listed as an alternative to

  • DeepSpeed

Also in training

  • Unsloth
  • Axolotl
  • LLaMA-Factory
  • PEFT
  • TRL
  • DeepSpeed
  • torchtune
  • Hugging Face TRL
  • Colab
  • Replicate
  • Weights & Biases Launch