open-mmlab/mmengine: the training engine under every OpenMMLab project
OpenMMLab Foundational Library for Training Deep Learning Models
At a glance
- What is it?
- MMEngine is the PyTorch training foundation that all OpenMMLab codebases build on, and it is generic enough for non-OpenMMLab projects. Here is what it actually does, how to install it, and where it stops being the right tool.
- Who is it for?
- Adopt MMEngine if you are working inside an OpenMMLab codebase, or if you want a config-driven Runner with a component registry and hook system that you do not have to write yourself. Do not adopt it if you need a stable API for a long-lived product, because the newest releases are v0.11.0rc1, v0.11.0rc2 and v0.11.0rc3, all release candidates, and the README documents no rollback path.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 79 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What MMEngine solves, and who ends up using it
Training code drifts. Every project writes its own loop, its own checkpoint save, its own logging call, its own way of building a model from a name in a file. OpenMMLab had that problem across hundreds of algorithms, so MMEngine was extracted as the shared layer. The README describes it as "a foundational library for training deep learning models based on PyTorch" that "serves as the training engine of all OpenMMLab codebases", while also being "generic to be applied to non-OpenMMLab projects".
The audience is narrower than the description suggests. If you are already using an OpenMMLab codebase, MMEngine is not a choice, it is a dependency, and knowing its Runner, Registry and Config layers is how you debug anything. If you are outside OpenMMLab, the pitch is different: you get a training loop with hooks, checkpointing, distributed launch and monitoring backends already wired, in exchange for adopting its configuration conventions. Teams that already have a working trainer and no interest in config-driven assembly will find the abstraction cost higher than the savings.
The README's own example is a ResNet-50 run on CIFAR-10, built as "a complete, configurable training and validation process in less than 80 lines of code". That number is the honest summary of the value proposition: not new algorithms, but less glue.
Runner, Registry and Config: the three pieces you actually touch
The architecture visible from the repository is a component registry feeding a runner that reads a configuration file. The Registry is how a string in a config becomes a class: models, datasets, metrics, hooks and visualizers are all registered under names, and the config refers to them by those names. The README lists a BaseDataset and a BaseMetric among the searchable terms around the project, which matches the idea that datasets and metrics are registered components rather than hardcoded imports.
The Runner is the execution layer. It owns the training and validation loop, and the README ties it to the training strategies that ship with it: mixed precision training, gradient accumulation and gradient checkpointing, each with its own documentation page. Distributed execution is also part of the Runner's job, and the repository ships examples/distributed_training.py and examples/distributed_training_with_flexible_runner.py as the reference for that path.
The Config layer is where MMEngine diverges most from a plain PyTorch project. The README advertises two styles: "Pure Python-style configuration files, easy to navigate", marked beta in the documentation title, and "Plain-text-style configuration files, supporting JSON and YAML". The beta label on the Python style is worth noticing. It is the more pleasant authoring experience, and it is also the one the maintainers have not declared final.
Large-model training is handled by delegating to external frameworks rather than reimplementing them. The README names ColossalAI, DeepSpeed and FSDP as integrations, each pointing at a section of the large model training documentation.
Installing MMEngine and verifying the install
The README states that PyTorch must be installed first, following the official PyTorch guide, and that MMEngine supports PyTorch >=1.6 <=2.1 with Python >=3.8, <=3.11 for the main branch and for releases from 0.9.0 through 0.10.4.
The documented install path goes through openmim rather than plain pip. Run these two commands:
pip install -U openmim
mim install mmengineThe first installs or upgrades the mim package manager, the second uses it to resolve and install MMEngine. The README also lists the project on PyPI, so a direct pip install of the mmengine distribution is possible, but the documented sequence is the mim one.
To confirm the environment rather than assume it, the README gives a one-line check that prints the collected environment information:
python -c 'from mmengine.utils.dl_utils import collect_env;print(collect_env())'If that command prints a table instead of raising an ImportError, the package is importable and its dependency probe is working. This is the check to run before filing an issue, because it captures the PyTorch and CUDA versions the maintainers will ask for.
For a first real use, the README points at a ResNet-50 on CIFAR-10 example that builds a configurable training and validation process in under 80 lines. The examples/ directory in the repository is the broader starting point: examples/distributed_training.py for the distributed case, examples/test_time_augmentation.py, and directories for llama2, segmentation, text_classification and text_translation.
Where MMEngine is the wrong tool
The clearest limitation is release status. The three most recent releases are v0.11.0rc1, v0.11.0rc2 and v0.11.0rc3, all release candidates. A project whose newest published artifacts are RCs is telling you the API is still settling. The README does not document a rollback procedure, and it does not state a support window for older releases. If you pin a version, you own that pin.
The second constraint is the dependency range. PyTorch >=1.6 <=2.1 is a ceiling, not just a floor. If your environment has moved past that range, the README gives you no statement about compatibility, and the collect_env output is the only diagnostic the documentation offers. That is a real blocker for teams whose stack is dictated by a newer framework.
The third is the abstraction itself. A Registry plus a Config plus a Runner is three indirections between you and a model call. For a small experiment, a hand-written loop is shorter and easier to step through in a debugger. MMEngine pays off when you have many components to assemble and want the assembly to be data rather than code. If you have one model and one dataset, you are paying the cost without collecting the benefit.
Finally, the README does not document backward compatibility guarantees between minor versions, and the beta label on the pure Python config style means that the configuration format you find most pleasant is the one most likely to move.
How MMEngine differs from using PyTorch Lightning
The closest comparison is PyTorch Lightning, and the difference is where the configuration lives. Lightning organizes training around a LightningModule class: you subclass it, define training_step and configure_optimizers, and the framework calls your methods. The structure is Python-first, and a config file is optional.
MMEngine inverts that. The structure is config-first: components are registered under names, and the config file decides which ones are instantiated and in what order. The Runner is generic and you extend it through hooks rather than by subclassing the training loop. That is why the README can advertise both a pure Python config style and JSON or YAML plain-text configs for the same runner. It is the same assembly mechanism with two syntaxes.
The practical consequence: Lightning is easier to read if you think in classes, MMEngine is easier to read if you think in configuration. The second consequence is ecosystem. MMEngine is the training engine of all OpenMMLab codebases, so if you use OpenMMLab models, the config-first design is not a preference, it is how the models are shipped. Choosing Lightning there means writing an adapter.
Both cover the same ground on training strategies. Mixed precision, gradient accumulation and gradient checkpointing appear in MMEngine's README as documented features, and large-model training is delegated to ColossalAI, DeepSpeed or FSDP rather than implemented in-house.
Maintenance, release cadence and the Apache-2.0 licence
The repository is not archived, and the last push was on 2026-07-13, which is the same timestamp as the v0.11.0rc3 release. The previous two candidates, v0.11.0rc1 and v0.11.0rc2, landed on 2025-12-11 and 2025-12-23. Before that, the README's What's New section records v0.10.6 on 2025-01-13 with two named changes: custom artifact_location support in MLflowVisBackend and an exclude_frozen_parameters option for DeepSpeedEngine._zero3_consolidated_16bit_state_dict.
The upgrade cost follows from that pattern. Moving to 0.11 means moving onto a release candidate, and the changelog is the only place the project records what changed between versions. The changelog link in the README points at docs/en/notes/changelog.md. There is no documented migration guide for the 0.10 to 0.11 step, so treat the changelog as the migration document.
The licence is Apache-2.0, stated in the repository metadata and in the LICENSE file that the README badge links to. Apache-2.0 permits commercial use and modification and includes an explicit patent grant. It also requires that you preserve the licence and notice files and state significant changes. That is a general description of the licence, not legal advice; if you are redistributing MMEngine inside a product, have your own counsel read the LICENSE file rather than this summary.
Editorial conclusion
Adopt MMEngine if you are working inside an OpenMMLab codebase, or if you want a config-driven Runner with a component registry and hook system that you do not have to write yourself. Do not adopt it if you need a stable API for a long-lived product, because the newest releases are v0.11.0rc1, v0.11.0rc2 and v0.11.0rc3, all release candidates, and the README documents no rollback path. Before committing, check that your PyTorch version falls inside the documented range, run the collect_env command to confirm the install, and read the pure Python config documentation to see whether the config style fits how your team already writes training code.
Frequently asked questions
How do I install MMEngine?
Install PyTorch first following the official PyTorch guide, then run pip install -U openmim followed by mim install mmengine. The README documents this as the install path and notes support for PyTorch >=1.6 <=2.1 and Python >=3.8, <=3.11.
How do I check that MMEngine installed correctly?
The README gives a one-line verification that imports collect_env from mmengine.utils.dl_utils and prints it. If it prints the environment table, the package imports and its dependency probe runs.
What is MMEngine used for?
It is a foundational library for training deep learning models on PyTorch, and it serves as the training engine of all OpenMMLab codebases. The README also states it is generic enough to be applied to non-OpenMMLab projects.
Which PyTorch and Python versions does MMEngine support?
The README's compatibility table lists PyTorch >=1.6 <=2.1 and Python >=3.8, <=3.11 for the main branch and for releases from 0.9.0 through 0.10.4.
What configuration formats does MMEngine accept?
The README advertises a pure Python-style configuration file, marked beta, and plain-text-style configuration files supporting JSON and YAML. Both feed the same runner.
Which large-model training frameworks does MMEngine integrate with?
The README names ColossalAI, DeepSpeed and FSDP, each linking to a section of the large model training documentation. MMEngine delegates to those frameworks rather than implementing the parallelism itself.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/open-mmlab-mmengine)