Note: If the installation fails due to memory issues during compilation, limit the parallel jobs by prefixing the command with MAX_JOBS=4 .
docker run --ipc=host --shm-size=512m --gpus all -it nvcr.io/nvidia/pytorch:24.02-py3 Use code with caution. Copied to clipboard
: An NVIDIA GPU (Turing architecture or later recommended). For advanced FP8 support, NVIDIA Hopper, Ada, or Blackwell GPUs are required. Python : Version 3.10 or higher (3.12 is recommended). PyTorch : Version 2.6.0 or higher. CUDA Toolkit : The latest stable version. Download Install Megatron Repo zip
To install the repository from a downloaded ZIP file, you must first ensure your system meets the heavy hardware and software requirements for large-scale transformer training. 1. System Prerequisites
:In the extracted directory, run the following command to install Megatron-LM in editable mode: uv pip install -e . Use code with caution. Copied to clipboard Note: If the installation fails due to memory
uv pip install --group build uv pip install --no-build-isolation -e ".[training,dev]" Use code with caution. Copied to clipboard
: You will typically need NVIDIA Apex for mixed-precision training and the NLTK library . 2. Downloading and Extracting the ZIP For advanced FP8 support, NVIDIA Hopper, Ada, or
Before installing the repository, verify that your environment includes the following essential software and hardware components: