Google Cloud Trainium & Inferentia
  • 🌍Optimum Neuron
  • 🌍Installation
  • 🌍Quickstart
  • 🌍TUTORIALS
    • Overview
    • Fine-tune BERT for Text Classification on AWS Trainium
  • 🌍HOW-TO GUIDES
    • Overview
    • Set up AWS Trainium instance
    • Neuron model cache
    • Fine-tune Transformers with AWS Trainium
    • Export a model to Inferentia
    • Neuron models for inference
    • Inference pipelines with AWS Neuron
  • 🌍REFERENCE
    • Neuron Trainer
    • Neuron Exporter
    • Neuron Models
Powered by GitBook
On this page
  1. HOW-TO GUIDES

Set up AWS Trainium instance

PreviousOverviewNextNeuron model cache

Last updated 1 year ago

Set up AWS Trainium instance

The simplest way to work with AWS Trainium and BOINC AI Transformers is the (DLAMI). The DLAMI comes with all required libraries pre-packaged for you, including the Neuron Drivers, Transformers, Datasets, and Accelerate.

To create an EC2 Trainium instance, you can start from the console or the Marketplace. This guide will start from the .

Starting from the in the us-east-1 region, You first click on Launch an instance and define a name for the instance (trainium-boincai-demo).

Next, you search the Amazon Marketplace for BOINC AI AMIs. Entering “BOINC AI” in the search bar for “Application and OS Images” and hitting “enter”.

This should now open the “Choose an Amazon Machine Image” view with the search. You can now navigate to “AWS Marketplace AMIs” and find the and click select.

You will be asked to subscribe if you aren’t. The AMI is completely free of charge, and you will only pay for the EC2 compute.

Then you need to define a key pair, which will be used to connect to the instance via ssh. You can create one in place if you don’t have a key pair.

After that, create or select a . Important you want to allow ssh traffic.

You are ready to launch our instance. Therefore click on “Launch Instance” on the right side.

After the instance runs, you can view and copy the public IPv4 address to ssh into the machine.

Replace the empty strings "" in the snippet below with the IP address of your instances and the path to the key pair you created/selected when launching the instance.

Copied

PUBLIC_DNS="" # IP address
KEY_PATH="" # local path to key pair

ssh -i $KEY_PATH ubuntu@$PUBLIC_DNS

After you are connected, you can run neuron-ls to ensure you have access to the Trainium accelerators. You should see a similar output than below.

Copied

ubuntu@ip-172-31-79-164:~$ neuron-ls
instance-type: trn1.2xlarge
instance-id: i-0570615e41700a481
+--------+--------+--------+---------+
| NEURON | NEURON | NEURON |   PCI   |
| DEVICE | CORES  | MEMORY |   BDF   |
+--------+--------+--------+---------+
| 0      | 2      | 32 GB  | 00:1e.0 |
+--------+--------+--------+---------+

AWS will now provision the instance using the . Additional configurations can be made by increasing the disk space or creating an instance profile to access other AWS services.

You are done! You can now start using the Trainium accelerators with BOINC AI Transformers. Check out the guide to get started.

🌍
BOINC AI Neuron Deep Learning AMI
Fine-tune Transformers with AWS Trainium
BOINC AI Neuron Deep Learning AMI
EC2 console
EC2 console
BOINC AI Neuron Deep Learning AMI
security group