EleutherAI/gpt-neox
Megatron and DeepSpeed tooling for distributed GPU training of autoregressive LLMs
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
GPT-NeoX is a Python/PyTorch research trainer for autoregressive transformers. The megatron/ stack provides model-parallel building blocks, while the DeepSpeed-family runtime supports distributed execution and ZeRO. Data, tensor, and pipeline parallelism can be combined to fit a training job to a GPU allocation. deepy.py takes YAML configuration and launches workflows such as train.py and eval.py; generate.py provides a separate generation entry point.
The workflow is file-based. prepare_data.py creates tokenized .bin and .idx files, and data-path points to their common prefix. The configs/ directory is where operators select architecture, parallelism, and batch settings. The main integration points are configuration, checkpoint conversion in tools/ckpts/, and DeepSpeed launchers. For cluster schedulers outside the built-in options, customization may extend into DeepSpeed's multinode runner rather than stopping at NeoX YAML.
Key Capabilities & Differentiators
NeoX supports distributed pretraining and fine-tuning with rotary or ALiBi positional schemes, parallel attention and feed-forward layers, and curriculum learning. Example configurations cover Pythia, PaLM, Falcon, and LLaMA 1 and 2. Those templates describe model architectures, not a blanket guarantee of checkpoint import compatibility. The listed import families are Llama 1, Llama 2, CodeLlama, and Mistral-7B-v0.1, with separate tools for original Meta weights and supported Hugging Face checkpoints.
eval.py takes lm-evaluation-harness task names via --eval_tasks, so teams can evaluate a trained checkpoint through the same launcher used for training. FlashAttention and NVIDIA Transformer Engine are optional, version-sensitive acceleration paths; their benefits depend on the GPU and compatible builds. AMD MI100 and MI250X have a JIT fused-kernel path, which is distinct from the NVIDIA Transformer Engine path.
Trade-offs & Limitations
GPT-NeoX gives research teams controls over model design, partitioning, and training that also make it more work to operate. Treat the example YAML files as starting points, not tuned profiles. model-parallel-size, pipe-parallel-size, train_micro_batch_size_per_gpu, gradient-accumulation-steps, and zero_optimization all affect whether a run fits and how it scales. Partitioning can reduce per-GPU memory pressure while adding communication or pipeline overhead, so test on the actual interconnect before reserving a large cluster allocation.
For routine inference, Hugging Face transformers is the simpler fit when it already loads the checkpoint. NeoX's generation entry point is useful within the training workflow, but it is not a reason on its own to adopt the distributed training stack. Pin the NeoX and Deep(er)Speed versions together, particularly for legacy checkpoints and optional kernels. Apache-2.0 covers the framework code; it does not determine the terms of imported weights or datasets.
Hardware & Deployment Guide
Deploy GPT-NeoX as a self-hosted GPU CLI workload. The primary development and test ranges are Python 3.8–3.10 and PyTorch 1.8–2.0, not hard limits. Install the base stack from requirements/requirements.txt in an isolated environment; install FlashAttention or Transformer Engine from the corresponding optional requirements if needed. A suitable PyTorch NGC image is another route, but preinstalled versions are not automatically compatible. Stage the tokenizer, data, and any input checkpoint on storage the job can access.
Start with a model YAML and launch with python3 deepy.py train.py /path/to/configs/my_model.yml. For multi-node jobs, a hostfile maps nodes to GPU slot counts, and the YAML selects pdsh, MPI, or Slurm as appropriate. Version 2.0, released on March 10, 2023, moved to a DeepSpeed basis compatible with upstream features such as communication logging and autotuning. Version 1.0 preserves the DeeperSpeed 0.3.15-era stack associated with GPT-NeoX-20B and Pythia; pin the runtime and validate checkpoint loading before changing stacks.
prepare_data.py emits paired .bin and .idx files referenced by their shared data-path prefix.deepy.py launches eval.py and passes lm-evaluation-harness task names through --eval_tasks.Research and infrastructure teams pretraining billion-parameter models, fine-tuning supported checkpoints at scale, or studying parallelism and model architecture on GPU clusters.
You only need generic text generation from an existing compatible checkpoint or are looking for an inference-first serving stack.
Quick Start & Installation
pip install -r requirements/requirements.txt pip install -r requirements/requirements-wandb.txt # optional, if logging using WandB pip install -r requirements/requirements-tensorboard.txt # optional, if logging via tensorboard pip install -r requirements/requirements-comet.txt # optional, if logging via Comet
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| gpt-neox ★ | 7.5k | +4 | Python | Apache-2.0 | Megatron and DeepSpeed tooling for distributed GPU training of autoregressive LL |
| peft | 21.9k | +32 | Python | Apache-2.0 | Python/PyTorch adapters for fine-tuning large models without updating base weigh |
| minimind | 75.4k | +3.1k | Python | Apache-2.0 | Native PyTorch dense and MoE models for end-to-end LLM training on local GPUs |
| autoresearch | 101k | +342 | Python | — | Single-GPU nanochat harness for agent-led, five-minute training experiments |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/EleutherAI/gpt-neox.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about gpt-neox
How do I bring an existing checkpoint into a distributed NeoX run?
tools/ckpts/convert_hf_to_sequential.py for supported Hugging Face checkpoints, or tools/ckpts/convert_raw_llama_weights_to_neox.py for original Meta Llama 1 or 2 weights. For the latter, set --num_output_shards to the tensor-parallel size. Test loading with the intended YAML configuration before committing cluster time.How much GPU memory should I budget?
Can my organization self-host GPT-NeoX commercially?
When should I choose GPT-NeoX over Hugging Face transformers?
transformers rather than adopting NeoX's training-oriented runtime just to run inference.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy