mmengine
Engine of OpenMMLab projects
What it is and what it does
MMEngine is a training engine built on PyTorch that abstracts the training loop into a configurable Runner class. It handles model forward passes, loss computation, gradient updates, and validation workflows, allowing you to define training logic declaratively rather than imperatively. The library integrates with distributed training frameworks like DeepSpeed, FSDP, and ColossalAI, supports mixed-precision training and gradient checkpointing, and provides hooks for monitoring via TensorBoard, WandB, MLflow, and other platforms.
You define a model inheriting from BaseModel, create datasets and metrics, then pass them to a Runner with a configuration dictionary specifying training parameters. The Runner handles the training loop, checkpointing, and metric evaluation. It's designed as the training backbone for OpenMMLab projects but is generic enough for non-OpenMMLab PyTorch workflows. The library depends on standard data science libraries (numpy, matplotlib, opencv-python) and configuration tools (pyyaml, rich for terminal output).
Use it for:
- Training computer vision models on image datasets with built-in support for distributed training across multiple GPUs or nodes.
- Building configurable training pipelines where hyperparameters and training strategies are specified in Python or YAML config files rather than hardcoded.
- Integrating large-model training frameworks like DeepSpeed or FSDP into PyTorch projects without manually orchestrating distributed communication.
- Monitoring training progress across multiple logging backends (TensorBoard, WandB, MLflow) simultaneously from a single Runner configuration.
- Implementing custom metrics and validation logic via the BaseMetric interface while the Runner handles the training loop and checkpointing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
MMEngine is a foundational PyTorch training library that provides a configurable runner, metrics system, and integration with distributed training frameworks to streamline deep learning model development.
Yes. MMEngine is actively maintained, has low install friction, uses a permissive license, and integrates well with standard PyTorch workflows. It's particularly valuable if you're building training pipelines for computer vision or want to leverage distributed training frameworks without manual orchestration. No known vulnerabilities. Install it if you want a structured, configurable training abstraction; skip it if you prefer writing training loops directly.
Install
mmengine on PyPI
pip
pip install mmengineuv
uv add mmenginepoetry
poetry add mmengineInstalling mmengine
Before you install
Low friction installation via pip; active maintenance with recent commits and regular releases. Depends on 9 common libraries including numpy, matplotlib, and opencv-python, all widely available.
License in practice
Permissive license (Apache Software License per classifiers) allows use in commercial and proprietary projects without restriction.
Quickstart
pip install mmengine
from mmengine.runner import Runner
from mmengine.model import BaseModel
runner = Runner(
model=MyModel(),
train_dataloader=train_loader,
optim_wrapper=dict(optimizer=dict(type='SGD', lr=0.001)),
train_cfg=dict(by_epoch=True, max_epochs=5)
)
runner.train()
Requires PyTorch >=1.6 <=2.1 and Python >=3.7 <=3.11 to be installed first.
Verify before relying
- Whether the library works with PyTorch versions beyond 2.1 (current support table shows <=2.1).
- Performance characteristics when training very large models with the integrated frameworks (ColossalAI, DeepSpeed, FSDP).
- Compatibility with custom training loops outside the Runner abstraction.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — addict, matplotlib, numpy, pyyaml, rich, termcolor, yapf, opencv-python, regex |
| Maintenance | actively maintained — 528 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 836,666/month — #4,932 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mmengine-0.10.7-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
mmdetMMDetection is an object detection and instance…
permissive · top 15,000 on PyPI
mmcvMMCV is a foundational library for computer…
permissive · top 15,000 on PyPI
trainerTrainer is a PyTorch model training framework…
permissive · top 15,000 on PyPI
accelerateAccelerate abstracts away distributed training…
permissive · top 1,000 on PyPI
pytorch-ignitePyTorch Ignite provides a high-level training…
permissive · top 15,000 on PyPI
lightningLightning is a framework that organizes PyTorch…
permissive · top 5,000 on PyPI
coqui-tts-trainerA PyTorch model trainer framework that handles…
permissive · top 15,000 on PyPI
torchevalTorchEval provides a collection of PyTorch…
permissive · top 15,000 on PyPI
fairscaleFairScale extends PyTorch with distributed…
permissive · top 15,000 on PyPI
deepspeedDeepSpeed is a distributed deep learning…
permissive · top 5,000 on PyPI