skillfed

mmengine

Engine of OpenMMLab projects

mmengine v0.10.7 836.7K downloads/30d#4,932 on PyPI1,486
Permissive license Active released

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 mmengine

uv

uv add mmengine

poetry

poetry add mmengine

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Utilities

Tags

pytorch training frameworkdeep learning training enginedistributed model trainingtraining loop abstractionmodel training configurationpytorch training utilitiesdeep learning training pipeline
pytorch-trainingdistributed-trainingdeep-learning

More Utilities packages