Skip to main content

MosaicML Composer

MosaicML Composer contains a library of methods, and ways to compose them together for more efficient ML training. We aim to ease the transition from research to industry through reproducible code and rigorous benchmarking.

The library features:

  • Implementation of 20+ efficiency methods curated from the research community
  • Standardized approach to implement and compose efficiency methods, extended from two-way callbacks (Howard et al, 2020)
  • Easy way to access our methods either directly for your trainer loops, or through the MosaicML Trainer.

Open In Colab

Installing Composer

To install Composer:

pip install mosaicml

Using Composer

A few ways to use Composer:

  1. Import the functional form of our methods:
from composer import functional as CF
import torchvision

model = torchvision.models.resnet50()

# replaces eligible layers with BlurPool (Zhang, 2019)
CF.apply_blurpool(model)

for epoch in range(max_epochs):
    for data in your_data:
        ...
    # freeze layers at the end of every epoch
    CF.freeze_layers(model)

We have a growing collection of deeply characterized methods, see Methods.

  1. Compose methods together using our Trainer:
from composer import trainer, algorithms, Trainer

trainer_hparams = trainer.load("resnet50")
trainer_hparams.algorithms = algorithms.load_multiple("squeeze_excite", "scale_schedule")
trainer_hparams.set_datadir('your/dataset/path/')

learner = Trainer.create_from_hparams(hparams=trainer_hparams)
learner.fit()

Composer TL;DR

Composer methods are either curated from the literature, or developed internally, and rigorously measured on public benchmarks. To explore the benchmarks, see our MosaicML Explorer.

To compose methods together, we used the excellent two-way callbacks system (Howard et al, 2020). Each method is implemented as a two-way callback, and also in functional form for standalone access and extension.

Documentation

See our documentation for installation instructions and how to get started.

Community

We welcome contributions of new methods, models, and datasets Also join our community slack to talk about ML training efficiency!

Our library builds upon ideas from the broader ML community! We are exploring integrations into other libraries to make the Composer efficiency methods available to all.

Metadata

Release files for mosaicml 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mosaicml 0.3.1
File Size Uploaded
mosaicml-0.3.1.tar.gz 171.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mosaicml 0.3.1
File Interpreter ABI Platform
mosaicml-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 422.3 kB

Release files / mosaicml-0.3.1.tar.gz

Download URL mosaicml-0.3.1.tar.gz
Size 171.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1caf6c555f7c4ac0d5db25f82b119cc573c5ad78f98083981b863b6f44589e42
BLAKE2b-256 checksum
How to use checksums
5152c17a8ea03363304426233206b9f6e3d853fc79951ae2dbb9826fe8285640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / mosaicml-0.3.1-py3-none-any.whl

Download URL mosaicml-0.3.1-py3-none-any.whl
Size 250.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cfa314fe69df1acedc022fd6f49d456d8335b4fff4b3b7db0a7f22292d9fe8e
BLAKE2b-256 checksum
How to use checksums
6099dd44738c22b1d67b68e22c4449f16485990d181b989c9917591be8bd3cef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

0.32.1

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.29.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.4

2 release files

0.23.3

2 release files

0.21.3

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.17.2

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.4

2 release files

0.16.3

2 release files

0.16.2

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.13.5

2 release files

0.13.2

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page