{"id":1067876,"date":"2024-06-12T02:51:12","date_gmt":"2024-06-12T06:51:12","guid":{"rendered":"https:\/\/www.immortalitymedicine.tv\/get-started-quickly-with-aws-trainium-and-aws-inferentia-using-aws-neuron-dlami-and-aws-neuron-dlc-amazon-aws-blog\/"},"modified":"2024-08-18T11:40:22","modified_gmt":"2024-08-18T15:40:22","slug":"get-started-quickly-with-aws-trainium-and-aws-inferentia-using-aws-neuron-dlami-and-aws-neuron-dlc-amazon-aws-blog","status":"publish","type":"post","link":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/machine-learning\/get-started-quickly-with-aws-trainium-and-aws-inferentia-using-aws-neuron-dlami-and-aws-neuron-dlc-amazon-aws-blog.php","title":{"rendered":"Get started quickly with AWS Trainium and AWS Inferentia using AWS Neuron DLAMI and AWS Neuron DLC | Amazon &#8230; &#8211; AWS Blog"},"content":{"rendered":"<p><p>    Starting with the AWS Neuron 2.18 release, you can now    launch Neuron DLAMIs (AWS Deep    Learning AMIs) and Neuron DLCs (AWS Deep    Learning Containers) with the latest released Neuron packages    on the same day as the Neuron SDK release. When a Neuron    SDK is released, youll now be notified of the support for    Neuron DLAMIs and Neuron DLCs in the Neuron SDK release notes,    with a link to the AWS documentation containing the DLAMI and DLC release notes.    In addition, this release introduces a number of features that    help improve user experience for Neuron DLAMIs and DLCs. In    this post, we walk through some of the support highlights with    Neuron 2.18.  <\/p>\n<p>    The DLAMI is a pre-configured AMI that comes with popular deep    learning frameworks like TensorFlow, PyTorch, Apache MXNet, and    others pre-installed. This allows machine learning (ML)    practitioners to rapidly launch an Amazon Elastic Compute Cloud (Amazon EC2)    instance with a ready-to-use deep learning environment, without    having to spend time manually installing and configuring the    required packages. The DLAMI supports various instance types,    including Neuron Trainium and Inferentia powered instances, for    accelerated training and inference.  <\/p>\n<p>    AWS 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.  <\/p>\n<p>    The Neuron Multi-Framework DLAMI for Ubuntu 22 provides    separate virtual environments for multiple ML frameworks:    PyTorch 2.1, PyTorch 1.13, Transformers NeuronX, and TensorFlow    2.10. DLAMI offers you the convenience of having all these    popular frameworks readily available in a single AMI,    simplifying their setup and reducing the need for multiple    installations.  <\/p>\n<p>    This new Neuron Multi-Framework DLAMI is now the default choice    when launching Neuron instances for Ubuntu through the AWS Management Console, making it even faster    for you to get started with the latest Neuron capabilities    right from the Quick Start AMI list.  <\/p>\n<p>    The existing Neuron DLAMIs for PyTorch 1.13 and TensorFlow 2.10    have been updated with the latest 2.18 Neuron SDK, making sure    you have access to the latest performance optimizations and    features for both Ubuntu 20 and Amazon Linux 2 distributions.  <\/p>\n<p>    Neuron 2.18 also introduces support in Parameter Store, a    capability of AWS Systems Manager, for    Neuron DLAMIs, allowing you to effortlessly find and query the    DLAMI ID with the latest Neuron SDK release. This feature    streamlines the process of launching new instances with the    most up-to-date Neuron SDK, enabling you to automate your    deployment workflows and make sure youre always using the    latest optimizations.  <\/p>\n<p>    To provide customers with more deployment options, Neuron DLCs    are now hosted both in the public Neuron ECR repository    and as private images. Public    images provide seamless integration with AWS ML deployment    services such as Amazon EC2, Amazon Elastic Container Service (Amazon ECS),    and Amazon Elastic Kubernetes Service (Amazon EKS);    private images are required when using Neuron DLCs with    Amazon SageMaker.  <\/p>\n<p>    Prior to this release, Dockerfiles for Neuron DLCs were located    within the AWS\/Deep Learning Containers    repository. Moving forward, Neuron containers can be found in    the AWS-Neuron\/ Deep Learning    Containers repository.  <\/p>\n<p>    The Neuron SDK documentation and AWS documentation sections for    DLAMI and DLC now have up-to-date user guides about Neuron. The    Neuron SDK documentation also includes a dedicated DLAMI    section with guides on discovering, installing, and upgrading    Neuron DLAMIs, along with links to release notes in AWS    documentation.  <\/p>\n<p>    AWS Trainium and AWS Inferentia are custom ML chips    designed by AWS to accelerate deep learning workloads in the    cloud.  <\/p>\n<p>    You can choose your desired Neuron DLAMI when launching Trn and    Inf instances through the console or infrastructure automation    tools like AWS Command Line Interface (AWS CLI). After    a Trn or Inf instance is launched with the selected DLAMI, you    can activate the virtual environment corresponding to your    chosen framework and begin using the Neuron SDK. If youre    interested in using DLCs, refer to the DLC documentation    section in the Neuron SDK documentation or the DLC release    notes section in the AWS documentation to find the list of    Neuron DLCs with the latest Neuron SDK release. Each DLC in the    list includes a link to the corresponding container image in    the Neuron container registry. After choosing a specific DLC,    please refer to the DLC walkthrough in the next section to    learn how to launch scalable training and inference workloads    using AWS services like Kubernetes (Amazon EKS), Amazon ECS,    Amazon EC2, and SageMaker. The following sections    contain walkthroughs for both the Neuron DLC and    DLAMI.  <\/p>\n<p>    In this section, we provide resources to help you use    containers for your accelerated deep learning model    acceleration on top of AWS Inferentia and Trainium enabled    instances.  <\/p>\n<p>    The section is organized based on the target deployment    environment and use case. In most cases, it is recommended to    use a preconfigured DLC from AWS. Each DLC is    preconfigured to have all the Neuron components installed and    is specific to the chosen ML framework.  <\/p>\n<p>    The PyTorch Neuron DLC images are published to ECR Public    Gallery, which is the recommended URL to use for most cases. If    youre working within SageMaker, use the Amazon ECR URL instead    of the Amazon ECR Public Gallery. TensorFlow DLCs are not    updated with the latest release. For earlier releases, refer to    Neuron Containers. In the    following sections, we provide the recommended steps for    running an inference or training job in Neuron DLCs.  <\/p>\n<p>    Prepare your infrastructure (Amazon EKS, Amazon ECS, Amazon    EC2, and SageMaker) with AWS Inferentia or Trainium instances    as worker nodes, making sure they have the necessary roles    attached for Amazon ECR read access to retrieve container    images from Amazon ECR:    arn:aws:iam::aws:policy\/AmazonEC2ContainerRegistryReadOnly.  <\/p>\n<p>    When setting up hosts for Amazon EC2 and Amazon ECS, using    Deep Learning AMI (DLAMI) is    recommended. An Amazon EKS optimized GPU AMI is recommended to    use in Amazon EKS.  <\/p>\n<p>    You also need the ML job scripts ready with a command to invoke    them. In the following steps, we use a single file, train.py,    as the ML job script. The command to invoke it is    torchrun nproc_per_node=2 nnodes=1 train.py.  <\/p>\n<p>    Extend the Neuron DLC to include your ML job scripts and other    necessary logic. As the simplest example, you can have the    following Dockerfile:  <\/p>\n<p>    This Dockerfile uses the Neuron PyTorch training container as a    base and adds your training script, train.py, to    the container.  <\/p>\n<p>    Complete the following steps:  <\/p>\n<p>    You can now run the extended Neuron DLC in different AWS    services.  <\/p>\n<p>    For Amazon EKS, create a simple pod YAML file to use the    extended Neuron DLC. For example:  <\/p>\n<p>    Use kubectl apply -f <pod-file-name>.yaml to    deploy this pod in your Kubernetes cluster.  <\/p>\n<p>    For Amazon ECS, create a task definition that references your    custom Docker image. The following is an example JSON task    definition:  <\/p>\n<p>    This definition sets up a task with the necessary configuration    to run your containerized application in Amazon ECS.  <\/p>\n<p>    For Amazon EC2, you can directly run your Docker container:  <\/p>\n<p>    For SageMaker, create a model with your container and specify    the training job command in the SageMaker SDK:  <\/p>\n<p>    This section walks through launching an Inf1, Inf2, or Trn1    instance using the Multi-Framework DLAMI in the Quick Start AMI    list and getting the latest DLAMI that supports the newest    Neuron SDK release easily.  <\/p>\n<p>    The Neuron DLAMI is a multi-framework DLAMI that supports    multiple Neuron frameworks and libraries. Each DLAMI is    pre-installed with Neuron drivers and support all Neuron    instance types. Each virtual environment that corresponds to a    specific Neuron framework or library comes pre-installed with    all the Neuron libraries, including the Neuron compiler and    Neuron runtime needed for you to get started.  <\/p>\n<p>    This release introduces a new Multi-Framework DLAMI for Ubuntu    22 that you can use to quickly get started with the latest    Neuron SDK on multiple frameworks that Neuron supports as well    as Systems Manager (SSM) parameter support for DLAMIs to    automate the retrieval of the latest DLAMI ID in cloud    automation flows.  <\/p>\n<p>    For instructions on getting started with the multi-framework    DLAMI through the console, refer to Get Started with Neuron on    Ubuntu 22 with Neuron Multi-Framework DLAMI. If you want to    use the Neuron DLAMI in your cloud automation flows, Neuron    also supports SSM parameters to retrieve    the latest DLAMI ID.  <\/p>\n<p>    Complete the following steps:  <\/p>\n<p>    Activate your desired virtual environment, as    shown in the following screenshot.  <\/p>\n<p>    After you have activated the virtual environment, you can try    out one of the tutorials listed in the corresponding framework    or library training and inference section.  <\/p>\n<\/p>\n<p>    Neuron DLAMIs support SSM parameters to quickly    find Neuron DLAMI IDs. As of this writing, we only support    finding the latest DLAMI ID that corresponds to the latest    Neuron SDK release with SSM parameter support. In the future    releases, we will add support for finding the DLAMI ID using    SSM parameters for a specific Neuron release.  <\/p>\n<p>    You can find the DLAMI that supports the latest Neuron SDK by    using the get-parameter command:  <\/p>\n<p>    For example, to find the latest DLAMI ID for the    Multi-Framework DLAMI (Ubuntu 22), you can use the following    code:  <\/p>\n<p>    You can find all available parameters supported in Neuron    DLAMIs using the AWS CLI:  <\/p>\n<p>    You can also view the SSM parameters supported in Neuron    through Parameter Store by selecting the    neuron service.  <\/p>\n<p>    You can use the AWS CLI to find the latest DLAMI ID and launch    the instance simultaneously. The following code snippet shows    an example of launching an Inf2 instance using a    multi-framework DLAMI:  <\/p>\n<p>    You can also use SSM parameters directly in launch templates.    You can update your Auto Scaling groups to use new AMI IDs    without needing to create new launch templates or new versions    of launch templates each time an AMI ID changes.  <\/p>\n<p>    When youre done running the resources that you deployed as    part of this post, make sure to delete or stop them from    running and accruing charges:  <\/p>\n<p>    In this post, we introduced several enhancements incorporated    into Neuron 2.18 that improve the user experience and    time-to-value for customers working with AWS Inferentia and    Trainium instances. Neuron DLAMIs and DLCs with the latest    Neuron SDK on the same day as the release means you can    immediately benefit from the latest performance optimizations,    features, and documentation for installing and upgrading Neuron    DLAMIs and DLCs.  <\/p>\n<p>    Additionally, you can now use the Multi-Framework DLAMI, which    simplifies the setup process by providing isolated virtual    environments for multiple popular ML frameworks. Finally, we    discussed Parameter Store support for Neuron DLAMIs that    streamlines the process of launching new instances with the    most up-to-date Neuron SDK, enabling you to automate your    deployment workflows with ease.  <\/p>\n<p>    Neuron DLCs are available both private and public ECR    repositories to help you deploy Neuron in your preferred AWS    service. Refer to the following resources to get started:  <\/p>\n<p>    Niithiyn    Vijeaswaran is a Solutions Architect at AWS. His    area of focus is generative AI and AWS AI Accelerators. He    holds a Bachelors degree in Computer Science and    Bioinformatics. Niithiyn works closely with the Generative AI    GTM team to enable AWS customers on multiple fronts and    accelerate their adoption of generative AI. Hes an avid fan of    the Dallas Mavericks and enjoys collecting sneakers.  <\/p>\n<p>    Armando    Diaz is a Solutions Architect at AWS. He focuses    on generative AI, AI\/ML, and data analytics. At AWS, Armando    helps customers integrate cutting-edge generative AI    capabilities into their systems, fostering innovation and    competitive advantage. When hes not at work, he enjoys    spending time with his wife and family, hiking, and traveling    the world.  <\/p>\n<p>    Sebastian    Bustillo is an Enterprise Solutions Architect at    AWS. He focuses on AI\/ML technologies and has a profound    passion for generative AI and compute accelerators. At AWS, he    helps customers unlock business value through generative AI,    assisting with the overall process from ideation to production.    When hes not at work, he enjoys brewing a perfect cup of    specialty coffee and exploring the outdoors with his wife.  <\/p>\n<p>    Ziwen    Ning is a software development engineer at AWS. He    currently focuses on enhancing the AI\/ML experience through the    integration of AWS Neuron with containerized environments and    Kubernetes. In his free time, he enjoys challenging himself    with badminton, swimming and other various sports, and    immersing himself in music.  <\/p>\n<p>    Anant Sharma    is a software engineer at AWS Annapurna Labs specializing in    DevOps. His primary focus revolves around building, automating    and refining the process of delivering software to AWS Trainium    and Inferentia customers. Beyond work, hes passionate about    gaming, exploring new destinations and following latest tech    developments.  <\/p>\n<p>    Roopnath    Grandhi is a Sr. Product Manager at AWS. He leads    large-scale model inference and developer experiences for AWS    Trainium and Inferentia AI accelerators. With over 15 years of    experience in architecting and building AI based products and    platforms, he holds multiple patents and publications in AI and    eCommerce.  <\/p>\n<p>    Marco Punio is a Solutions    Architect focused on generative AI strategy, applied AI    solutions and conducting research to help customers hyperscale    on AWS. He is a qualified technologist with a passion for    machine learning, artificial intelligence, and mergers &    acquisitions. Marco is based in Seattle, WA and enjoys writing,    reading, exercising, and building applications in his free    time.  <\/p>\n<p>    Rohit    Talluri is a Generative AI GTM Specialist    (Tech BD) at Amazon Web Services (AWS). He is partnering with    top generative AI model builders, strategic customers, key    AI\/ML partners, and AWS Service Teams to enable the next    generation of artificial intelligence, machine learning, and    accelerated computing on AWS. He was previously an Enterprise    Solutions Architect, and the Global Solutions Lead for AWS    Mergers & Acquisitions Advisory.  <\/p>\n<p><!-- Auto Generated --><\/p>\n<p>More here:<br \/>\n<a target=\"_blank\" href=\"https:\/\/aws.amazon.com\/blogs\/machine-learning\/get-started-quickly-with-aws-trainium-and-aws-inferentia-using-aws-neuron-dlami-and-aws-neuron-dlc\/\" title=\"Get started quickly with AWS Trainium and AWS Inferentia using AWS Neuron DLAMI and AWS Neuron DLC | Amazon ... - AWS Blog\" rel=\"noopener\">Get started quickly with AWS Trainium and AWS Inferentia using AWS Neuron DLAMI and AWS Neuron DLC | Amazon ... - AWS Blog<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> Starting with the AWS Neuron 2.18 release, you can now launch Neuron DLAMIs (AWS Deep Learning AMIs) and Neuron DLCs (AWS Deep Learning Containers) with the latest released Neuron packages on the same day as the Neuron SDK release. When a Neuron SDK is released, youll now be notified of the support for Neuron DLAMIs and Neuron DLCs in the Neuron SDK release notes, with a link to the AWS documentation containing the DLAMI and DLC release notes. In addition, this release introduces a number of features that help improve user experience for Neuron DLAMIs and DLCs <a href=\"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/machine-learning\/get-started-quickly-with-aws-trainium-and-aws-inferentia-using-aws-neuron-dlami-and-aws-neuron-dlc-amazon-aws-blog.php\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"limit_modified_date":"","last_modified_date":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1231415],"tags":[],"class_list":["post-1067876","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"modified_by":null,"_links":{"self":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/1067876"}],"collection":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/comments?post=1067876"}],"version-history":[{"count":0,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/1067876\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/media?parent=1067876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/categories?post=1067876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/tags?post=1067876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}