.. _locate-neuron-dlc-image:

Neuron Deep Learning Containers
===============================

.. contents:: Table of Contents
   :local:
   :depth: 2


Overview
--------

AWS Deep Learning Containers (DLCs) provide a set of Docker images that are pre-installed with deep learning frameworks.
The containers are optimized for performance and available in Amazon Elastic Container Registry (Amazon ECR).
DLCs make it straightforward to deploy custom ML environments in a containerized manner,
while taking advantage of the portability and reproducibility benefits of containers.

AWS Neuron DLCs are a set of Docker images for training and serving models on AWS Trainium and Inferentia instances using AWS Neuron SDK.
The sections below list all of the AWS Neuron DLCs, as well as the AWS DLCs that come pre-installed with the Neuron SDK.

.. note::
   Starting with Neuron 2.33.0, Neuron DLC images are published on Ubuntu 26.04 only.
   Ubuntu 26.04 image tags carry a ``-ubuntu26.04`` suffix.
   For the exact published tags, see the
   `Neuron DLC repository <https://github.com/aws-neuron/deep-learning-containers>`_.

.. note::
   Starting with Neuron 2.34.0, the ``pytorch-inference-vllm-neuronx`` and ``pytorch-inference-vllm-omni-neuronx``
   DLCs no longer include libraries for other accelerators.
   See :ref:`neuron-dlc-other-accelerator-libraries`.


Inference Containers
--------------------

.. list-table::
    :widths: auto
    :header-rows: 1
    :align: left
    :class: table-smaller-font-size

    * - DLC Name
      - DLC Link(s)
      - Tutorial(s)

    * - Neuron Inference Containers
      - | `Neuronx PyTorch vLLM Inference Containers <https://github.com/aws-neuron/deep-learning-containers#vllm-inference-neuronx>`_
        | `Neuronx PyTorch vLLM Omni Inference Containers <https://github.com/aws-neuron/deep-learning-containers#vllm-omni-inference-neuronx>`_
      - | :ref:`quickstart_vllm_dlc_deploy`

    * - Large Model Inference (LMI)/Deep Java Library (DJL) Containers
      - `LMI Containers <https://github.com/aws/deep-learning-containers/blob/master/available_images.md#large-model-inference-containers>`_
      -

    * - HuggingFace Inference Containers
      - | `HuggingFace PyTorch Inference Neuronx Containers <https://aws.github.io/deep-learning-containers/reference/available_images/#huggingface-pytorch-inference-neuronx>`_
        | `HuggingFace vLLM Inference Neuronx Containers <https://aws.github.io/deep-learning-containers/reference/available_images/#huggingface-vllm-inference-neuronx>`_
      -

    * - Triton Inference Containers
      - `NVIDIA Triton Inference Containers <https://github.com/aws/deep-learning-containers/blob/master/available_images.md#nvidia-triton-inference-containers-sm-support-only>`_
      -


Training Containers
-------------------

.. list-table::
    :widths: auto
    :header-rows: 1
    :align: left
    :class: table-smaller-font-size

    * - DLC Name
      - DLC Link(s)
      - Tutorial(s)

    * - Neuron Training Containers
      - `Neuronx Jax Training Containers <https://github.com/aws-neuron/deep-learning-containers#jax-training-neuronx>`_
      - :ref:`tutorial-training`

    * - HuggingFace Training Containers
      - `HuggingFace PyTorch Training Neuronx Containers <https://aws.github.io/deep-learning-containers/reference/available_images/#huggingface-pytorch-training-neuronx>`_
      -

.. note::
   Latest HuggingFace Neuron containers are also available on the `HuggingFace Optimum website <https://huggingface.co/docs/optimum-neuron/en/containers#available-optimum-neuron-containers>`_.


.. _neuron-dlc-other-accelerator-libraries:

Libraries for other accelerators
--------------------------------

Starting with Neuron 2.34.0, the ``pytorch-inference-vllm-neuronx`` and ``pytorch-inference-vllm-omni-neuronx`` DLCs no longer include libraries for other accelerators. Neuron doesn't use these libraries, so removing them doesn't affect Neuron workloads. They were dependencies of the default builds of upstream packages.

The implementation code of every package is unchanged. The changes are limited to which build of each package is installed, the build options, and the NIXL packaging.

Inference DLCs
^^^^^^^^^^^^^^

.. list-table::
    :widths: auto
    :header-rows: 1
    :align: left
    :class: table-smaller-font-size

    * - Package
      - What the vLLM and vLLM Omni images include
    * - PyTorch
      - The CPU builds of ``torch``, ``torchvision``, ``torchaudio``, and ``torchcodec`` that PyTorch publishes, instead of the default builds from PyPI. Neuron support comes from ``libtorch-neuronx-lite`` and the ``vllm-neuron`` and ``vllm-omni-neuron`` plugins.
    * - vLLM
      - vLLM built from its upstream release without kernels for other accelerators. Packages needed only by those kernels are not installed.
    * - NIXL
      - A wheel with only the LIBFABRIC plugin, which transfers the KV cache over EFA for disaggregated inference. It is built from the upstream NIXL release with packaging changes, and installed as the ``nixl`` package. The NIXL implementation code is unchanged.
    * - ``triton`` and ``fa3-fwd``
      - ``triton`` is not installed. The vLLM Omni images also don't install ``fa3-fwd``. Neuron does not use either package.
    * - ``numba``
      - The upstream package without two header files for its target for other accelerators.

Because ``triton`` and ``fa3-fwd`` are not installed, ``pip check`` reports these missing dependencies. These messages are expected:

* ``xgrammar`` requires ``triton``, in vLLM and vLLM Omni.
* ``openai-whisper`` requires ``triton``, in vLLM Omni.
* ``vllm-omni`` requires ``fa3-fwd``, in vLLM Omni.

Training DLC
^^^^^^^^^^^^

The ``torch-neuronx`` DLC installs the CPU build of ``torch`` that PyTorch publishes. Neuron support comes from ``torch-neuronx``. This change shipped in Neuron 2.33.1.

Installing the original packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If your workload needs the original packages, install them on top of the image from their usual sources, such as PyPI. Installing them can replace the package versions that Neuron tested with the image, so test your workload after you install them.

Getting started with Neuron DLC using Docker
----------------------------------------------

:doc:`/deploy/environments/docker-setup`


Using containers on AWS services
----------------------------------

* :doc:`Amazon EKS </deploy/eks/index>` — Deploy DLCs on Kubernetes with device plugins and DRA
* :doc:`Amazon ECS </deploy/ecs/index>` — Run DLC tasks on ECS with node problem detection
* :doc:`Amazon SageMaker </deploy/sagemaker/index>` — Use managed ML services with Neuron
* :doc:`AWS Batch </deploy/batch/index>` — Execute batch training jobs with DLCs
* :doc:`Amazon EC2 </deploy/ec2/inference-dlc>` — Run a DLC directly on EC2 with Docker


Customizing Neuron Deep Learning Containers
-------------------------------------------
Deep Learning Containers can be customized to fit your specific project needs.
To read more, visit :doc:`/deploy/environments/customize-dlc`.
