Getting StartedInstallation

Installation

Requirements

RequirementMinimumRecommended
Python3.103.11
PyTorch2.02.2+
CUDA11.812.1+
OSLinux / Windows / macOSLinux

A CUDA-capable GPU is recommended. MemScale also imports and runs on CPU-only hosts — useful for inspecting plans — but the memory optimizations only take effect when a GPU is present.

Install via pip

pip install memscale

MemScale is distributed as pre-built wheels on PyPI. Installing it does not pull in PyTorch — install the PyTorch build that matches your CUDA version first, following the official PyTorch instructions.

Verify the install

python -c "import memscale; print(memscale.__version__)"

This should print the installed version (for example, 1.1.0).

Optional dependencies

PackageEnablesInstall
bitsandbytes8-bit optimizers (Adam8bit, AdamW8bit)pip install bitsandbytes
transformersHugging Face Trainer integrationpip install transformers

The 8-bit optimizer path is only used when you set use_8bit_optimizer=True in your Config. If bitsandbytes is not installed, MemScale falls back to a standard optimizer and logs a notice — it will not crash your run.

Next step

Continue to the Quick Start to optimize your first model.