NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MLXP: A framework for conducting replicable Machine Learning eXperiments in Python

Michael Arbel, Alexandre Zouaoui

Abstract

Replicability in machine learning (ML) research is increasingly concerning due to the utilization of complex non-deterministic algorithms and the dependence on numerous hyper-parameter choices, such as model architecture and training datasets. Ensuring reproducible and replicable results is crucial for advancing the field, yet often requires significant technical effort to conduct systematic and well-organized experiments that yield robust conclusions. Several tools have been developed to facilitate experiment management and enhance reproducibility; however, they often introduce complexity that hinders adoption within the research community, despite being well-handled in industrial settings. To address the challenge of low adoption, we propose MLXP, an open-source, simple, and lightweight experiment management tool based on Python, available at https://github.com/inria-thoth/mlxp . MLXP streamlines the experimental process with minimal practitioner overhead while ensuring a high level of reproducibility.

Introduction: The Reproducibility Crisis in ML

The "reproducibility crisis" in machine learning extends beyond simply sharing code; it involves the significant friction of managing thousands of experiments. Researchers often rely on ad-hoc scripts, making it difficult to track which specific hyperparameters or code versions produced a given result. While industrial-grade tools like MLflow or WandB are powerful, they can be intrusive, requiring substantial code reorganization or a steep learning curve.

A particularly insidious issue occurs on High-Performance Computing (HPC) clusters: the "code-queue gap." A researcher submits a job to a queue and then continues to modify their code. By the time the job actually runs, it may execute the new, modified code instead of the version intended at the time of submission. MLXP is designed to eliminate these frictions through a simple, lightweight, and minimal-intrusion approach.

The MLXP Framework

MLXP is built on top of Hydra, a popular framework for hierarchical configuration. It introduces several core components to manage the lifecycle of an experiment.

Overview of the MLXP architecture.

The framework's primary contributions include:

  • mlxp.launch Decorator: A drop-in replacement for hydra.main that provides a context object (ctx) containing both the configuration and a logger.
  • The mlxpsub Command: A shell utility for submitting "multi-run" jobs (hyperparameter sweeps) to cluster schedulers like SLURM or OAR using native syntax.
  • Lazy Reader: An interactive tool for post-processing results that treats logs like a virtual dataframe, allowing for efficient filtering and aggregation without excessive memory usage.

Addressing the Code-Queue Gap

A standout feature of MLXP is its automatic code versioning. By leveraging Git, MLXP ensures that every result is tied to the exact state of the code that produced it.

MLXP's mechanism for ensuring code-consistent execution.

When a job is submitted, MLXP creates a snapshot of the code corresponding to that specific submission time. If untracked changes exist, the tool can prompt the user to auto-commit them before launching. This mechanism ensures that even if the main code base is modified while a job waits in a scheduler queue, the job will run against the correct, intended version (e.g., Version A for Submission 1, even if the code base has moved to Version B by the time it executes).

Experimental Evaluation

The utility of MLXP has been demonstrated through integration into significant research projects:

  1. HySUPP: In this hyperspectral unmixing toolbox, MLXP allowed researchers to visualize performance across various techniques with minimal boilerplate code.
  2. Optimization Benchmarking: In a study involving 720 independent runs and 3,600 GPU hours, MLXP managed complex sweeps. Using the MLXP Reader, a 10-line script was sufficient to filter runs, group them by optimizer and noise level, and produce publication-quality plots with error bars.

Conclusion and Future Work

MLXP offers a "minimal intrusion" philosophy, integrating into existing Python workflows without requiring complex API calls. While it excels at code versioning and experiment management, future work includes extending these capabilities to native data and model versioning, as well as tracking system-level dependencies like CUDA driver versions. Currently, MLXP provides a robust foundation for researchers seeking to ensure their work is replicable with minimal overhead.

Summary updated

BibTeX
@inproceedings{arbel2024mlxp,
  author = {Michael Arbel and Alexandre Zouaoui},
  title = {{MLXP: A framework for conducting replicable Machine Learning eXperiments in Python}},
  booktitle = {ACM-REP},
  year = {2024},
  url = {https://openreview.net/forum?id=1lGvjf3uU5},
}
Figure