Installing AutoGluon¶
Note
AutoGluon requires Python version 3.8, 3.9, 3.10, or 3.11 and is available on Linux, MacOS, and Windows.
The AutoGluon library comes pre-installed in all releases of Amazon SageMaker Distribution. For more information, refer to the dropdown AutoGluon in Amazon SageMaker Studio in this page.
We recommend most users to install via pip. The pip install of AutoGluon is the version we actively benchmark and test on. The Conda install may have subtle differences in installed dependencies that could impact performance and stability, and we recommend trying pip if you run into issues with Conda.
pip install -U pip
pip install -U setuptools wheel
# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cpu
pip install autogluon
pip install -U pip
pip install -U setuptools wheel
pip install autogluon
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon
mamba install -c conda-forge "ray-tune >=2.6.3,<2.7" "ray-default >=2.6.3,<2.7" # install ray for faster training
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon "pytorch=*=cuda*"
mamba install -c conda-forge "ray-tune >=2.6.3,<2.7" "ray-default >=2.6.3,<2.7" # install ray for faster training
pip install -U pip
pip install -U setuptools wheel
# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cpu
git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
pip install -U pip
pip install -U setuptools wheel
git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
LightGBM support on MacOS (LibOMP)
AutoGluon dependency LightGBM uses libomp
for multi-threading. If you install libomp
via brew install libomp
, you may get segmentation faults due to incompatible library versions. Install a compatible version using the following commands:
# Uninstall libomp if it was previous installed
brew uninstall -f libomp
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew install libomp.rb
rm libomp.rb
pip install -U pip
pip install -U setuptools wheel
pip install autogluon
Warning
GPU usage is not yet supported on macOS, please use Linux or Windows to utilize GPUs in AutoGluon.
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon
Warning
GPU usage is not yet supported on macOS, please use Linux or Windows to utilize GPUs in AutoGluon.
LightGBM support on MacOS (LibOMP)
AutoGluon dependency LightGBM uses libomp
for multi-threading. If you install libomp
via brew install libomp
, you may get segmentation faults due to incompatible library versions. Install a compatible version using the following commands:
# Uninstall libomp if it was previous installed
brew uninstall -f libomp
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew install libomp.rb
rm libomp.rb
pip install -U pip
pip install -U setuptools wheel
git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
Warning
GPU usage is not yet supported on macOS, please use Linux or Windows to utilize GPUs in AutoGluon.
Note
If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.
To install AutoGluon on Windows, it is recommended to use Anaconda:
-
If Anaconda is already installed but is an old version, follow this guide to update
Open Anaconda Prompt (anaconda3)
Inside Anaconda Prompt, do the following:
conda create -n myenv python=3.9 -y
conda activate myenv
Continue with the remaining installation steps using the conda environment created above
pip install -U pip
pip install -U setuptools wheel
# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cpu
pip install autogluon
Note
If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.
To install AutoGluon on Windows, it is recommended to use Anaconda:
-
If Anaconda is already installed but is an old version, follow this guide to update
Open Anaconda Prompt (anaconda3)
Inside Anaconda Prompt, do the following:
conda create -n myenv python=3.9 cudatoolkit=11.3 -y
conda activate myenv
Install the proper GPU PyTorch version by following the PyTorch Install Documentation (Recommended). Alternatively, use the following command:
pip install torchvision~=0.15.1 --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu118
Sanity check that your installation is valid and can detect your GPU via testing in Python:
import torch
print(torch.cuda.is_available()) # Should be True
print(torch.cuda.device_count()) # Should be > 0
Continue with the remaining installation steps using the conda environment created above
pip install -U pip
pip install -U setuptools wheel
pip install autogluon
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge autogluon
mamba install -c conda-forge "ray-tune >=2.6.3,<2.7" "ray-default >=2.6.3,<2.7" # install ray for faster training
conda create -n ag python=3.10
conda activate ag
conda install -c conda-forge mamba
mamba install -c conda-forge -c pytorch -c nvidia autogluon "pytorch=*=*cuda*"
mamba install -c conda-forge "ray-tune >=2.6.3,<2.7" "ray-default >=2.6.3,<2.7" # install ray for faster training
Note
If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.
To install AutoGluon on Windows, it is recommended to use Anaconda:
-
If Anaconda is already installed but is an old version, follow this guide to update
Open Anaconda Prompt (anaconda3)
Inside Anaconda Prompt, do the following:
conda create -n myenv python=3.9 -y
conda activate myenv
Continue with the remaining installation steps using the conda environment created above
pip install -U pip
pip install -U setuptools wheel
# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cpu
git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
Note
If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.
To install AutoGluon on Windows, it is recommended to use Anaconda:
-
If Anaconda is already installed but is an old version, follow this guide to update
Open Anaconda Prompt (anaconda3)
Inside Anaconda Prompt, do the following:
conda create -n myenv python=3.9 cudatoolkit=11.3 -y
conda activate myenv
Install the proper GPU PyTorch version by following the PyTorch Install Documentation (Recommended). Alternatively, use the following command:
pip install torchvision~=0.15.1 --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu118
Sanity check that your installation is valid and can detect your GPU via testing in Python:
import torch
print(torch.cuda.is_available()) # Should be True
print(torch.cuda.device_count()) # Should be > 0
Continue with the remaining installation steps using the conda environment created above
pip install -U pip
pip install -U setuptools wheel
git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
Install specific AutoGluon modules and dependencies
AutoGluon is modularized into sub-modules specialized for tabular, multimodal, or time series data. You can reduce the number of dependencies required by solely installing a specific sub-module via: pip install <submodule>
, where <submodule>
may be one of the following options:
autogluon.tabular
- functionality for tabular data (TabularPredictor)The default installation of
autogluon.tabular
standalone is a skeleton installation.Install via
pip install autogluon.tabular[all]
to get the same installation of tabular as viapip install autogluon
Available optional dependencies:
lightgbm,catboost,xgboost,fastai,ray
. These are included inall
.Optional dependencies not included in
all
:tabpfn,vowpalwabbit,imodels,skex,skl2onnx
.To run
autogluon.tabular
with only the optional LightGBM and CatBoost models for example, you can do:pip install autogluon.tabular[lightgbm,catboost]
Optional dependency:
skex
. This will speedup KNN models by 25x in training and inference on CPU. Usepip install autogluon.tabular[all,skex]
to enable. Note: Not compatible with ARM processors.Experimental optional dependency:
tabpfn
. This will enable the usage of the TabPFN model, and allow you to fit TabPFN in TabularPredictor. Usepip install autogluon.tabular[all,tabpfn]
to enable.Optional dependency:
vowpalwabbit
. This will install the VowpalWabbit package and allow you to fit VowpalWabbit in TabularPredictor.Experimental optional dependency:
imodels
. This will install the imodels package and allow you to fit interpretable models in TabularPredictor.Optional dependency:
skl2onnx
. This will enable ONNX model compilation viapredictor.compile()
on supported models.
autogluon.multimodal
- functionality for image, text, and multimodal problems. Focus on deep learning models.To try object detection functionality using
MultiModalPredictor
, please install additional dependencies viamim install "mmcv==2.1.0"
,pip install "mmdet==3.2.0"
andpip install pycocotools
. Note that Windows users should also installpycocotools
by:pip install pycocotools-windows
, but it only supports python 3.6/3.7/3.8.
autogluon.timeseries
- only functionality for time series data (TimeSeriesPredictor).autogluon.common
- helper functionality. Not useful standalone.autogluon.core
- only core functionality (Searcher/Scheduler) useful for hyperparameter tuning of arbitrary code/models.autogluon.features
- only functionality for feature generation / feature preprocessing pipelines (primarily related to Tabular data).autogluon.eda
- (Deprecated) only functionality for exploratory data analysis.
To install a submodule from source, follow the instructions for installing the entire package from source but replace the line cd autogluon && ./full_install.sh
with cd autogluon && pip install -e {SUBMODULE_NAME}/{OPTIONAL_DEPENDENCIES}
For example, to install
autogluon.tabular[lightgbm,catboost]
from source, the command would be:cd autogluon && pip install -e tabular/[lightgbm,catboost]
To install all AutoGluon optional dependencies:
pip install autogluon && pip install autogluon.tabular[tabpfn,vowpalwabbit,imodels,skex,skl2onnx]
AutoGluon in Amazon SageMaker Studio
Amazon SageMaker Distribution is the docker environment for data science used as the default image of JupyterLab notebook instances and Code Editor in Amazon SageMaker Studio. The AutoGluon library comes pre-installed in all releases of Amazon SageMaker Distribution. SageMaker Studio users can access AutoGluon’s automation capabilities without needing to install anything additional.
To find the AutoGluon and PyTorch versions available in a SageMaker Distribution image, refer to the RELEASE.md file for your image version in the SageMaker Distribution GitHub repository.
Install from source for a specific pull-request
To build AutoGluon from source for the purposes of testing a pull-request, you can clone and install the exact branch by following these instructions. This process is useful if you are a code reviewer or want to test if a PR fixes a bug you have reported.
In this example, we are using this PR.
It is from the user innixma
and the PR branch is called accel_preprocess_bool
.
This information is provided in the PR page directly under the title of the PR (where it says into autogluon:master from Innixma:accel_preprocess_bool
).
# Edit these two variables to change which PR / branch is being installed
GITHUB_USER=innixma
BRANCH=accel_preprocess_bool
pip install -U pip
git clone --depth 1 --single-branch --branch ${BRANCH} --recurse-submodules https://github.com/${GITHUB_USER}/autogluon.git
cd autogluon && ./full_install.sh
Note that the above example is only valid while the branch still exists. A user could delete the branch after the PR is merged, so this advice is primarily focused on unmerged PRs.
Install nightly builds
AutoGluon offers nightly builds that can be installed using the --pre
argument. Nightly builds have the latest features but have not been as rigorously tested as stable releases.
pip install --pre autogluon
M1 and M2 Apple Silicon
Apple Silicon is now supported via the conda
installation instructions outlined above. conda-forge
will install the GPU version if a user’s machine supports it.
Kaggle
AutoGluon is actively used by the Kaggle community. You can find hundreds of Kaggle notebooks using AutoGluon here.
For Kaggle competitions that allow internet access in notebooks, you can install AutoGluon via the following line at the start of the notebook:
!pip install -U autogluon > /dev/null
For competitions without internet access, you can obtain AutoGluon by using one of the Kaggle community’s packaged AutoGluon artifacts in the form of a Kaggle dataset.
If you encounter issues after installing AutoGluon, try restarting the notebook runtime to ensure a clean memory state.
Trouble Shooting
If you encounter installation issues not covered here, please create a GitHub issue.